1. Pycharm添加Python解释器
- File==>other setting==>setting for new projects,然后选中Project Interpreter
- 点击右上角图标,add,Interpreter中选中anaconda安装目录下的python.exe解释器,选中后勾选Make available to all projects,然后OK。
- 之后选择右上角的图标,选择Edit configuration,选中如下的三项即可运行项目。
2. 在Pycharm上安装国内镜像加速下载
- 批量下载
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt
- 卸载并下载tensorflow
pip uninstall tensorflow
pip install tensorflow==1.15.0rc -i https://pypi.tuna.tsinghua.edu.cn/simple/
- 使用豆瓣下载安装库
pip install -i http://pypi.douban.com/simple/ --trusted-host=pypi.douban.com/simple tensorflow==1.15.0rc
- 使用清华镜像下载安装库(recommend)
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple/ --trusted-host=pypi.tuna.tsinghua.edu.cn/simple pycryptodome==3.6.6
- 国内靠谱的pip镜像源为:
清华: https://pypi.tuna.tsinghua.edu.cn/simple
豆瓣: http://pypi.douban.com/simple/
阿里: http://mirrors.aliyun.com/pypi/simple/
建议使用清华的,豆瓣和阿里的好像是有些问题,有些包安装不上,不是很清楚什么原因。
3. 设置Pycharm下载用国内镜像
- File==>other setting==>setting for new projects,然后选中Project Interpreter
- 选择右上角的"+",然后点击Manage Repositories
- 修改defaults为国内镜像