python 3的Virtualenvwrapper替代品 [英] Virtualenvwrapper alternative for python 3

查看:28
本文介绍了python 3的Virtualenvwrapper替代品的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是想用 Python 3 设置一个小型开发环境.

I just wanted to setup a small development environment with Python 3.

我在安装 pipvirtualenv 时没有遇到任何问题,但是 virtualenvwrapper 似乎还不支持 Python 3(正如它在 mercurial repo).

I had no problems installing pip and virtualenv, however virtualenvwrapper does not seem to support Python 3 yet (as it states on the mercurial repo).

尝试使用 pip 安装它会产生以下错误:

Trying to install it with pip yields the following error:

  Running setup.py install for virtualenvwrapper

    changing mode of build/scripts-3.2/virtualenvwrapper.sh from 644 to 755
    Skipping installation of /usr/local/lib/python3.2/dist-packages/virtualenvwrapper/__init__.py (namespace package)
    Installing /usr/local/lib/python3.2/dist-packages/virtualenvwrapper-2.11.1-py3.2-nspkg.pth
    changing mode of /usr/local/bin/virtualenvwrapper.sh to 755
      File "/usr/local/lib/python3.2/dist-packages/virtualenvwrapper/hook_loader.py", line 137
        print '  %-10s -- %s' % (ep.name, inspect.getdoc(plugin) or '')
                            ^
    SyntaxError: invalid syntax

      File "/usr/local/lib/python3.2/dist-packages/virtualenvwrapper/user_scripts.py", line 40
        except OSError, msg:
                      ^
    SyntaxError: invalid syntax

Successfully installed virtualenvwrapper
Cleaning up...

即使最后一行说明已成功安装,我也无法调用 virtualenvwrapper 命令.

Even though the last line states successfully installed I can not invoke the virtualenvwrapper commands.

有没有人知道它的替代品适用于 Python 3?

Does anyone know an alternative to it that works with Python 3?

对于任何回到这个问题的人 - 刚刚发布了一个支持 Python 3 的版本:Virtualenvwrapper (30/01/2012).

For anyone coming back to this question - a version that supports Python 3 has just been released: Virtualenvwrapper (30/01/2012).

推荐答案

通常我会说fork it and port it".这是一个小程序,不到 1000 行代码,其中大部分是由 Dough Hellman 以清晰的最佳实践编写的.移植它可能非常简单并且是一个很好的练习.

Normally I would say "Fork it and port it". It's a small program, under a 1000 lines of code, most of which is written in clear and best practices by Dough Hellman. Porting it is probably going to be dead simple and a good exercise.

然而,在这种情况下,您需要做的就是在 bitbucket 页面中注意已经有两个拉取请求在等待,一个是 Python 3 兼容性修复.您可能可以查看并使用那个.https://bitbucket.org/dakra/virtualenvwrapper/overview

However in this case, all you need to do is notice in the bitbucket page that there are two pull requests waiting already, one which is a Python 3 compatibility fix. You can probably check out and use that one. https://bitbucket.org/dakra/virtualenvwrapper/overview

这篇关于python 3的Virtualenvwrapper替代品的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆