【问题标题】:PythonAnywhere `python3.6 -m venv test` Results in ErrorPythonAnywhere `python3.6 -m venv test` 导致错误
【发布时间】:2017-09-02 20:32:30
【问题描述】:

我正在尝试在 PythonAnywhere 中直接使用 python3.6 -m venv test 来创建虚拟环境。我想使用这种方法,因为我相信它更易于移植到可能未设置 virtualenvwrapper 的其他环境。

当我运行命令时(在已升级为使用 Python 3.6 的 PA 环境中)我收到以下错误。

12:34 ~ $ python3.6 -m venv test
Error: Command '['/home/dpottsagilisys/test/bin/python3.6', '-Im', 'ensurepip', 
'--upgrade', '--default-pip']' returned non-zero exit status 1.

【问题讨论】:

    标签: pythonanywhere


    【解决方案1】:

    PythonAnywhere dev here:这似乎是 Ubuntu 14.04(显然是 15.04)中的一个错误,我们最初提出这个问题时是基于该错误。

    This Ask Ubuntu question有各种建议;这是我在 PythonAnywhere 上 100% 完成的作品:

    python3.6 -m venv --without-pip test
    source test/bin/activate
    curl https://bootstrap.pypa.io/get-pip.py | python
    deactivate
    source test/bin/activate
    

    [2018 年 6 月 28 日更新:巧合的是,切换到 16.04 图像是我们目前正在处理的工作。]

    [2018 年 9 月 30 日更新:16.04 版映像现已面向新的 PythonAnywhere 帐户上线]

    【讨论】:

    • 谢谢!我在 Fedora 26 上遇到了同样的错误,这个解决方法有帮助
    • "curl bootstrap.pypa.io/get-pip.py | python" 在我尝试时产生了 403 代理错误。通过将 get-pip.py 粘贴到 github 上的文件中来解决它,然后将文件“拉”下来并运行它。
    【解决方案2】:

    Not having the package python3.6-venv 导致此问题。使用:
    sudo apt-get install python3.6-venv 安装应该可以解决。

    【讨论】:

    • 你拯救了我的一天。谢谢。
    猜你喜欢
    • 2018-07-18
    • 2019-12-06
    • 2020-12-20
    • 2022-08-15
    • 1970-01-01
    • 2017-08-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多