我在Google计算引擎Debian实例上。目前它具有python3.5,但没有python3.7。如何卸载python3.5并重新安装python3.7?这是一个示例:
david@instance-py3:~$ python3
Python 3.5.3 (default, Jan 19 2017, 14:11:04)
[GCC 6.3.0 20170118] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
david@instance-py3:~$ python3.7
-bash: python3.7: command not found
我不想同时拥有两者,但是请在继续操作之前先卸载python3.5。
答案 0 :(得分:1)
此答案遵循link
您需要首先下载python 3.7(例如:您下载到/ usr / src /)。 Click here to download
然后安装必备组件:
sudo apt-get install build-essential checkinstall
sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev
cd / usr / src
sudo tar xzf Python-3.7.0.tgz
cd Python-3.7.0
sudo ./configure --enable-optimizations
sudo make altinstall
就是这样。
答案 1 :(得分:1)
尝试一下。警告:我没有Debian实例可以尝试。注释一下是否可行。
要卸载Python 3.5:
sudo apt-get remove python3
要安装Python 3.7:
sudo apt install python3.7
Debian Python 3.7软件包here