V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
Septembers
V2EX  ›  Python

如何重置 Ubuntu 14.04 的 Python 环境?

  •  
  •   Septembers · 2015-03-11 19:11:52 +08:00 · 6819 次点击
    这是一个创建于 3546 天前的主题,其中的信息可能已经有所发展或是发生改变。
    我在使用Pycharm忘记使用virtualenv。
    污染了系统的Python环境,我想重置系统的Python环境。

    Ubuntu 14.04.2
    Python 3.4.0
    6 条回复    2015-03-17 23:17:10 +08:00
    Septembers
        2
    Septembers  
    OP
       2015-03-11 22:34:35 +08:00 via Android
    @qinkun1234 文不对题
    我不是需要安装anaconda,是要重置Ubuntu的Python环境,谢谢。
    vivisidea
        3
    vivisidea  
       2015-03-12 13:27:13 +08:00
    重装 python 试试。。好像没有直接能 reset 的

    apt-get remove xx
    apt-get install xx
    vivisidea
        4
    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
        5
    qinkun1234  
       2015-03-13 10:08:00 +08:00   ❤️ 1
    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
        6
    styletjy  
       2015-03-17 23:17:10 +08:00
    重设环境变量?
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2407 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 15:59 · PVG 23:59 · LAX 07:59 · JFK 10:59
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.