1、錯(cuò)誤1:
安裝virtualenvwrapper報(bào)錯(cuò):
報(bào)錯(cuò)內(nèi)容:
Couldn't find index page for 'pbr' (maybe misspelled?)
Download error on https://pypi.python.org/simple/: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645) -- Some packages may not be found!
No local packages or download links found for pbr
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-build-6hblrn57/virtualenvwrapper/setup.py", line 7, in
pbr=True,
File "/usr/lib/python3.5/distutils/core.py", line 108, in setup
_setup_distribution = dist = klass(attrs)
File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 269, in __init__
self.fetch_build_eggs(attrs['setup_requires'])
File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 313, in fetch_build_eggs
replace_conflicting=True,
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 826, in resolve
dist = best[req.key] = env.best_match(req, ws, installer)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1092, in best_match
return self.obtain(req, installer)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1104, in obtain
return installer(requirement)
File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 380, in fetch_build_egg
return cmd.easy_install(req)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 657, in easy_install
raise DistutilsError(msg)
distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('pbr')
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-6hblrn57/virtualenvwrapper/
解決辦法:
sudo pip install-i https://pypi.tuna.tsinghua.edu.cn/simple pbr
sudo pip install-i https://pypi.tuna.tsinghua.edu.cn/simple--no-deps stevedore
sudo pip install-i https://pypi.tuna.tsinghua.edu.cn/simple--no-deps virtualenvwrapper
2、錯(cuò)誤2
執(zhí)行命令 source ~/.bashrc出錯(cuò):
shuhaishiyi@shuhaishiyi:~$ source~/.bashrc
/usr/bin/python:Nomodule named virtualenvwrapper
virtualenvwrapper.sh:Therewas a problem running the initialization hooks.
IfPythoncouldnotimportthe module virtualenvwrapper.hook_loader,
check that virtualenvwrapper has been installedfor
VIRTUALENVWRAPPER_PYTHON=/usr/bin/pythonandthat PATHis
set properly.
解決辦法:“加粗斜體”的部分將ubuntu中路徑設(shè)置為python3(當(dāng)py2和py3共存的時(shí)候)
在~/.bashrc文件的最下方加入下面語(yǔ)句:
if [ -f /usr/local/bin/virtualenvwrapper.sh ]; then
? ? ? ?export WORKON_HOME=$HOME/.virtualenvs
? ? ? ?export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
? ? ? ?source /usr/local/bin/virtualenvwrapper.sh
fi