python - Fejl under installation af virtualenv ved hjælp af pip på Windows

Indlæg af Hanne Mølgaard Plasc

Problem



Forsøger at installere virtualenv ved hjælp af pip på Windows-maskine, men vender under fejl


pip install virtualenv
    Collecting virtualenv
    Exception:
    Traceback (most recent call last): File "c:python27libsite-packagespipasecommand.py", line 215, in main status = self.run(options, args)
    File "c:python27libsite-packagespipcommandsinstall.py", line 324, in run
    requirement\_set.prepare\_files(finder)
    File "c:python27libsite-packagespip
eq
eq\_set.py", line 380, in prepare\_files ignore\_dependencies=self.ignore\_dependencies))
    File "c:python27libsite-packagespip
eq
eq\_set.py", line 620, in \_prepare\_file session=self.session, hashes=hashes)
    File "c:python27libsite-packagespipdownload.py", line 821, in unpack\_url hashes=hashes
    File "c:python27libsite-packagespipdownload.py", line 659, in unpack\_http\_url hashes)
    File "c:python27libsite-packagespipdownload.py", line 853, in \_download\_http\_url stream=True,
    File "c:python27libsite-packagespip\_vendor
equestssessions.py", line 488, in get return self.request('GET', url, **kwargs)
    File "c:python27libsite-packagespipdownload.py", line 386, in request return super(PipSession, self).request(method, url, *args, **kwargs)
    File "c:python27libsite-packagespip\_vendor
equestssessions.py", line 475, in request resp = self.send(prep, **send\_kwargs)
    File "c:python27libsite-packagespip\_vendor
equestssessions.py", line 596, in send r = adapter.send(request, **kwargs)
    File "c:python27libsite-packagespip\_vendorcachecontroladapter.py", line 47, in send resp = super(CacheControlAdapter, self).send(request, **kw)
    File "c:python27libsite-packagespip\_vendor
equestsadapters.py", line 497, in send raise SSLError(e, request=request)
    SSLError: [SSL: CERTIFICATE\_VERIFY\_FAILED] certificate verify failed (\_ssl.c:661)
    You are using pip version 9.0.1, however version 10.0.1 is available.
    You should consider upgrading via the 'python -m pip install --upgrade pip' command.

Bedste reference


Har du forsøgt at bruge cmd line som administrator til at løbe under,


pip install virtualenv


virtualenv leveres med en kopi af pip, som kopieres til hvert nyt miljø, du opretter så virtualenv er alt hvad der kræves. Du kan prøve at installere virtualenv separat som en selvstændig pakke. Hvilket er faktisk lettere for Windows-brugere. Se https://virtualenv.pypa.io/en/stable/for instruktioner. [5]

Andre referencer 1


du skal først opgradere PIP


python -m pip install --upgrade pip


så kan du installere din pakke via administratoradgang


pip install virtualenv

Andre referencer 2


Problemet løst! Der var et problem med pipen, der fulgte med Python 2.7.13, gemte denne fil (https://bootstrap.pypa.io/get-pip.py) og derefter kommandoen 'python get-pip.py' løste problemet ved at opgradere det. Da kommandoen 'python -m pip install - upgrade pip' selv gav den samme fejl som nævnt ovenfor. Tak alt! [6]