I am trying to install flask using python pip in my linux machine having rhel7
-> python3.7 --version
Python 3.7.2
-> pip3.7 --version
pip 18.1 from /usr/local/lib/python3.7/site-packages/pip (python 3.7)
Problem :
-> pip3.7 install flask
Collecting flask
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fad3a9f60b8>: Failed to establish a new connection: [Errno 101] Network is unreachable')': /simple/flask/
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fad3a9f6128>: Failed to establish a new connection: [Errno 101] Network is unreachable')': /simple/flask/
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fad3a9f6390>: Failed to establish a new connection: [Errno 101] Network is unreachable')': /simple/flask/
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fad3a9f6358>: Failed to establish a new connection: [Errno 101] Network is unreachable')': /simple/flask/
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fad3a9f64e0>: Failed to establish a new connection: [Errno 101] Network is unreachable')': /simple/flask/
Could not find a version that satisfies the requirement flask (from versions: )
No matching distribution found for flask
I tried to use below command as well but same error
python3.7 -m pip install flask
I suggest that you look at this Flask documentation page. As mention in the documentation, you need to activate the environment and then proceed to install by running the command pip install Flask.
This doc also refers to Python 2.7 as well. Keep that in mind when following this doc.
try this code:
pip3 install flask
Or:
pip install flask
Good luck.
Related
I can't install mysql connector with below error, please help advise needed action to proceed installation of module..See below command/errors:
C:\Users\a0229010>python -m pip install mysql-connector-python==3.7.3
Collecting mysql-connector-python==3.7.3
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x0000017975C3B5C0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/mysql-connector-python/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x0000017975C3BB38>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/mysql-connector-python/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x0000017975C3B7B8>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/mysql-connector-python/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x0000017975C3B438>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/mysql-connector-python/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x0000017975C3BF60>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/mysql-connector-python/
ERROR: Could not find a version that satisfies the requirement mysql-connector-python==3.7.3 (from versions: none)
ERROR: No matching distribution found for mysql-connector-python==3.7.3
I suggest you change your Python Package Index
Or you can use follow code to have a try:
pip --default-timeout=100 install <package> -i <indexURL> --trusted-host <domain>
e.g when i install pandas
pip --default-timeout=100 install pandas -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn
It says it in the last line
Could not find a version that satisfies the requirement mysql-connector-python==3.7.3
You are fixing the version to 3.7.3
However, according to PyPi, there is no version 3.7.3 available.
See here
https://pypi.org/project/mysql-connector-python/#history
Latest version is 8.0.31
I have a python project working in venv with python3.7.
When I create new venv with python 3.10 for this project pip can not install packages via proxy. However it work in old venv.
cli:
C:\WINDOWS\system32>C:\Users\user\PycharmProjects\PytestHabr\ch2\venv\Scripts\activate.bat
(venv) C:\WINDOWS\system32>pip install --proxy http://user:pass#bproxy:port pytest
Collecting pytest
Downloading pytest-7.2.0-py3-none-any.whl (316 kB)
|████████████████████████████████| 316 kB 939 kB/s
(venv)C:\WINDOWS\system32>C:\Users\user\PycharmProjects\PytestHabr\ch2\venv_py310\Scripts\activate.bat
(venv_py310) C:\WINDOWS\system32>pip install --proxy http://user:pass#bproxy:port pytest
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', FileNotFoundError(2, 'No such file or directory'))': /simple/pytest/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', FileNotFoundError(2, 'No such file or directory'))': /simple/pytest/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', FileNotFoundError(2, 'No such file or directory'))': /simple/pytest/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', FileNotFoundError(2, 'No such file or directory'))': /simple/pytest/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', FileNotFoundError(2, 'No such file or directory'))': /simple/pytest/
ERROR: Could not find a version that satisfies the requirement pytest (from versions: none)
ERROR: No matching distribution found for pytest
(venv_py310) C:\WINDOWS\system32>pip --version
pip 21.3.1 from
C:\Users\user\PycharmProjects\PytestHabr\ch2\venv_py310\lib\site-packages\pip (python 3.10)
I tried use PyCharm with proxy setting, but it works only with venv Python 3.7.
Gurus,
I am trying to install pynput in python 3.5 & python 3.7
https://pypi.org/project/pynput/#files
pip3 install pynput
But get the following error message:
Looking in indexes: https://nexus3.marqeta.com/repository/pypi-all/simple
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x106574b00>: Failed to establish a new connection: [Errno 61] Connection refused',)': /repository/pypi-all/simple/pynput/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x106574e80>: Failed to establish a new connection: [Errno 61] Connection refused',)': /repository/pypi-all/simple/pynput/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x106574278>: Failed to establish a new connection: [Errno 61] Connection refused',)': /repository/pypi-all/simple/pynput/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x106574b70>: Failed to establish a new connection: [Errno 61] Connection refused',)': /repository/pypi-all/simple/pynput/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x1065749e8>: Failed to establish a new connection: [Errno 61] Connection refused',)': /repository/pypi-all/simple/pynput/
ERROR: Could not find a version that satisfies the requirement pynput (from versions: none)
ERROR: No matching distribution found for pynput
If I do
pip install "git+https://github.com/moses-palmer/pynput"
Looking in indexes: https://nexus3.marqeta.com/repository/pypi-all/simple
Collecting git+https://github.com/moses-palmer/pynput
Cloning https://github.com/moses-palmer/pynput to /private/var/folders/3g/zck82mw91_ddjhk88nxt8t6ny40bl_/T/pip-req-build-y2gvuewk
Running command git clone -q https://github.com/moses-palmer/pynput /private/var/folders/3g/zck82mw91_ddjhk88nxt8t6ny40bl_/T/pip-req-build-y2gvuewk
Requirement already satisfied: six in /Users/psu/miniconda3/lib/python3.5/site-packages (from pynput==1.6.8) (1.14.0)
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x10d231470>: Failed to establish a new connection: [Errno 61] Connection refused',)': /repository/pypi-all/simple/pyobjc-framework-quartz/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x10d231cc0>: Failed to establish a new connection: [Errno 61] Connection refused',)': /repository/pypi-all/simple/pyobjc-framework-quartz/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x10d2318d0>: Failed to establish a new connection: [Errno 61] Connection refused',)': /repository/pypi-all/simple/pyobjc-framework-quartz/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x10d2319b0>: Failed to establish a new connection: [Errno 61] Connection refused',)': /repository/pypi-all/simple/pyobjc-framework-quartz/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x10d231208>: Failed to establish a new connection: [Errno 61] Connection refused',)': /repository/pypi-all/simple/pyobjc-framework-quartz/
ERROR: Could not find a version that satisfies the requirement pyobjc-framework-Quartz>=3.0 (from pynput==1.6.8) (from versions: none)
ERROR: No matching distribution found for pyobjc-framework-Quartz>=3.0 (from pynput==1.6.8)
I also try some sys.path.append hack and it doesn't work neither
sys.path.append("$HOME/repos/pynput/lib")
import pynput.mouse.Listener
It will say
File "$HOME/repos/pynput/lib/pynput/mouse/__init__.py", line 26, in <module>
from pynput._util import backend, Events
ModuleNotFoundError: No module named 'pynput'
Any thoughts? Thanks.
You have to install pyobjc-framework-Quartz before installing pynput
Try this:
python3 -m pip install pyobjc-framework-Quartz==8.4.1 pynput==1.7.6
I'm trying to get Python 3.6 with numpy and openCV setup on a windows 10 machine. I have python 3.6.8 installed with pip 18.1. When I try to install anything with pip, regardless of the package, I get the same result:
C:\WINDOWS\system32>pip install numpy
Collecting numpy
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001D135A3AE48>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',)': /simple/numpy/
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001D135A3ABE0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',)': /simple/numpy/
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001D135A3A8D0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',)': /simple/numpy/
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001D135A3A7B8>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',)': /simple/numpy/
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001D135A3A9B0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',)': /simple/numpy/
Could not find a version that satisfies the requirement numpy (from versions: )
No matching distribution found for numpy
I've tried updating pip, and it tells me that it's already up-to-date. What's going on?
I figured it out. It was some proxy issue on my company's network. Using --proxy after pip install numpy worked.
Please try this code
python3 -m pip install <pkg>
Try this code. This sets pypi.org and files.pythonhosted.org as trusted hosts to ignore SSL errors.
pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org
Answer from this question: pip install fails with "connection error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:598)"
I am using docker on window.
Below is my docker file:
FROM microsoft/windowsservercore:latest
FROM python:3.7
RUN pip install flask
CMD ["cmd"]
When I try to build docker image it throws the folowing exception:
>docker build D:\HCL\Docker\
Sending build context to Docker daemon 14.34kB
Step 1/4 : FROM microsoft/windowsservercore:latest
---> ea9f7aa13d03
Step 2/4 : FROM python:3.7
---> 2137b5b81384
Step 3/4 : RUN pip install flask
---> Running in 7463787fcfa8
Collecting flask
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/flask/
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/flask/
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/flask/
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/flask/
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/flask/
Could not find a version that satisfies the requirement flask (from versions: )
No matching distribution found for flask
The command 'powershell -Command $ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue'; pip install flask' returned a non-zero code: 1
I have checked docker has internet access but not able to download any package over https.
I have checked downloading files over http and it is working fine.
I am able to install windowcore and python in the same docker file.
I am only getting issue with pip.
I have logged into the container and run the pip command manualy but got the same error.