Pycharm + Anaconda安装以及使用

PyCharm:

两个环境变量(anaconda和anaconda scripts的路径)

             

 清华镜像

           

Python里的pip是官方自带的源,国内使用pip安装的时候十分缓慢,所以最好是更换成中国国内的源地址。

目前国内靠谱的 pip 镜像源有:

清华: https://pypi.tuna.tsinghua.edu.cn/simple

豆瓣: http://pypi.douban.com/simple/

阿里: http://mirrors.aliyun.com/pypi/simple/

建议使用清华的,豆瓣和阿里的好像是有些问题,有些包安装不上,不是很清楚什么原因。

 

设置方法:

 

 

 

 

 如果以上方法还是不可以的话

Windows下找到Python根目录下的pip文件夹,在文件夹内

新建一个文件pip.ini:

 

[global]  

timeout = 6000  

index-url = https://pypi.tuna.tsinghua.edu.cn/simple  

trusted-host = https://pypi.tuna.tsinghua.edu.cn  

 

 更新问题

问题描述:

刚开始使用Anaconda,在命令行中跟新包时,报如下错误:

[plain]  view plain  copy
  1. (D:\ProgramData\Anaconda3) D:\>conda upgrade --all  
  2. Fetching package metadata ...  
  3. CondaHTTPError: HTTP None None for url <https://repo.continuum.io/pkgs/free/win-  
  4. 64/repodata.json.bz2>  
  5. Elapsed: None  
  6.   
  7. An HTTP error occurred when trying to retrieve this URL.  
  8. HTTP errors are often intermittent, and a simple retry will get you on your way.  
  9.   
  10. ConnectionError(ReadTimeoutError("HTTPSConnectionPool(host='repo.continuum.io',  
  11. port=443): Read timed out.",),)  


原因说明:

    应该是repo.continuum.io在国外,国内访问速度太慢而引起超时


解决方案:

1. 添加“清华镜像”渠道, 在Anaconda Prompt中执行:

[html]  view plain  copy
  1. conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/  
  2. conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/  
  3. conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/  
  4. conda config --set show_channel_urls yes  

2. 删除配置文件中的 -default 行

文件路径: C:\Users\用户名XXX\.condarc



再次执行更新命令,即可正常更新。

另:清华Anaconda镜像地址:https://mirrors.tuna.tsinghua.edu.cn/help/anaconda/

查看配置的命令:

[plain]  view plain  copy
  1. conda config --show  

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

看个人简介有交流群(付费)

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值