我在ubuntu 16.04下。我已为python 3
( 3.6和3.5)安装了opencv。现在,我还需要为python2.7安装它。
为此,我已经按照以下链接:
http://www.pyimagesearch.com/2015/06/22/install-opencv-3-0-and-python-2-7-on-ubuntu/
我已经成功运行了所有步骤,直到:
mkvirtualenv cv
当我运行它时,我得到以下错误:
mkvirtualenv cv
Using base prefix '/home/ahmed/anaconda3'
New python executable in /home/ahmed/.virtualenvs/cv/bin/python
Traceback (most recent call last):
File "/home/ahmed/anaconda3/bin/virtualenv", line 11, in <module>
sys.exit(main())
File "/home/ahmed/anaconda3/lib/python3.6/site-packages/virtualenv.py", line 713, in main
symlink=options.symlink)
File "/home/ahmed/anaconda3/lib/python3.6/site-packages/virtualenv.py", line 925, in create_environment
site_packages=site_packages, clear=clear, symlink=symlink))
File "/home/ahmed/anaconda3/lib/python3.6/site-packages/virtualenv.py", line 1231, in install_python
shutil.copyfile(executable, py_executable)
File "/home/ahmed/anaconda3/lib/python3.6/shutil.py", line 115, in copyfile
with open(dst, 'wb') as fdst:
OSError: [Errno 40] Too many levels of symbolic links: '/home/ahmed/.virtualenvs/cv/bin/python'
答案 0 :(得分:1)
安装anaconda,
1.从https://www.continuum.io/downloads
下载anaconda2.移至您下载文件的目录。
3.bash Anaconda2-4.3.1-Linux-x86_64.sh for python2 OR
bash Anaconda3-4.3.1-Linux-x86_64.sh for python3
创建anaconda环境
conda create -n yourenv python=x.x anaconda
source activate yourenv