python / mypy

Optional static typing for Python
https://www.mypy-lang.org/
Other
18.55k stars 2.84k forks source link

Installation Traceback Errors #18151

Closed Stevepurpose closed 1 week ago

Stevepurpose commented 1 week ago

I am trying to install mypy but I am encountering this error

es_read, self.length_remaining) File "/usr/lib/python3.8/contextlib.py", line 131, in exit self.gen.throw(type, value, traceback) File "/home/stephen/.local/lib/python3.8/site-packages/pip/_vendor/urllib3/response.py", line 443, in _error_catcher raise ReadTimeoutError(self._pool, None, "Read timed out.") pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.

brianschubert commented 1 week ago

Thanks for your interest in mypy!

The error you're seeing is from your installer (pip), not from mypy. I'd normally suggest you open an issue with them; however, in this case it seems likely that the issue isn't with pip either but rather with your internet connection. A ReadTimeoutError means that pip didn't receive a reply from the server (or didn't receive a reply fast enough). That could be for any number of reasons, ranging from a slow internet connection to firewall issues to problems with the server itself.

Here's a few pages that may help you debug the issue on your end. Sorry there isn't more we can do to help on our end.

Good luck getting mypy running!

(p.s. I see you're using Python 3.8. Do note that Python 3.8 recently reached it end-of-life and mypy will be dropping support for 3.8 in the near future. Now is a great time to look into upgrading to a more recent version! A more recent version of Python/pip may also help you resolve this issue.)

Stevepurpose commented 1 week ago

Thanks I had got the issue solved. The issue while trying to install locally in a virtual environment was due to caching; I had previously installed Mypy globally using apt on my Linux Ubuntu but it installed an old version. So while trying to upgrade globally those issues arose, I then uninstalled and tried to install again, was still same issue . However locally all I did was delete the cache files in my project and install again. I think I'll just leave the global installation.