mac 下 python3.6安装 scrapy

之前使用anoconda 自带的scrapy 非常方便,后来我 在pycharm 使用python interpreter 使用的是原电脑的python3.6路径,尝试安装 在其路径下的scrapy

pip3.6 install scrapy

结果太天真,没有安装成功,以为是不是版本其他问题,结果排查了老半天都不可以,干脆就查资料,发现 主要还是长城防火墙, 最后其实只能修改 pip的源仓库

cd ~
mkdir .pip
cd .pip
touch pip.conf
vi pip.conf

添加 
[global]
index-url = https://pypi.mirrors.ustc.edu.cn/simple
trusted-host=pypi.mirrors.ustc.edu.cn
trusted-host=mirrors.aliyun.com

:wq

再次安装 可以成功安装了
其实安装源还有很多
有一点要说明一下,就是pip源的问题,国内目前的pipy镜像主要有以下几个:

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

http://pypi.hustunique.com/ 华中理工大学

http://pypi.sdutlinux.org/ 山东理工大学

http://pypi.mirrors.ustc.edu.cn/ 中国科学技术大学

http://pypi.v2ex.com/ V2EX社区

大家可以看自己需要选择,用法都一样,只需要替换配置文件当中index-url的值即可。但不要忘记后面的/simple目录!

需要注意的是 不要用 http ,应该用 https
另外就是 trust-host
要在 .pip/pip.conf 配置一下,

https://blog.csdn.net/qq_36302589/article/details/78227894
https://blog.csdn.net/libertine1993/article/details/53871455

你可能感兴趣的:(mac 下 python3.6安装 scrapy)