擅长:python、mysql、java
<p>您需要调整安装以使用相对路径。<code>virtualenv</code>提供了<code>--relocatable</code>选项。来自<a href="https://virtualenv.pypa.io/en/latest/userguide.html#making-environments-relocatable" rel="noreferrer">the docs</a>:</p>
<blockquote>
<p>Normally environments are tied to a
specific path. That means that you
cannot move an environment around or
copy it to another computer. You can
fix up an environment to make it
relocatable with the command:</p>
<p>$ virtualenv --relocatable ENV</p>
<p><strong>NOTE:</strong> ENV is the name of the virtual environment and you must run this from outside the ENV directory.</p>
<p>This will make some of the files
created by setuptools or distribute
use relative paths, and will change
all the scripts to use
activate_this.py instead of using the
location of the Python interpreter to
select the environment.</p>
<p>Note: you must run this after you've
installed any packages into the
environment. If you make an
environment relocatable, then install
a new package, you must run virtualenv
--relocatable again.</p>
</blockquote>