python-3.x - 无法在 Debian 4.9 VM 上安装 python3.6
问题描述
我在 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
.
我已尝试更改默认的python,如此处详述;这似乎不起作用——事实上,当我查询ls /usr/bin/python*
. 任何人都可以就如何在此处进行操作提供一些建议吗?谢谢。
解决方案
似乎您有多个 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
pip
从同一个 Python 解释器调用。
推荐阅读
- html - 为什么 HTML/CSS“样式”有两种不同的语法以及它们的不同之处
- css - 如何从primefaces TreeTable中删除emptyMessage
- docker - 如何检索ansible模块的执行状态?
- python - 在类测试中共享函数范围的 pytest 固定装置
- javascript - 如何对超级账本结构中的数组进行排序?
- c# - 我怎样才能安全地退出自托管应用程序(退出前做一些事情)
- javascript - 将附加数据推送到 Angular.js 中的 File 对象
- javascript - jqgrid中的日期排序
- mongodb - 我应该加密数据库中的 Google 和 Facebook ID 吗?
- php - 安装了 PHP 7.3,但 phpenmod pgsql 说 php 7.2