Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pip only works using -i http://pypi.douban.com/simple --trusted-host pypi.douban.com #10677

Closed
1 task done
orionnelson opened this issue Nov 22, 2021 · 2 comments
Closed
1 task done
Labels
resolution: no action When the resolution is to not do anything resolution: wrong project Should be reported elsewhere type: bug A confirmed bug or unintended behavior

Comments

@orionnelson
Copy link

orionnelson commented Nov 22, 2021

Description

I have no clue where, to begin with, this error.

Pip does not want to install from pypi.org

pip install --upgrade flask -i http://pypi.org/simple --trusted-host pypi.org 
Looking in indexes: http://pypi.org/simple
ERROR: Could not find a version that satisfies the requirement flask (from versions: none)
ERROR: No matching distribution found for flask

Attempting to install using curl and get pip to test package installation

curl https://bootstrap.pypa.io/get-pip.py | python
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 2108k  100 2108k    0     0  2108k      0  0:00:01 --:--:--  0:00:01 2248k
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))': /simple/pip/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))': /simple/pip/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))': /simple/pip/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))': /simple/pip/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))': /simple/pip/
ERROR: Could not find a version that satisfies the requirement pip (from versions: none)
ERROR: No matching distribution found for pip

Using pip install --upgrade flask -i http://pypi.douban.com/simple --trusted-host pypi.douban.com Works normally however and I am unsure why.

Expected behavior

Using pip install --upgrade flask -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
Looking in indexes: http://pypi.douban.com/simple
Collecting flask
Downloading http://pypi.doubanio.com/packages/8f/b6/b4fdcb6d01ee20f9cfe81dcf9d3cd6c2f874b996f186f1c0b898c4a59c04/Flask-2.0.2-py3-none-any.whl (95 kB)
|████████████████████████████████| 95 kB 321 kB/s
Collecting click>=7.1.2
Downloading http://pypi.doubanio.com/packages/48/58/c8aa6a8e62cc75f39fee1092c45d6b6ba684122697d7ce7d53f64f98a129/click-8.0.3-py3-none-any.whl (97 kB)
|████████████████████████████████| 97 kB 211 kB/s
Collecting Jinja2>=3.0
Downloading http://pypi.doubanio.com/packages/20/9a/e5d9ec41927401e41aea8af6d16e78b5e612bca4699d417f646a9610a076/Jinja2-3.0.3-py3-none-any.whl (133 kB)
|████████████████████████████████| 133 kB 364 kB/s
Collecting itsdangerous>=2.0
Downloading http://pypi.doubanio.com/packages/9c/96/26f935afba9cd6140216da5add223a0c465b99d0f112b68a4ca426441019/itsdangerous-2.0.1-py3-none-any.whl (18 kB)
Collecting Werkzeug>=2.0
Downloading http://pypi.doubanio.com/packages/1e/73/51137805d1b8d97367a8a77cae4a792af14bb7ce58fbd071af294c740cf0/Werkzeug-2.0.2-py3-none-any.whl (288 kB)
|████████████████████████████████| 288 kB 345 kB/s
Collecting colorama
Downloading http://pypi.doubanio.com/packages/44/98/5b86278fbbf250d239ae0ecb724f8572af1c91f4a11edf4d36a206189440/colorama-0.4.4-py2.py3-none-any.whl (16 kB)
Collecting MarkupSafe>=2.0
Downloading http://pypi.doubanio.com/packages/93/28/d42b954fb9189cf4b78b0b0a025cff9b2583f93b37d1a345768ade29e5dd/MarkupSafe-2.0.1-cp310-cp310-win_amd64.whl (15 kB)
Installing collected packages: MarkupSafe, colorama, Werkzeug, Jinja2, itsdangerous, click, flask
Successfully installed Jinja2-3.0.3 MarkupSafe-2.0.1 Werkzeug-2.0.2 click-8.0.3 colorama-0.4.4 flask-2.0.2 itsdangerous-2.0.1

pip version

21.3.1

Python version

3.10

OS

Windows 10 Pro 20H2

How to Reproduce

This issue happened after installing Tor and Kaspersky and having Kaspersky break a bunch of stuff .
I may have Deleted Tor possibly while in an venv and after this point in time was unable to use pip normally

I have tried reinstalling python multiple times for different versions and have tried disabling ipV6 yet am still encountering the issue.

Below is the output of pip install flask

Output

pip install flask ```

2021-11-22T17:28:04,121 Using pip 21.2.3 from C:\Users\orion\AppData\Local\Programs\Python\Python310\lib\site-packages\pip (python 3.10)
2021-11-22T17:28:04,124 Non-user install because site-packages writeable
2021-11-22T17:28:04,145 Created temporary directory: C:\Users\orion\AppData\Local\Temp\pip-ephem-wheel-cache-2ow82q2w
2021-11-22T17:28:04,146 Created temporary directory: C:\Users\orion\AppData\Local\Temp\pip-req-tracker-33kpowjq
2021-11-22T17:28:04,146 Initialized build tracking at C:\Users\orion\AppData\Local\Temp\pip-req-tracker-33kpowjq
2021-11-22T17:28:04,146 Created build tracker: C:\Users\orion\AppData\Local\Temp\pip-req-tracker-33kpowjq
2021-11-22T17:28:04,146 Entered build tracker: C:\Users\orion\AppData\Local\Temp\pip-req-tracker-33kpowjq
2021-11-22T17:28:04,146 Created temporary directory: C:\Users\orion\AppData\Local\Temp\pip-install-wfn_sg4m
2021-11-22T17:28:04,155 1 location(s) to search for versions of flask:
2021-11-22T17:28:04,155 * https://pypi.org/simple/flask/
2021-11-22T17:28:04,155 Fetching project page and analyzing links: https://pypi.org/simple/flask/
2021-11-22T17:28:04,155 Getting page https://pypi.org/simple/flask/
2021-11-22T17:28:04,156 Found index url https://pypi.org/simple
2021-11-22T17:28:04,182 WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))': /simple/flask/
2021-11-22T17:28:04,713 WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))': /simple/flask/
2021-11-22T17:28:05,758 WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))': /simple/flask/
2021-11-22T17:28:07,799 WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))': /simple/flask/
2021-11-22T17:28:11,843 WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))': /simple/flask/
2021-11-22T17:28:11,864 Could not fetch URL https://pypi.org/simple/flask/: connection error: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/flask/ (Caused by ProtocolError('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))) - skipping
2021-11-22T17:28:11,864 Skipping link: not a file: https://pypi.org/simple/flask/
2021-11-22T17:28:11,864 Given no hashes to check 0 links for project 'flask': discarding no candidates
2021-11-22T17:28:11,864 ERROR: Could not find a version that satisfies the requirement flask (from versions: none)
2021-11-22T17:28:11,865 ERROR: No matching distribution found for flask
2021-11-22T17:28:11,865 Exception information:
2021-11-22T17:28:11,865 Traceback (most recent call last):
2021-11-22T17:28:11,865   File "C:\Users\orion\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 341, in resolve
2021-11-22T17:28:11,865     self._add_to_criteria(self.state.criteria, r, parent=None)
2021-11-22T17:28:11,865   File "C:\Users\orion\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 173, in _add_to_criteria
2021-11-22T17:28:11,865     raise RequirementsConflicted(criterion)
2021-11-22T17:28:11,865 pip._vendor.resolvelib.resolvers.RequirementsConflicted: Requirements conflict: SpecifierRequirement('flask')
2021-11-22T17:28:11,865 
2021-11-22T17:28:11,865 During handling of the above exception, another exception occurred:
2021-11-22T17:28:11,865 
2021-11-22T17:28:11,865 Traceback (most recent call last):
2021-11-22T17:28:11,865   File "C:\Users\orion\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\resolution\resolvelib\resolver.py", line 94, in resolve
2021-11-22T17:28:11,865     result = self._result = resolver.resolve(
2021-11-22T17:28:11,865   File "C:\Users\orion\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 472, in resolve
2021-11-22T17:28:11,865     state = resolution.resolve(requirements, max_rounds=max_rounds)
2021-11-22T17:28:11,865   File "C:\Users\orion\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 343, in resolve
2021-11-22T17:28:11,865     raise ResolutionImpossible(e.criterion.information)
2021-11-22T17:28:11,865 pip._vendor.resolvelib.resolvers.ResolutionImpossible: [RequirementInformation(requirement=SpecifierRequirement('flask'), parent=None)]
2021-11-22T17:28:11,865 
2021-11-22T17:28:11,865 The above exception was the direct cause of the following exception:
2021-11-22T17:28:11,865 
2021-11-22T17:28:11,865 Traceback (most recent call last):
2021-11-22T17:28:11,865   File "C:\Users\orion\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\cli\base_command.py", line 173, in _main
2021-11-22T17:28:11,865     status = self.run(options, args)
2021-11-22T17:28:11,865   File "C:\Users\orion\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\cli\req_command.py", line 203, in wrapper
2021-11-22T17:28:11,865     return func(self, options, args)
2021-11-22T17:28:11,865   File "C:\Users\orion\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\commands\install.py", line 315, in run
2021-11-22T17:28:11,865     requirement_set = resolver.resolve(
2021-11-22T17:28:11,865   File "C:\Users\orion\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\resolution\resolvelib\resolver.py", line 103, in resolve
2021-11-22T17:28:11,865     raise error from e
2021-11-22T17:28:11,865 pip._internal.exceptions.DistributionNotFound: No matching distribution found for flask
2021-11-22T17:28:11,875 1 location(s) to search for versions of pip:
2021-11-22T17:28:11,875 * https://pypi.org/simple/pip/
2021-11-22T17:28:11,875 Fetching project page and analyzing links: https://pypi.org/simple/pip/
2021-11-22T17:28:11,875 Getting page https://pypi.org/simple/pip/
2021-11-22T17:28:11,875 Found index url https://pypi.org/simple
2021-11-22T17:28:11,896 Could not fetch URL https://pypi.org/simple/pip/: connection error: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by ProtocolError('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))) - skipping
2021-11-22T17:28:11,896 Skipping link: not a file: https://pypi.org/simple/pip/
2021-11-22T17:28:11,896 Given no hashes to check 0 links for project 'pip': discarding no candidates
2021-11-22T17:28:11,896 Removed build tracker: 'C:\\Users\\orion\\AppData\\Local\\Temp\\pip-req-tracker-33kpowjq'

Code of Conduct

@orionnelson orionnelson added S: needs triage Issues/PRs that need to be triaged type: bug A confirmed bug or unintended behavior labels Nov 22, 2021
@uranusjr
Copy link
Member

uranusjr commented Nov 23, 2021

This looks like a network issue on tour side and there's not much we can do about this. Contact your network provider for support instead.

Edit: It's likely your network blocks PyPI access, or at least does not like PyPi's SSL provider. PyPI only supports HTTPS, not HTTP, while Douban's mirror can run on HTTP, which could be the difference. It maybe be useful to discuss this with PyPi admins as well (they can be reached on https://github.com/pypa/warehouse), but this is mostly out of pip's hand without further information, sorry.

@DiddiLeija DiddiLeija added resolution: no action When the resolution is to not do anything resolution: wrong project Should be reported elsewhere and removed S: needs triage Issues/PRs that need to be triaged labels Nov 23, 2021
@orionnelson
Copy link
Author

orionnelson commented Nov 25, 2021

For anyone who ends up experiencing this issue however rare I managed to figure out the issue was caused by an TLS /SSL error and corrupted Certificate.
After making the changes suggested by firedog pip works as expected.

Windows + R
control -> Internet Properties / Advanced
Enable only TLS 1.3 and 1.2

I also deleted a few older certificates if the above does not work.

https://answers.microsoft.com/en-us/windows/forum/all/how-to-enable-tls-13-in-windows-10/f9ab4993-4758-4de3-a7f9-54a47b61cc77

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
resolution: no action When the resolution is to not do anything resolution: wrong project Should be reported elsewhere type: bug A confirmed bug or unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants