【发布时间】:2021-02-26 05:10:25
【问题描述】:
我需要使用Python3.7,所以我按照这些说明安装了它
curPath=${pwd}
cd /usr/src
sudo wget https://www.python.org/ftp/python/3.7.9/Python-3.7.9.tgz
sudo tar xzf Python-3.7.9.tgz
cd Python-3.7.9
sudo ./configure --enable-optimizations
cd ${pwd}
然后我尝试运行 python -V 并得到了
Command 'python3.7' not found, did you mean:
command 'python2.7' from deb python2.7 (2.7.18-1~20.04)
command 'python3.9' from deb python3.9 (3.9.0-5~20.04)
command 'python3.8' from deb python3.8 (3.8.5-1~20.04.2)
Try: sudo apt install <deb name>
我也尝试运行whereis python 并得到了
whereis python
python: /usr/bin/python3.8 /usr/bin/python3.8-config /usr/lib/python3.8 /usr/lib/python2.7 /usr/lib/python3.9 /etc/python3.8 /usr/local/lib/python3.8 /usr/include/python3.8
【问题讨论】:
-
如果它适用于 18.04,为什么要使用 20.04。你也可以在 AWS 上使用 18.04 吗?
-
@Marcin 实际上我认为它不能在 Azure 上运行,Azure Ubuntu 刚刚安装了
python3.7,当我在 Azure 上尝试whereis python3.7时,/usr/src里面的那个没有'不出现 -
您运行了配置。你运行 make 了吗?
-
@snapshoe 是对的。另外,“configure”和“make”不需要“sudo”。只有最终的“make install”可以。
-
嗨。这个问题是怎么解决的?
标签: python amazon-web-services ubuntu