我正嘗試在macOS Sierra中通過Homebrew安裝和使用opencv與Python 3。我遵循this tutorial的步驟,但輸入命令pip install virtualenv virtualenvwrapper
後,我得到如下所示的異常。無法安裝虛擬python環境
當我第一次嘗試安裝虛擬環境時,表示找不到pip
。我使用了sudo easy_install pip
並再次鍵入了所需的命令行。
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_set.py", line 784, in install
**kwargs
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/wheel.py", line 345, in move_wheel_files
clobber(source, lib_dir, True)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/wheel.py", line 323, in clobber
shutil.copyfile(srcfile, destfile)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 83, in copyfile
with open(dst, 'wb') as fdst:
IOError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/virtualenv.py'
但使用pipinstall --user virtualenv virtualenvwrapper
後會開得不錯。但在更新源給出here和源之後,我得到以下-bash: /usr/local/bin/virtualenvwrapper.sh: No such file or directory
即使我關閉終端和第二線重新打開它,我看到 -bash: /usr/local/bin/virtualenvwrapper.sh: No such file or directory
請幫我:(
請複製/粘貼錯誤輸出代替使用圖像。 – bfontaine
抱歉,先生,無論如何,當我複製並粘貼錯誤,我不能在終端粘貼分離線時,我粘貼在這裏。如果你不明白,你可以看到圖像中的紅線。 –
您可以使用Markdown格式來很好地分離終端中的行。 [見這裏](https://stackoverflow.com/editing-help#code)瞭解如何創建代碼塊的詳細信息。還有一些快捷方式,例如在突出顯示代碼後自動縮進,以便顯示爲代碼塊後按Ctrl + K。我編輯了您的問題以使用此功能。 – bfontaine