ubuntu 卸载 python3.5, 安装 python3.4 不成功
高洛峰
高洛峰 2017-04-17 17:50:14
0
5
959

有个Django的项目,需要python3.4环境,但我的 ubuntu16.04 里之前已安装了python3.5,我sudo apt-get install python3.4老是安装不了,显示:根据正则表达式“python3.4”选中了‘libpython3.4-minimal’。
尝试卸载python3.5,sudo apt-get remove python3.5, apt-get removeall python3.5都不管用,执行python3.5依旧存在。

如何安装python3.4? 如何彻底卸载python3.5?

高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

reply all(5)
左手右手慢动作

It is generally not recommended to uninstall the python that comes with the system
Please use virtualenv
Uninstalling the python that comes with the system may cause problems

巴扎黑

Why not use virtualenv或者pyenv, a standard multi-version coexistence solution

迷茫

Try to uninstall python3
If it doesn’t work, use virtualenv first

刘奇

Python3.5 is dependent on the system and cannot be uninstalled. You can try it

sudo add-apt-repository ppa:fkrull/deadsnakes
sudo apt-get update
sudo apt-get -y install python3.4
刘奇

In the ubuntu16.04 x64 server virtual machine, searching for apt search python3.4 yielded no results. I also tried more variant matching methods but yielded no results. ubuntu16.04 x64 server虚拟机, 搜索apt search python3.4无结果. 也试了更多变种的匹配方式也无结果.

事实上, 官方软件仓库中通常不会存储有一个软件或库的多个版本, 而会选择当前的最新稳定版.

因此, 推荐使用多版本环境管理. 除了上述工具, 也可使用conda. 推荐理由是, 由大公司维护, 在python官方软件源外, 还维护有一个包含大量科学计算包的源, 其中所有的包都维持最新版本.

wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
chmod u+x Miniconda3-latest-Linux-x86_64.sh && ./Miniconda3-latest-Linux-x86_64.sh
conda create -n py3.4 [pkg1, pkg2...] python=3.4  #创建python3.4环境, 可同时安装指定包
conda remove -n py3.4 --all  #删除环境及其所有包
source activate py3.4  #切换到py3.4环境, 则当前python版本为3.4
source deactivate  #还原之前的环境

创建环境时, 可指定anaconda, 其是一个包组, 包含完整的科学计算包.

这里推荐设定两个别名, alias py3.4='source activate py3.4'alias py-='source deactivate'. 注意, 别名是py-, 意为去除环境.

更多命令参数, 运行conda --help

In fact, the official software repository usually does not store multiple versions of a software or library, but the latest stable version is selected. 🎜 🎜Therefore, it is recommended to use multi-version environment management. In addition to the above tools, you can also use conda. The reason for recommendation is that it is maintained by a large company. In addition to the official software source of python, there are also Maintains a repository containing a large number of scientific computing packages, all of which are kept at the latest version.🎜 rrreee 🎜When creating an environment, you can specify anaconda, which is a package group that contains complete scientific computing packages. 🎜 🎜It is recommended to set two aliases here, alias py3.4='source activate py3.4' and alias py-='source deactivate'. Note that the alias is py-, means to remove the environment.🎜 🎜For more command parameters, run conda --help to get them.🎜
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!