如何重置 Ubuntu 14.04 的 Python 环境?

2015-03-11 19:11:52 +08:00
 Septembers
我在使用Pycharm忘记使用virtualenv。
污染了系统的Python环境,我想重置系统的Python环境。

Ubuntu 14.04.2
Python 3.4.0
6819 次点击
所在节点    Python
6 条回复
qinkun1234
2015-03-11 22:11:34 +08:00
Septembers
2015-03-11 22:34:35 +08:00
@qinkun1234 文不对题
我不是需要安装anaconda,是要重置Ubuntu的Python环境,谢谢。
vivisidea
2015-03-12 13:27:13 +08:00
重装 python 试试。。好像没有直接能 reset 的

apt-get remove xx
apt-get install xx
vivisidea
2015-03-12 13:31:35 +08:00
@vivisidea
尝试了下似乎不是很靠谱,会 remove 掉一堆相关的东西,试试 --reinstall 看是不是想要的效果。。

xxx:$ sudo apt-get --reinstall install python

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
gir1.2-ubuntuoneui-3.0 gir1.2-unique-3.0 gambas3-gb-form-stock libubuntuoneui-3.0-1 libkms1 pastebinit
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 154 not upgraded.
Need to get 168 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://mirrors.sohu.com/ubuntu/ precise-updates/main python amd64 2.7.3-0ubuntu2.2 [168 kB]
Fetched 168 kB in 0s (335 kB/s)
(Reading database ... 255759 files and directories currently installed.)
Preparing to replace python 2.7.3-0ubuntu2.2 (using .../python_2.7.3-0ubuntu2.2_amd64.deb) ...
Unpacking replacement python ...
Processing triggers for doc-base ...
Processing 1 changed doc-base file...
Registering documents with scrollkeeper...
Processing triggers for man-db ...
Setting up python (2.7.3-0ubuntu2.2) ..
qinkun1234
2015-03-13 10:08:00 +08:00
Anaconda是另一种换 py版本的方法:

$ conda create -n py3k python=3 ipython
...

$ source activate py3k
prepending /home/ilan/a150/envs/py3k/bin to PATH
(py3k)$ ipython
Python 3.3.2 |Continuum Analytics, Inc.| (default, Aug 5 2013, 15:04:35)
styletjy
2015-03-17 23:17:10 +08:00
重设环境变量?

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/176159

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX