Reinstall python 2.7.12 and python 3.5.2

こ雲淡風輕ζ 提交于 2020-01-01 18:18:34

问题


Good evening,

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.

Thanks in advance,

J


回答1:


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

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

So...

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


来源:https://stackoverflow.com/questions/42044346/reinstall-python-2-7-12-and-python-3-5-2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!