为什么我从不同的位置运行python版本会发生变化?

时间:2016-03-16 16:30:22

标签: python anaconda

当我从...运行python编译器时... Anaconda2> python我得到python版本2.7.11。但是当我从...运行python编译器时... Anaconda2 / Lib> python我得到python版本3.5.1。

不确定发生了什么:

C:\Anaconda2>python
Python 2.7.11 |Anaconda 2.5.0 (64-bit)| (default, Jan 29 2016, 14:26:21) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
>>> exit()

C:\Anaconda2>cd lib

C:\Anaconda2\Lib>python
Python 3.5.1 |Anaconda 2.5.0 (64-bit)| (default, Jan 29 2016, 15:01:46) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

1 个答案:

答案 0 :(得分:1)

首次在当前目录中搜索python时,在cmd Windows中键入python.exe。如果你留在C:\Anaconda2它从Anaconda2安装运行python2。当您从python执行C:\Anaconda2\lib时,Windows无法在当前文件夹中找到它,查看PATH环境变量并从另一个Anaconda安装中找到另一个python