无法安装python 3的请求包

时间:2017-09-27 21:36:08

标签: python linux

输入时收到的消息 “pip3安装请求”:

Collecting request
Collecting setupfiles (from request)
Collecting post (from request)
Collecting get (from request)
Collecting query-string (from get->request)
Collecting public (from query-string->get->request)
Installing collected packages: setupfiles, post, public, query-string, get, request
Exception:
Traceback (most recent call last):
  File "/home/vapour/.local/lib/python3.5/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/home/vapour/.local/lib/python3.5/site-packages/pip/commands/install.py", line 342, in run
    prefix=options.prefix_path,
  File "/home/vapour/.local/lib/python3.5/site-packages/pip/req/req_set.py", line 784, in install
    **kwargs
  File "/home/vapour/.local/lib/python3.5/site-packages/pip/req/req_install.py", line 851, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "/home/vapour/.local/lib/python3.5/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files
    isolated=self.isolated,
  File "/home/vapour3005/.local/lib/python3.5/site-packages/pip/wheel.py", line 345, in move_wheel_files
    clobber(source, lib_dir, True)
  File "/home/vapour/.local/lib/python3.5/site-packages/pip/wheel.py", line 316, in clobber
    ensure_dir(destdir)
  File "/home/vapour/.local/lib/python3.5/site-packages/pip/utils/__init__.py", line 83, in ensure_dir
    os.makedirs(path)
  File "/usr/lib/python3.5/os.py", line 241, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/usr/local/lib/python3.5/dist-packages/setupfiles-0.0.50.dist-info'

如果是“sudo pip3安装请求”:

The directory '/home/vapour/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
The directory '/home/vapour/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting request
  Could not fetch URL https://pypi.python.org/simple/request/: There was a problem confirming the ssl certificate: Can't connect to HTTPS URL because the SSL module is not available. - skipping
  Could not find a version that satisfies the requirement request (from versions: )
No matching distribution found for request

当我在终端中写“python3”时,我收到以下消息:

Python 3.6.2rc1 (default, Jul 11 2017, 02:53:14) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.

如果我启动虚拟环境并尝试安装请求,那么我就得到了

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Collecting request
  Could not fetch URL https://pypi.python.org/simple/request/: There was a problem confirming the ssl certificate: Can't connect to HTTPS URL because the SSL module is not available. - skipping
  Could not find a version that satisfies the requirement request (from versions: )
No matching distribution found for request

我该怎么办?

UPD:

现在全局安装但是 在虚拟环境中我得到了

$ pip3安装请求

pip配置了需要TLS / SSL的位置,但是Python中的ssl模块不可用。

收集请求

无法获取网址https://pypi.python.org/simple/requests/:确认ssl证书时出现问题:无法连接到HTTPS网址,因为SSL模块不可用。 - 跳过

找不到满足要求请求的版本(来自版本:) 找不到请求的匹配分发

0 个答案:

没有答案