0

Trying to install virtualenv using pip on windows machine but facing below error

pip install virtualenv
    Collecting virtualenv
    Exception:
    Traceback (most recent call last): File "c:\python27\lib\site-packages\pip\basecommand.py", line 215, in main status = self.run(options, args)
    File "c:\python27\lib\site-packages\pip\commands\install.py", line 324, in run
    requirement_set.prepare_files(finder)
    File "c:\python27\lib\site-packages\pip\req\req_set.py", line 380, in prepare_files ignore_dependencies=self.ignore_dependencies))
    File "c:\python27\lib\site-packages\pip\req\req_set.py", line 620, in _prepare_file session=self.session, hashes=hashes)
    File "c:\python27\lib\site-packages\pip\download.py", line 821, in unpack_url hashes=hashes
    File "c:\python27\lib\site-packages\pip\download.py", line 659, in unpack_http_url hashes)
    File "c:\python27\lib\site-packages\pip\download.py", line 853, in _download_http_url stream=True,
    File "c:\python27\lib\site-packages\pip\_vendor\requests\sessions.py", line 488, in get return self.request('GET', url, **kwargs)
    File "c:\python27\lib\site-packages\pip\download.py", line 386, in request return super(PipSession, self).request(method, url, *args, **kwargs)
    File "c:\python27\lib\site-packages\pip\_vendor\requests\sessions.py", line 475, in request resp = self.send(prep, **send_kwargs)
    File "c:\python27\lib\site-packages\pip\_vendor\requests\sessions.py", line 596, in send r = adapter.send(request, **kwargs)
    File "c:\python27\lib\site-packages\pip\_vendor\cachecontrol\adapter.py", line 47, in send resp = super(CacheControlAdapter, self).send(request, **kw)
    File "c:\python27\lib\site-packages\pip\_vendor\requests\adapters.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.
NightOwl19
  • 402
  • 5
  • 20
Saurabh Singh
  • 256
  • 3
  • 7
  • 3
    Try upgrading pip and see if that helps. – Kevin May 04 '18 at 13:08
  • 1
    Possible duplicate of [Not able to install python packages \[SSL: TLSV1\_ALERT\_PROTOCOL\_VERSION\]](https://stackoverflow.com/questions/49768770/not-able-to-install-python-packages-ssl-tlsv1-alert-protocol-version) – Anupam May 04 '18 at 14:28
  • Thanks @Kevin! There was an issue with the pip that came with Python 2.7.13, saved this file (https://bootstrap.pypa.io/get-pip.py) and then command 'python get-pip.py' solved the problem by upgrading it. As the command 'python -m pip install --upgrade pip' was itself giving the same error as mentioned above. Thanks all! – Saurabh Singh May 05 '18 at 08:21

3 Answers3

0

Have you tried using cmd line as an administrator to run below,

pip install virtualenv

virtualenv comes with a copy of pip which gets copied into every new environment you create so virtualenv is all that is requried. You can try installing virtualenv separately as a standalone package. Which is actually easier for windows users. See https://virtualenv.pypa.io/en/stable/ for instructions.

NightOwl19
  • 402
  • 5
  • 20
0

you need to upgrade PIP first

python -m pip install --upgrade pip

then you can install your package Via Administrator Acces

pip install virtualenv
Skiller Dz
  • 739
  • 7
  • 16
0

Issue resolved! There was an issue with the pip that came with Python 2.7.13, saved this file (https://bootstrap.pypa.io/get-pip.py) and then command 'python get-pip.py' solved the problem by upgrading it. As the command 'python -m pip install --upgrade pip' was itself giving the same error as mentioned above. Thanks all!

Saurabh Singh
  • 256
  • 3
  • 7