question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ProtocolError while using pip (OSError 22 Invalid argument)

See original GitHub issue

Description

If I try to install a package via pip or try to upgrade pip (python -m pip install --upgrade pip) it fails (see output below).

With Python 3.6 I do not have any problems. I also tried Python 3.8, which has the same behavior than Python 3.9 (32 and 64-bit version).

Deactivating IPV6 did not work. Calling pip install --upgrade pip -i http://pypi.douban.com/simple --trusted-host pypi.douban.com as written here (https://github.com/pypa/pip/issues/9216#issuecomment-738738453) also works for me but is not a solution.

Expected behavior

pip is updated.

pip version

21.2.3

Python version

3.9.7

OS

Windows 10, 64-bit

How to Reproduce

  1. open a terminal
  2. call python -m pip install --upgrade pip

Output

WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', OSError(22, 'Invalid argument'))': /simple/pip/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', OSError(22, 'Invalid argument'))': /simple/pip/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', OSError(22, 'Invalid argument'))': /simple/pip/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', OSError(22, 'Invalid argument'))': /simple/pip/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', OSError(22, 'Invalid argument'))': /simple/pip/


### Code of Conduct

- [X] I agree to follow the [PSF Code of Conduct](https://www.python.org/psf/conduct/).

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
pfmoorecommented, Sep 22, 2021

That \u202a appears to be Left-To-Right Embedding. I suspect you have C:\Users\xxx\Desktop\sslkeylog.log in a config file somewhere but it’s got that (invisible) extra character included by accident somehow.

0reactions
Kiolalicommented, Sep 22, 2021

Well, you should not be able to run pip search, since the XMLRPC was disabled on PyPI.org.

I know, but the error message was quite helpful (in contrast to the command pip install x). I could resolve my problem by deleting the environment variable SSLKEYLOGFILE. I really have no idea how this variable was set. My other laptop doesn’t have that variable.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pip error, OSError Errno 22 invalid argument - Stack Overflow
In my case, this was an issue with IPv6 on macOS High Sierra. To resolve, open your network preferences, select Wi-Fi from the...
Read more >
[Solved] OSError errno22 invalid argument - Python Pool
OSError errno22 invalid argument is raised when the error occurs due to some system failure, full disk or the file cannot be found....
Read more >
IOError: [Errno 22] Invalid argument - Google Groups
Every time I try to run psiturk I keep getting [Errno 22]. ... Running pip freeze confirms that I am in a new...
Read more >
Python library pip install error - OpenAI API Community Forum
I am running command “pip install --upgrade openai” as per github docs, ... OSError(22, 'Invalid argument'))': /simple/openai/ ERROR: Could ...
Read more >
Pyomo + Cplex - OSError: [Errno 22] Invalid argument
I am trying to get Cplex working with pyomo. I have followed Cplex installation instructions has explained here: Downloading and setting up ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found