virtualenvwrapper使用预先存在的包创建新的virtualenv。如何创建一个空的mkvirtualenv?

时间:2015-07-15 18:44:35

标签: python bash virtualenvwrapper

当我在bash中为新环境运行命令mkvirtualenv newenv时,我得到的是一个环境,其中包含已存在于我系统中的现有软件包。无论我创建了多少或哪些环境,它们都拥有相同的包。 mkvirtualenv似乎只会创建重复的环境。如何创建空白环境?

对于virtualenv,

pip freeze在我的系统上与pip freeze的包稍有不同。请参阅底部的pip冻结。

我的Bash个人资料的样子

您会注意到pip冻结会返回创建新virtualenv时不应存在的包

ihors-mbp:~ olehdubno$ mkvirtualenv newenv
New python executable in newenv/bin/python2.7
Also creating executable in newenv/bin/python
Installing setuptools, pip, wheel...done.
Error: deactivate must be sourced. Run 'source deactivate'
instead of 'deactivate'.

Usage: source deactivate

removes the 'bin' directory of the environment activated with 'source
activate' from PATH. 
(newenv)ihors-mbp:~ olehdubno$ pip freeze 
arrayterator==1.0.1
backports.ssl-match-hostname==3.4.0.2
beautifulsoup4==4.3.2
blaze==0.6.0
blinker==1.3
boto==2.33.0
bunch==1.0.1
cffi==1.1.2

Python版

>>> sys.version
'2.7.10 (default, Jun  1 2015, 09:45:55) \n[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)]'

我的Bash个人资料

.bash_profile
# added by Anaconda 2.0.1 installer
export PATH="/Users/olehdubno/Downloads/Anaconda_install/anaconda/bin:$PATH"

### Added by the Heroku Toolbelt
export PATH="/usr/local/heroku/bin:$PATH"

# set where virutal environments will live
export WORKON_HOME=$HOME/.virtualenvs
# ensure all new environments are isolated from the site-packages directory
export VIRTUALENVWRAPPER_VIRTUALENV_ARGS='--no-site-packages'
# use the same directory for virtualenvs as virtualenvwrapper
export PIP_VIRTUALENV_BASE=$WORKON_HOME
# makes pip detect an active virtualenv and install to it
export PIP_RESPECT_VIRTUALENV=true
if [[ -r /usr/local/bin/virtualenvwrapper.sh ]]; then
    source /usr/local/bin/virtualenvwrapper.sh
else
    echo "WARNING: Can't find virtualenvwrapper.sh"
fi

pip冻结virtualenvwrapper

(newenv)ihors-mbp:Desktop olehdubno$ pip freeze
arrayterator==1.0.1
backports.ssl-match-hostname==3.4.0.2
beautifulsoup4==4.3.2
blaze==0.6.0
blinker==1.3
boto==2.33.0
bunch==1.0.1
cffi==1.1.2
CherryPy==3.7.0
ConfigArgParse==0.9.3
cryptography==0.9.1
cssselect==0.9.1
daemonize==2.3.1
decorator==3.4.0
dict2xml==1.3
dill==0.2.2
ecdsa==0.13
enum34==1.0.4
Flask==0.10.1
Flask-Restless==0.17.0
Flask-SQLAlchemy==2.0
Flask-WTF==0.11
folium==0.1.2
Genshi==0.7
geopy==1.4.0
george==0.2.1
gnureadline==6.3.3
google-api-python-client==1.4.0
GraphLab-Create==1.1
hpack==1.0.1
html==1.16
httplib2==0.9.1
idna==2.0
ipaddress==1.0.7
ipython==3.1.0
itsdangerous==0.24
Jinja2==2.7.3
librato-metrics==0.4.9
lxml==3.4.4
M2Crypto==0.21.1
MarkupSafe==0.23
matplotlib==1.4.3
mimerender==0.5.5
mitmproxy==0.12.1
mixpanel-py==3.1.1
mock==1.0.1
netlib==0.12.1
nltk==3.0.2
nose==1.3.6
numpy==1.9.2
oauth2client==1.4.9
oauthlib==0.7.2
pandas==0.16.1
parallel==0.2.5
paramiko==1.15.2
passlib==1.6.2
Paste==1.7.5.1
PasteDeploy==1.5.2
PasteScript==1.7.5
patsy==0.3.0
pbr==1.3.0
Pillow==2.7.0
prettytable==0.7.2
psutil==3.0.1
pupynere==1.0.15
pyasn1==0.1.7
pyasn1-modules==0.0.5
pycparser==2.14
pycrypto==2.6.1
Pydap==3.1.1
pydap.handlers.netcdf==0.6.4
PyIntervalTree==0.5
pymssql==2.1.1
pyOpenSSL==0.15.1
pyperclip==1.5.11
pysftp==0.2.8
pyshp==1.2.1
python-aggcat==0.9
python-dateutil==2.4.2
python-mimeparse==0.1.4
pytz==2015.4
pywin==0.3.1
pyzmq==14.6.0
requests==2.7.0
requests-oauthlib==0.4.2
rsa==3.1.4
scikit-learn==0.15.1
selenium==2.46.0
simplejson==3.6.5
six==1.9.0
sortedcontainers==0.9.5
SQLAlchemy==0.6.8
sqlalchemy-migrate==0.7.2
stevedore==1.6.0
Tempita==0.5.2
textblob==0.9.0
tornado==3.2.1
twitter==1.15.0
uritemplate==0.6
urllib3==1.10.4
urwid==1.3.0
virtualenv==13.1.0
virtualenv-clone==0.2.6
virtualenvwrapper==4.6.0
Werkzeug==0.10.1
wheel==0.24.0
WTForms==2.0.2

pip冻结我的系统

(newenv)ihors-mbp:Desktop olehdubno$ deactivate
ihors-mbp:Desktop olehdubno$ pip freeze
arrayterator==1.0.1
backports.ssl-match-hostname==3.4.0.2
beautifulsoup4==4.3.2
blaze==0.6.0
blinker==1.3
boto==2.33.0
bunch==1.0.1
certifi==2015.4.28
cffi==1.1.2
CherryPy==3.7.0
ConfigArgParse==0.9.3
cryptography==0.9.1
cssselect==0.9.1
daemonize==2.3.1
decorator==3.4.0
dict2xml==1.3
dill==0.2.2
ecdsa==0.13
enum34==1.0.4
Flask==0.10.1
Flask-Restless==0.17.0
Flask-SQLAlchemy==2.0
Flask-WTF==0.11
folium==0.1.2
Genshi==0.7
geopy==1.4.0
george==0.2.1
gnureadline==6.3.3
google-api-python-client==1.4.0
GraphLab-Create==1.1
hpack==1.0.1
html==1.16
httplib2==0.9.1
idna==2.0
ipaddress==1.0.7
ipython==3.1.0
itsdangerous==0.24
Jinja2==2.7.3
jsonschema==2.4.0
librato-metrics==0.4.9
lxml==3.4.4
M2Crypto==0.21.1
MarkupSafe==0.23
matplotlib==1.4.3
mimerender==0.5.5
mitmproxy==0.12.1
mixpanel-py==3.1.1
mock==1.0.1
netlib==0.12.1
nltk==3.0.2
nose==1.3.6
numpy==1.9.2
oauth2client==1.4.9
oauthlib==0.7.2
pandas==0.16.1
parallel==0.2.5
paramiko==1.15.2
passlib==1.6.2
Paste==1.7.5.1
PasteDeploy==1.5.2
PasteScript==1.7.5
patsy==0.3.0
pbr==1.3.0
Pillow==2.7.0
prettytable==0.7.2
psutil==3.0.1
psycopg2==2.5.4
pupynere==1.0.15
pyasn1==0.1.7
pyasn1-modules==0.0.5
pycparser==2.14
pycrypto==2.6.1
Pydap==3.1.1
pydap.handlers.netcdf==0.6.4
PyIntervalTree==0.5
pymssql==2.1.1
pyOpenSSL==0.15.1
pyparsing==2.0.3
pyperclip==1.5.11
pysftp==0.2.8
pyshp==1.2.1
python-aggcat==0.9
python-dateutil==2.4.2
python-mimeparse==0.1.4
pytz==2015.4
pywin==0.3.1
PyYAML==3.11
pyzmq==14.6.0
requests==2.7.0
requests-oauthlib==0.3.1
rsa==3.1.4
scikit-learn==0.15.1
selenium==2.46.0
simplejson==3.6.5
six==1.9.0
sortedcontainers==0.9.5
SQLAlchemy==0.6.8
sqlalchemy-migrate==0.7.2
stevedore==1.6.0
suds==0.4
sympy==0.7.5
Tempita==0.5.2
textblob==0.9.0
tornado==4.2
twitter==1.15.0
uritemplate==0.6
urllib3==1.10.4
urwid==1.3.0
vboxapi==1.0
virtualenv==13.1.0
virtualenv-clone==0.2.6
virtualenvwrapper==4.6.0
Werkzeug==0.10.1
WTForms==2.0.2
xlrd==0.9.3
xlwt==0.7.5

0 个答案:

没有答案