3

I am totally new to python. I try to install package offline using pip and I followed this:
https://stackoverflow.com/a/45620892/9934146

But it always failed at pip install Flask as follows:

$ pip install Flask

Collecting Flask
  Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', error(104, '\xe6\x8e\xa5\xe7\xb6\x9a\xe3\x81\x8c\xe7\x9b\xb8\xe6\x89\x8b\xe3\x81\x8b\xe3\x82\x89\xe3\x83\xaa\xe3\x82\xbb\xe3\x83\x83\xe3\x83\x88\xe3\x81\x95\xe3\x82\x8c\xe3\x81\xbe\xe3\x81\x97\xe3\x81\x9f'))': /simple/flask/

  Could not find a version that satisfies the requirement Flask (from versions: )
No matching distribution found for Flask

It seems it fails to install any package - not only Flask. I've searched online about the solutions. Some people said it is issue about proxy, but I have no idea about proxy. Can anyone help me? My environment:

$ uname -a
Linux m1tadpld 3.10.0-514.el7.x86_64 #1 SMP Wed Oct 19 11:24:13 EDT 2016 x86_64 x86_64 x86_64 GNU/Linux

$ python -V
Python 2.7.5

$ pip -V
pip 9.0.1 from /usr/lib/python2.7/site-packages (python 2.7)
Adam Smith
  • 2,279
  • 2
  • 17
  • 32
rebecca
  • 31
  • 2
  • 2
    If you do `pip install Flask` that is **NOT** offline installation, it should be something like `pip install Flask-1.0.2-py2.py3-none-any.whl` after you've downloaded the file – Ofer Sadan Jun 13 '18 at 07:15
  • yes, I need install package offline. but before that I first need to have package downloaded. and I follow this https://stackoverflow.com/a/45620892/9934146 , but it always failed when I try to install package online – rebecca Jun 13 '18 at 07:24
  • I don't understand, have you downloaded the `Flask-1.0.2-py2.py3-none-any.whl` from anywhere (or something like it) prior to trying to install? If you have, you haven't shown us where it failed in your question. If you haven't, then that's your problem, and you can fix it by downloading what you need. – Ofer Sadan Jun 13 '18 at 07:30
  • Ofer Sadan , maybe I did not explain clearly, but let's put install offline aside first. if I want to install Flask online using " pip install Flask ", i always get error: " Could not find a version that satisfies the requirement" , this is problem – rebecca Jun 13 '18 at 07:39
  • since it says `Retrying` when you do that (with a message about a broken connection) i'm not sure you are **actually online**, or you have some network issues that need to be resolved first. You can also try to reinstall / upgrade `pip` but that's a bit risky: `python -m pip install --upgrade pip` – Ofer Sadan Jun 13 '18 at 07:44
  • @rebecca have you tried that? `pip install -U Flask` – Andy K Jun 13 '18 at 08:21
  • if it does not work, you can go to that [link](https://pypi.org/project/Flask/1.0.2/#files), download the whl file and install it with this `pip install /yourpath/Flask-1.0.2-py2.py3-none-any.whl` – Andy K Jun 13 '18 at 08:24
  • 1
    Your Python is too old, upgrade to at least 2.7.9. The problem is that PyPI disabled old SSL protocols, to connect to it your OpenSSL must support TLS 1.2. – phd Jun 13 '18 at 12:15

0 Answers0