重新安装python 2.7.12和python 3.5.2 [英] Reinstall python 2.7.12 and python 3.5.2

查看:147
本文介绍了重新安装python 2.7.12和python 3.5.2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

晚上好

今天,我弄乱了我的笔记本电脑,试图为python 3.5.2安装一些软件包.我试图安装正确的pip版本,但是我错过了一些东西,现在我无法在两个版本中都安装任何软件包,而且我也无法解决问题.是否可以取消安装两个版本(包括所有软件包)并重新安装所有版本?我不使用Python 2.7.12(但我希望有一个干净的版本),我需要安装正确pip版本的python 3.5.2,例如,软件包NumPy,SciPy,matplotlib等.

today i messed up my laptop trying to install some packages for python 3.5.2. I tried to install the correct pip version but i missed something and now i can't install any package in both versions and i can't solve the problem. Is it possible to unistall the 2 versions (including all packages) and reinstall everything? I don't use Python 2.7.12 (but i'l like to have a clean version of it), i need python 3.5.2 with the correct pip version to install, for example, the packages NumPy, SciPy, matplotlib etc.

预先感谢

J

推荐答案

我强烈建议使用virtualenv,不要修改系统python,除非必要时安装pip和virtualenv.

I'd highly recommend using virtualenv, and never modifying the system python, except to install pip and virtualenv if necessary.

正如上面提到的,许多操作系统都希望有运行正常的python2才能起作用.

As was alluded to above, many OSes count on having a working python2 in order to function.

所以...

apt-get remove python3
apt-get install python3
pip3 install virtualenv
virtualenv -p python3 venv
. venv/bin/activate
# now you are in a nice python3 world, completely isolated from system python
# remember to say . venv/bin/python every time you do anything
# or you can even add it to your .bashrc

这篇关于重新安装python 2.7.12和python 3.5.2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆