0

在带有 Python3 的 openSuSE 12.3 中使用 virtualenv 时遇到问题:

我安装了python3python3-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/

有谁知道为什么会发生这种情况以及如何在 openSuSE 中使用 virtualenv 而无需python3自己编译?

4

1 回答 1

1

[现在在 opensuse 的最新补丁中修复]

[哦!我刚刚意识到你和原来的链接是同一个人。对不起。但我会留下这个,因为它是谷歌搜索在这个问题上的最高结果(正在搜索自己的任何更新),所以它可以帮助其他人。]

这是一个已知问题,在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 问题(将 lib_dynload 从 /usr/local/lib64/python3.3 链接到 /usr/local/lib/python3.3)

  • 安装 distutils

  • 安装虚拟环境

然后您可以按预期使用等python3.3virtual-env-3.3

于 2013-03-28T00:07:31.760 回答