python入门避坑指南

一、安装anaconda

使用anaconda虚拟环境,不要傻傻的安装python环境变量

使用python3而不要使用python2

二、安装pycharm

配置使用anaconda的虚拟环境即可,不要用pycharm自己创建的

参考链接:https://blog.csdn.net/baoxiao7872/article/details/80328224

结果:

三、更换镜像源

更换conda和pip镜像源:https://blog.csdn.net/Sagepyt/article/details/100740862

更换pip源

# Windows环境

在C:\user\username\pip\pip.ini(自行创建)中加入:


[global]
index-url=https://pypi.tuna.tsinghua.edu.cn/simple 
[install]  
trusted-host=pypi.tuna.tsinghua.edu.cn
disable-pip-version-check = true  
timeout = 6000  


# Linux环境


cd ~/
mkdir .pip
cd .pip
sudo vim pip.conf

# 加入如下内容(其实就是指定tuna源)
[global]
index-url=https://pypi.tuna.tsinghua.edu.cn/simple 
[install]  
trusted-host=pypi.tuna.tsinghua.edu.cn
disable-pip-version-check = true  
timeout = 6000  
 

四、安装TensorFlow使用稳定版本1.13.1而不要用2.0

五、安装TensorFlow GPU版本不要用CPU版本

pip install tensorflow-gpu==1.2.1

conda install tensorflow==1.13.1

MAC OS平台通过anaconda搭建tensorflow环境(Python 3.6版本)

https://blog.csdn.net/karmacode/article/details/79602800

猜你喜欢

转载自blog.csdn.net/qq_34419607/article/details/103793703