推荐学习书目
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
flyzy2005
V2EX  ›  Python

Python2 与 Python3 冲突

  •  
  •   flyzy2005 · Mar 2, 2018 via iPhone · 3671 views
    This topic created in 2993 days ago, the information mentioned may be changed or developed.

    我电脑上之前装的的是 python3 一切正常

    今天装了个软件,自带了 python27,路径在 C 盘的 python27 文件夹下。但是我调用这个文件下的 python.exe 却会调用到 python3 文件夹里的 Libs 里的 site.py 而不是它自己的。错误信息是 file=says.stderror invalid syntax

    我已经把系统环境变量 Path 里的 Pyhon 都删了,Windows7,重启了电脑,Python2 还是调用 python3 的 lib 里的东西。。。。

    我要把 Python3 卸了才行吗?

    7 replies    2018-03-03 20:03:58 +08:00
    WordTian
        1
    WordTian  
       Mar 2, 2018 via Android
    不用吧,感觉你环境变量没删干净。。。

    问一句,你是用的命令行,还是 IDE 执行的脚本?
    flyzy2005
        2
    flyzy2005  
    OP
       Mar 2, 2018 via iPhone
    @WordTian 我发现了。。除了 Path 里还有两个独立的环境变量 一个指向了 python3 的根目录 一个指向了它的 lib。。感觉自己宛如智商= =
    WordTian
        3
    WordTian  
       Mar 2, 2018 via Android
    @flyzy2005 PYTHONHOME 和 PYTHONLIB🙂
    flyzy2005
        4
    flyzy2005  
    OP
       Mar 2, 2018 via iPhone
    @WordTian 对的!🤣🤣
    fiht
        5
    fiht  
       Mar 3, 2018
    试一试 virtualenv ?
    xpresslink
        6
    xpresslink  
       Mar 3, 2018
    还是你学艺不精
    import sys; print(sys.path)
    一眼就看出来了
    WinMain
        7
    WinMain  
       Mar 3, 2018
    Anaconda
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1176 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 47ms · UTC 17:40 · PVG 01:40 · LAX 10:40 · JFK 13:40
    ♥ Do have faith in what you're doing.