python 开发环境部署

pip

通过google搜索到,2019.4月的版本是19. 需要更换源,否则会挺慢。

Windows下更换pip源为清华源

打开appdata文件夹,在资源管理器的地址栏输入%appdata%后回车:

新建一个pip文件夹,在pip文件夹里面新建一个配置文件pip.ini:

在配置文件中输入如下内容后保存即可:
[global]
timeout = 6000
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
trusted-host = pypi.tuna.tsinghua.edu.cn

再次使用pip,即会使用新源。

安装特定版本,类似于这样

pip install tensorflow==1.8

加速访问github

更改hosts,增加

192.30.253.112 github.com

151.101.13.194 github.global.ssl.fastly.net

利用shadowsocks加速git

git config --global http.proxy 'socks5://127.0.0.1:1080'
git config --global https.proxy 'socks5://127.0.0.1:1080'

IDE/编辑器

vs code

因为python3.7在python2.7后面安装,vscode缺省认可3.7版本,尽管2.7的路径在path里已经设置了。

可以在%appdata%\code\user\settings.json里这样设置:

{
"python.pythonPath": "c:\\develop\\python27\\python",
"python.linting.pylintEnabled": false,
"python.linting.flake8Enabled": true,
}

pip分别安装 pylint, flake8

sublime

参见 https://www.jianshu.com/p/c9cc9cdaa5d5

猜你喜欢

转载自www.cnblogs.com/tangxiaosheng/p/10649414.html