在openSuSE 12.3和Python3中使用virtualenv时遇到问题:
我安装了python3
和python3-devel
个软件包。
然后我使用pip安装了最新的distribute
和pip
以及最后的virtualenv。
当我尝试创建virtualenv时,我收到以下错误:
$ virtualenv-3.3 venv01
Using base prefix '/usr'
New python executable in venv01/bin/python3.3
Also creating executable in venv01/bin/python
Installing distribute.........................................................................................................................................................................................................................................................................................................................................................................................................done.
Installing pip....
Complete output from command /home/user/venv01/bin/python3.3 -x /home/user/venv01/bin/easy_install /usr/local/lib/pytho...ort/pip-1.3.1.tar.gz:
/home/user/venv01/bin/python3.3: can't open file '/home/user/venv01/bin/easy_install': [Errno 2] No such file or directory
----------------------------------------
...Installing pip...done.
Traceback (most recent call last):
File "/usr/local/bin/virtualenv-3.3", line 9, in <module>
load_entry_point('virtualenv==1.9.1', 'console_scripts', 'virtualenv-3.3')()
File "/usr/local/lib/python3.3/site-packages/virtualenv.py", line 979, in main
no_pip=options.no_pip)
File "/usr/local/lib/python3.3/site-packages/virtualenv.py", line 1094, in create_environment
install_pip(py_executable, search_dirs=search_dirs, never_download=never_download)
File "/usr/local/lib/python3.3/site-packages/virtualenv.py", line 667, in install_pip
filter_stdout=_filter_setup)
File "/usr/local/lib/python3.3/site-packages/virtualenv.py", line 1057, in call_subprocess
% (cmd_desc, proc.returncode))
OSError: Command /home/user/venv01/bin/python3.3 -x /home/user/venv01/bin/easy_install /usr/local/lib/pytho...ort/pip-1.3.1.tar.gz failed with error code 2
使用-vvv
运行它会产生一些有趣的输出,显示distribute
被提取到<venv>/local/lib/python3.3/site-packages/
。
我想知道为什么分发版没有安装到<venv>/lib/python3.3/site-packages/
?
有没有人知道为什么会这样,以及我如何使用virtualenv
openSuSE没有自己编译python3
?
答案 0 :(得分:1)
[现已修复opensuse的最新补丁]
[OH!我刚刚意识到你和原来的链接是同一个人。抱歉。但我会留下这个,因为这是谷歌搜索这个问题的最佳结果(正在搜索自己的任何更新)所以它可能会帮助其他人。]
这是一个已知问题,在https://forums.opensuse.org/english/get-technical-help-here/applications/484475-using-virtualenv-python-3-a.html讨论并在https://bugzilla.novell.com/show_bug.cgi?id=809831处有一个漏洞
我所知道的唯一解决方法是自己安装一切。它并不那么难,我在http://www.acooke.org/cute/GettingPyt0.html
描述了什么是必要的基本上是:
从源代码安装python 3.3(安装“altinstall”以安装为/usr/local/bin/python3.3)
修复lib问题(从/usr/local/lib64/python3.3链接lib_dynload到/usr/local/lib/python3.3)
安装distutils
安装virtualenv
然后您可以按预期使用python3.3
和virtual-env-3.3
等。