为什么我用 pycharm 安装第三方库老是失败啊,也百度了很多,没找到啊

2016-11-30 10:33:33 +08:00
 chenguoyu

pip install --index-url http://pypi.doubanio.com/simple/ requests

Non-zero exit code (1)

Try to run this command from the system terminal. Make sure that you use the correct version of 'pip' installed for your Python interpreter located at 'C:\Python\Python36\python.exe'.

Collecting requests

The repository located at pypi.doubanio.com is not a trusted or secure host and is being ignored. If this repository is available via HTTPS it is recommended to use HTTPS instead, otherwise you may silence this warning and allow it anyways with '--trusted-host pypi.doubanio.com'. Could not find a version that satisfies the requirement requests (from versions: ) No matching distribution found for requests

63665 次点击
所在节点    Python
26 条回复
chenguoyu
2016-11-30 10:34:26 +08:00
把 http 改成 https 也没用啊
gkiwi
2016-11-30 10:56:38 +08:00
pip install requests --trusted-host pypi.doubanio.com 试试
neoblackcap
2016-11-30 11:00:42 +08:00
换清华的源试试
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package
q397064399
2016-11-30 11:13:28 +08:00
Try to run this command from the system terminal. Make sure that you use the correct version of 'pip' installed for your Python interpreter located at 'C:\Python\Python36\python.exe'.

好好把这段给鸡翻一下,你看是不是 pip 跟 python 版本不对应
chenguoyu
2016-11-30 11:16:01 +08:00
@neoblackcap
@gkiwi
Command "python setup.py egg_info" failed with error code 1 in C:\Users\cgy\AppData\Local\Temp\pip-build-wwuh4pnj\cffi\
这是怎么回事呢?
chenguoyu
2016-11-30 11:17:40 +08:00
@q397064399 我 pip 的版本是最新的 9.01 ,应该不会吧
lrh3321
2016-11-30 11:19:31 +08:00
windows 下安装库?

你安装了 Microsoft Visual C++ Compiler for Python 2.7 或者 Microsoft Visual C++ Compiler for Python 3.4 了吗
mansur
2016-11-30 11:22:44 +08:00
LeGendAI
2016-11-30 11:28:18 +08:00
你是不是还装了 Python2.x 版,可能是用了 2.x 对应的 pip
chenguoyu
2016-11-30 11:28:59 +08:00
@lrh3321 为什么我百度不到安装包呢?能不能给个链接
chenguoyu
2016-11-30 11:29:36 +08:00
@LeGendAI 我已经卸载了,难道是没卸载干净?
LeGendAI
2016-11-30 11:46:17 +08:00
@chenguoyu 你可以 pip -V 看看是不是 3.x 的版本
lrh3321
2016-11-30 11:51:53 +08:00
@chenguoyu https://www.microsoft.com/en-us/download/details.aspx?id=44266 2.7 的

3.x 版本的话,我是直接装了 VS 2015. 你试试 Visual C++ Build Tools
http://landinghub.visualstudio.com/visual-cpp-build-tools 有没有用吧
chunk
2016-11-30 11:58:30 +08:00
最近 pypi 源抽风
SlipStupig
2016-11-30 13:19:30 +08:00
跟 VC 和 PIP 版本都没关系就是个参数问题, pip install --index-url http://pypi.doubanio.com/simple/ requests --trusted-host pypi.doubanio.com , 需要用这个参数“-trusted-host pypi.doubanio.com ”,否则为不信任源
yunfengjiang
2016-11-30 13:24:38 +08:00
命令后加上--trusted-host pypi.doubanio.com 这个参数 pip install --index-url http://pypi.doubanio.com/simple/ requests --trusted-host pypi.doubanio.com
chenguoyu
2016-11-30 14:10:58 +08:00
@LeGendAI
pip 9.0.1 from C:\Users\cgy\AppData\Roaming\Python\Python36\site-packages (python 3.6)
没有问题呀
chenguoyu
2016-11-30 15:06:48 +08:00
Command "c:\python\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\cgy\\AppData\\Local\\Temp\\pip-build-clugysos\\numpy\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.rea
d().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\cgy\AppData\Local\Temp\pip-_hf3fge5-record\install-record.txt --single-version-externally-managed --compile" fai
led with error code 1 in C:\Users\cgy\AppData\Local\Temp\pip-build-clugysos\numpy\

这是什么问题啊
misaka19000
2016-11-30 15:43:24 +08:00
给了管理员权限了吗
chenguoyu
2016-11-30 16:15:57 +08:00
@misaka19000 给了,但是没用啊。而且一般是不用给管理员权限的吧

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/324279

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX