Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 3.x 无法在Python3.6中安装pip_Python 3.x_Pip - Fatal编程技术网

Python 3.x 无法在Python3.6中安装pip

Python 3.x 无法在Python3.6中安装pip,python-3.x,pip,Python 3.x,Pip,当我想安装pip时,错误就出现了: C:\Users\xd>python get-pip.py install Collecting install Exception: Traceback (most recent call last): File "C:\Users\xd\AppData\Local\Temp\tmpf2uneu6f\pip.zip\pip\basecommand.py", line 215, in main status = self.run(option

当我想安装pip时,错误就出现了:

C:\Users\xd>python get-pip.py install
Collecting install
Exception:
Traceback (most recent call last):
  File "C:\Users\xd\AppData\Local\Temp\tmpf2uneu6f\pip.zip\pip\basecommand.py", line 215, in main
    status = self.run(options, args)
  File "C:\Users\xd\AppData\Local\Temp\tmpf2uneu6f\pip.zip\pip\commands\install.py", line 324, in run
    requirement_set.prepare_files(finder)
  File "C:\Users\xd\AppData\Local\Temp\tmpf2uneu6f\pip.zip\pip\req\req_set.py", line 380, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "C:\Users\xd\AppData\Local\Temp\tmpf2uneu6f\pip.zip\pip\req\req_set.py", line 554, in _prepare_file
    require_hashes
  File "C:\Users\xd\AppData\Local\Temp\tmpf2uneu6f\pip.zip\pip\req\req_install.py", line 278, in populate_link
    self.link = finder.find_requirement(self, upgrade)
  File "C:\Users\xd\AppData\Local\Temp\tmpf2uneu6f\pip.zip\pip\index.py", line 465, in find_requirement
    all_candidates = self.find_all_candidates(req.name)
  File "C:\Users\xd\AppData\Local\Temp\tmpf2uneu6f\pip.zip\pip\index.py", line 423, in find_all_candidates
    for page in self._get_pages(url_locations, project_name):
  File "C:\Users\xd\AppData\Local\Temp\tmpf2uneu6f\pip.zip\pip\index.py", line 568, in _get_pages
    page = self._get_page(location)
  File "C:\Users\xd\AppData\Local\Temp\tmpf2uneu6f\pip.zip\pip\index.py", line 683, in _get_page
    return HTMLPage.get_page(link, session=self.session)
  File "C:\Users\xd\AppData\Local\Temp\tmpf2uneu6f\pip.zip\pip\index.py", line 792, in get_page
    "Cache-Control": "max-age=600",
  File "C:\Users\xd\AppData\Local\Temp\tmpf2uneu6f\pip.zip\pip\_vendor\requests\sessions.py", line 488, in get
    return self.request('GET', url, **kwargs)
  File "C:\Users\xd\AppData\Local\Temp\tmpf2uneu6f\pip.zip\pip\download.py", line 386, in request
    return super(PipSession, self).request(method, url, *args, **kwargs)
  File "C:\Users\xd\AppData\Local\Temp\tmpf2uneu6f\pip.zip\pip\_vendor\requests\sessions.py", line 475, in request
    resp = self.send(prep, **send_kwargs)
  File "C:\Users\xd\AppData\Local\Temp\tmpf2uneu6f\pip.zip\pip\_vendor\requests\sessions.py", line 596, in send
    r = adapter.send(request, **kwargs)
  File "C:\Users\xd\AppData\Local\Temp\tmpf2uneu6f\pip.zip\pip\_vendor\cachecontrol\adapter.py", line 47, in send
    resp = super(CacheControlAdapter, self).send(request, **kw)
  File "C:\Users\xd\AppData\Local\Temp\tmpf2uneu6f\pip.zip\pip\_vendor\requests\adapters.py", line 423, in send
    timeout=timeout
  File "C:\Users\xd\AppData\Local\Temp\tmpf2uneu6f\pip.zip\pip\_vendor\requests\packages\urllib3\connectionpool.py", line 589, in urlopen
    self._prepare_proxy(conn)
  File "C:\Users\xd\AppData\Local\Temp\tmpf2uneu6f\pip.zip\pip\_vendor\requests\packages\urllib3\connectionpool.py", line 797, in _prepare_proxy
    conn.connect()
  File "C:\Users\xd\AppData\Local\Temp\tmpf2uneu6f\pip.zip\pip\_vendor\requests\packages\urllib3\connection.py", line 254, in connect
    conn = self._new_conn()
  File "C:\Users\xd\AppData\Local\Temp\tmpf2uneu6f\pip.zip\pip\_vendor\requests\packages\urllib3\connection.py", line 142, in _new_conn
    (self.host, self.port), self.timeout, **extra_kw)
  File "C:\Users\xd\AppData\Local\Temp\tmpf2uneu6f\pip.zip\pip\_vendor\requests\packages\urllib3\util\connection.py", line 66, in create_connection
    if host.startswith('['):
AttributeError: 'NoneType' object has no attribute 'startswith'

我能做什么?

对于最新的Python版本(3.4+),您不再需要使用get-pip.py脚本。只需运行
python-m ensurepip
,ensurepip模块将完成get-pip.py脚本所做的一切。

对于最新的python版本(3.4+),您不再需要使用get-pip.py脚本。只要运行python-m ensurepip,ensurepip模块就会完成get-pip.py脚本所做的一切。

我已经成功安装了pip,但错误仍然存在。当我使用“pip3安装熊猫”时,终端显示的错误与我在问题中复制的错误相同。我已成功安装pip,但错误仍然存在。当我使用“pip3安装熊猫”时,终端显示了与我在问题中复制的相同的错误。fwiw,预期的调用是
python get pip.py
而不是
python get-pip.py install
(尝试安装名为
install
)fwiw,预期的调用是
python get-pip.py
而不是
python get-pip.py安装
(它尝试安装名为
install
)的包)