我用 pip3 去安装模块提示找不到版本,安装任何模块都是这个回答。 pip3 install requests
Could not find a version that satisfies the requirement requests (from versions: ) No matching distribution found for requests
pip3 install PyMySQL-0.9.2-py2.py3-none-any.whl
Could not find a version that satisfies the requirement cryptography (from PyMySQL==0.9.2) (from versions: ) No matching distribution found for cryptography (from PyMySQL==0.9.2)
又遇到这种问题的大佬吗?
1
holajamc 2018-12-10 16:22:03 +08:00
更新 setuptools 或者 pip 试试呗?
|
2
careofzm 2018-12-10 17:44:28 +08:00
感觉是你的 pip 源的问题, 用阿里的源或者官方的源试试
|
3
louhang OP 我在 linux 的 python 文件夹中没有找到 Scripts 这个文件夹,和这个有关系吗?
|
4
louhang OP |
6
careofzm 2018-12-10 18:19:17 +08:00
pip search cryptography, 你先搜搜有没有这个
|
7
careofzm 2018-12-10 18:34:43 +08:00
两个建议, 一个是卸载重装 uninstall python3-pip, 另一个指定源-i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
|
8
louhang OP @careofzm
pip3 install requests -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com Exception: Traceback (most recent call last): File "/usr/local/python3/lib/python3.6/site-packages/pip/basecommand.py", line 215, in main status = self.run(options, args) File "/usr/local/python3/lib/python3.6/site-packages/pip/commands/install.py", line 342, in run prefix=options.prefix_path, File "/usr/local/python3/lib/python3.6/site-packages/pip/req/req_set.py", line 784, in install **kwargs File "/usr/local/python3/lib/python3.6/site-packages/pip/req/req_install.py", line 851, in install self.move_wheel_files(self.source_dir, root=root, prefix=prefix) File "/usr/local/python3/lib/python3.6/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files isolated=self.isolated, File "/usr/local/python3/lib/python3.6/site-packages/pip/wheel.py", line 345, in move_wheel_files clobber(source, lib_dir, True) File "/usr/local/python3/lib/python3.6/site-packages/pip/wheel.py", line 316, in clobber ensure_dir(destdir) File "/usr/local/python3/lib/python3.6/site-packages/pip/utils/__init__.py", line 83, in ensure_dir os.makedirs(path) File "/usr/local/python3/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) PermissionError: [Errno 13] Permission denied: '/usr/local/python3/lib/python3.6/site-packages/urllib3' 感觉也不是源的问题呀,这个 python 是运维给部的,我也没 root 权限,只是一个正常访问 linux 服务器的权限。 |
9
careofzm 2018-12-10 19:24:15 +08:00
你创建个虚拟环境,virtualenv 这个包安装了吧,
mkdir py3 virtualenv py3 -p python3 source py3/bin/active pip install requests 用这个虚拟环境吧, 如果没有权限,或没有 virtuanlenv 运维装一个吧 |
10
xueyoucai 2018-12-13 08:25:41 +08:00
换个源试试
|