在Anaconda上折腾半天,不知道是不是我设置的不对,没有收到期望的效果,以后再来看什么问题。
但是PyCharm上可以从python3切换到python2。
来吧,跟大家分享一下节约大家时间:
操作系统是win10,这台机器上装了python2.7和python 3.6. 做数值分析的材料是python2环境下的。做的Python web开发是python3。
所以我是打算在这样一台win10上,有时候可以使用python2,有时候也还可以切换到python 3。
现在说一下PyCharm。
首先“此电脑”->属性-->PATH,从系统路径里删去Python2或者python3的可执行文件的路径(eg. D:/Python2/python2.exe)。
用PyCharm做数值分析的时候,有些package用的,它没有。那么现在windows上安装,按下键win+R,输入如下:
C:\Users\ThinkPad>pip install numpy
Collecting numpy
Downloading numpy-1.11.2-cp27-none-win_amd64.whl (7.4MB)
100% |████████████████████████████████| 7.4MB 97kB/s
Installing collected packages: numpy
Successfully installed numpy-1.11.2
C:\Users\ThinkPad>pip install matplotlib
Collecting matplotlib
Downloading matplotlib-1.5.3-cp27-cp27m-win_amd64.whl (6.1MB)
100% |████████████████████████████████| 6.1MB 176kB/s
Collecting cycler (from matplotlib)
Downloading cycler-0.10.0-py2.py3-none-any.whl
Collecting pyparsing!=2.0.4,!=2.1.2,>=1.5.6 (from matplotlib)
Downloading pyparsing-2.1.10-py2.py3-none-any.whl (56kB)
100% |████████████████████████████████| 61kB 1.9MB/s
Collecting pytz (from matplotlib)
Downloading pytz-2016.10-py2.py3-none-any.whl (483kB)
100% |████████████████████████████████| 491kB 1.2MB/s
Requirement already satisfied: numpy>=1.6 in d:\python2\lib\site-packages (from matplotlib)
Collecting python-dateutil (from matplotlib)
Downloading python_dateutil-2.6.0-py2.py3-none-any.whl (194kB)
100% |████████████████████████████████| 194kB 1.4MB/s
Collecting six (from cycler->matplotlib)
Downloading six-1.10.0-py2.py3-none-any.whl
Installing collected packages: six, cycler, pyparsing, pytz, python-dateutil, matplotlib
Successfully installed cycler-0.10.0 matplotlib-1.5.3 pyparsing-2.1.10 python-dateutil-2.6.0 pytz-2016.10 six-1.10.0