8

I recently tried to install a library using Pip, and I received this error message. I am unable to install any packages, as the same error message keeps popping up.

I notice this problem in both my main enviroment, and my venv Virtual Environment.

Any help will be much appreciated.

WARNING: Ignoring invalid distribution -illow (c:\users\brdwoo\appdata\local\programs\python\python39\lib\site-packages)
WARNING: Ignoring invalid distribution -aleido (c:\users\brdwoo\appdata\local\programs\python\python39\lib\site-packages)
WARNING: Ignoring invalid distribution -illow (c:\users\brdwoo\appdata\local\programs\python\python39\lib\site-packages)
WARNING: Ignoring invalid distribution -aleido (c:\users\brdwoo\appdata\local\programs\python\python39\lib\site-packages)
ERROR: Exception:
Traceback (most recent call last):
  File "c:\users\brdwoo\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\cli\base_command.py", line 167, in exc_logging_wrapper
    status = run_func(*args)
  File "c:\users\brdwoo\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\cli\req_command.py", line 205, in wrapper
    return func(self, options, args)

  ...

    resp = self.send(prep, **send_kwargs)
  File "c:\users\brdwoo\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\requests\sessions.py", line 645, in send
    r = adapter.send(request, **kwargs)
  File "c:\users\brdwoo\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\cachecontrol\adapter.py", line 57, in send
    resp = super(CacheControlAdapter, self).send(request, **kw)
  File "c:\users\brdwoo\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\requests\adapters.py", line 440, in send
    resp = conn.urlopen(
  File "c:\users\brdwoo\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\urllib3\connectionpool.py", line 703, in urlopen
    httplib_response = self._make_request(
  File "c:\users\brdwoo\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\urllib3\connectionpool.py", line 386, in _make_request
    self._validate_conn(conn)
  File "c:\users\brdwoo\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\urllib3\connectionpool.py", line 1040, in _validate_conn
    conn.connect()
  File "c:\users\brdwoo\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\urllib3\connection.py", line 401, in connect
    context.verify_mode = resolve_cert_reqs(self.cert_reqs)
  File "c:\users\brdwoo\appdata\local\programs\python\python39\lib\ssl.py", line 720, in verify_mode
    super(SSLContext, SSLContext).verify_mode.__set__(self, value)
ValueError: Cannot set verify_mode to CERT_NONE when check_hostname is enabled.
WARNING: Ignoring invalid distribution -illow (c:\users\brdwoo\appdata\local\programs\python\python39\lib\site-packages)
WARNING: Ignoring invalid distribution -aleido (c:\users\brdwoo\appdata\local\programs\python\python39\lib\site-packages)
WARNING: Ignoring invalid distribution -illow (c:\users\brdwoo\appdata\local\programs\python\python39\lib\site-packages)
WARNING: Ignoring invalid distribution -aleido (c:\users\brdwoo\appdata\local\programs\python\python39\lib\site-packages)
WARNING: There was an error checking the latest version of pip.

5 Answers 5

10

This occurs due to files names with the '~' prefix in site-packages. Please remove those files / folders. It will solve your problem.

Sign up to request clarification or add additional context in comments.

2 Comments

Just warnings. Have nothing with SSL checking host names.
This is the solution to remove the warnings. It is not the solution to the ERROR of the question. However, it's worth mentioning I think.
6

Do you have pip-system-certs installed? Try uninstalling it, and see if your problem goes away. It did for me (but I am unsure of the consequences in a python 3.10 environment)

Comments

3

I was able to fix the problem by hard-coding in a 1, instead of having CERT_NONE being passed to verify_mode.

The error message gave me the location of the code:

 File "C:\Users\name\AppData\Local\Programs\Python\Python310\lib\ssl.py", line 738, in verify_mode
    super(SSLContext, SSLContext).verify_mode.__set__(self, 0)
ValueError: Cannot set verify_mode to CERT_NONE when check_hostname is enabled.

I swapped the variable value -> 1

@verify_mode.setter
def verify_mode(self, value):
    super(SSLContext, SSLContext).verify_mode.__set__(self, 1)

1 Comment

Please canb bring more explanation on how you handled it @drew because I dont understand what you have done .
0

[WARNING: Ignoring invalid distribution -ip (~lib\site-packages)e][1]

Hello, I had a similar problem where Visual Studio Code couldn't find installed libraries. The problem occurred after updating the Python version. What I did is shown in the steps 1 and 2 in the picture - I selected the Python version from the dropdown in the upper right corner, and in step 2, I switched to an older, working version. I hope this helps someone... [1]: https://i.sstatic.net/zDjr4.jpg

Comments

0

If anyone happens to be using a Google Colab notebook like me, I was able to resolve this issue by Selecting "runtime" at the top, and then fully disconnecting and restarting the code in a new runtime.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.