win10配置python 环境
方法一:
1.安装python idle(最好安装64位的,本次安装的是32位的)
2. 添加环境变量,具体见https://blog.csdn.net/efheoihfe/article/details/79768569
默认安装时python路径为C:\Users\10859\AppData\Local\Programs\Python\Python35-32
如果仍然不行,再添加C:\Users\10859\AppData\Local\Programs\Python\Python35-32\scripts
然后重启电脑即可
3开始,cmd, 输入以下命令安装各个库
pip3 install numpy
pip3 install matplotlib
pip3 install jieba
pip3 install sklearn
pip3 install statsmodels
pip3 install pandas
pip3 install turtle,此时会报错,解决方法见https://blog.csdn.net/m511655654/article/details/86214086
注意:win10中打开.py文件可以用写字板
4安装Spyder 和jupyter
pip3 install spyder
pip3 install ipython notebook
安装完成后在C:\Users\10859\AppData\Local\Programs\Python\Python35-32\scripts中找到spyder3.exe和jupyter notebook.exe,
鼠标右键,选择发送到桌面快捷方式即可
方法二:
除了以上方法外,还有一种最简单的方法:
只需要从anaconda官网下载anaconda windows版,32位还是64位需要根据自己电脑配置选,不过目前新电脑一般都是64位的。然后默认安装anaconda,只需要一直点下一步就行。再然后进入anaconda prompt, conda install 各种库就行,安装不上就用pip install, 再不行就用pip3 install,这种方法最为简单粗暴,也非常有效。
安装完成后的截图如下:
安装过程中,我通常安装以下几个库:tensorflow, keras, pytorch, opencv-python
pip install tensorflow
pip install keras
pip install opencv-python
对于pytorch的安装,我是anaconda3.7, win10, 安装cpu版的pytorch,可以从pytorch官网找到以下命令
pip3 install torch==1.3.1+cpu torchvision==0.4.2+cpu -f https://download.pytorch.org/whl/torch_stable.html
我在安装时pip3报错,在上述命令中用pip替换pip3就好了
注: 我曾尝试pip install torch,好像有的时候会成功,有的时候报错,建议按照pytorch官网的方法安装