【问题标题】:Cannot install python3.6 on Debian 4.9 VM无法在 Debian 4.9 VM 上安装 python3.6
【发布时间】:2019-10-07 14:46:06
【问题描述】:

我在 Google 云上运行 Debian VM (4.9.189-3+deb9u1)。我想在这个实例上运行一个脚本;该脚本在我的本地机器上运行良好(Mac OSX Mojave 10.14.6;python 3.6.8)。但是,当我在 VM 上运行它时,我收到一个错误,这似乎与我的 VM 在脚本需要 python 3.6+ 时运行 python 3.4 的事实有关。

这就是问题所在。当我运行python -V 时,响应为Python 3.7.4。但是,当我尝试安装支持我要运行的脚本的库时

    pip3 install --user --upgrade -e 
    git+https://github.com/twintproject/twint.git@origin/master#egg=twint

我明白了

twint requires Python '>=3.6.0' but the running Python is 3.5.3

我试过changing the default python as detailed here;这似乎不起作用——事实上,当我查询ls /usr/bin/python* 时,python 3.6 甚至作为一个选项都不可见。任何人都可以就如何在此处进行操作提供一些建议吗?谢谢。

【问题讨论】:

    标签: python-3.x google-cloud-platform virtual-machine debian-based


    【解决方案1】:

    您似乎有多个 Python 版本可用。如果python -V 给你Python 3.7.4,你可以使用:

    $ python -m pip install --user --upgrade -e git+https://github.com/twintproject/twint.git@origin/master#egg=twint
    

    从同一个 Python 解释器调用 pip

    【讨论】:

    • 谢谢!最后,最简单的解决方案是安装 anaconda 并将其设为默认 python;无论出于何种原因,这比单独安装 python 要容易得多,并且也使依赖项更容易使用。
    猜你喜欢
    • 2014-09-28
    • 1970-01-01
    • 1970-01-01
    • 2017-06-11
    • 2020-04-17
    • 2021-06-14
    • 2019-05-07
    • 2021-08-25
    • 2018-08-12
    相关资源
    最近更新 更多