0

From the constance docs:

install the constance:

pip install django-constance

But I can not install it, with the error log:

$ pip3 install django-constance
Collecting django-constance
  Could not fetch URL https://pypi.python.org/simple/django-constance/: There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:645) - skipping
  Could not find a version that satisfies the requirement django-constance (from versions: )
No matching distribution found for django-constance
sof-03
  • 2,255
  • 4
  • 15
  • 33
  • 1
    Possible duplicate of [Not able to install python packages \[SSL: TLSV1\_ALERT\_PROTOCOL\_VERSION\]](https://stackoverflow.com/questions/49768770/not-able-to-install-python-packages-ssl-tlsv1-alert-protocol-version) – Anupam May 08 '18 at 07:30

2 Answers2

0

Check the python version you are running on e.g. 2.7 or 3.5. Then get an appropriate package version for the respective version you have and install it with pip install package-name==%.%.%where %.%.%Is the package version for your python version. Note that some packages are only released for only python2 while others are for python 3

  • Could you describe the answer more detail? – sof-03 May 08 '18 at 07:09
  • Some packages are version specific. Some are made specifically for python 2 while others are for python 3. Your error is most likely caused by such. To solve it you have to specify the specific package version for your python version. So instead of pip install package you have to do pip install package==1.00 assuming 1.00 is the version. Taking a case of Django Django 1.9 am due lower versions don't run on python 3 while 2.0 an for above do run on python 3 – Jerry Shikanga May 08 '18 at 07:15
0

The following output of your console:

There was a problem confirming the ssl certificate

indicates that there was a network problem while you were trying to install this dependency. It seems like it could be related to this issue: pip install fails with "connection error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:598)"
solution propesed there was:
You may want to add the trusted hosts and proxy to your config file.

pip.ini (Windows) or pip.conf (unix)

[global]
trusted-host = pypi.python.org
               pypi.org
               files.pythonhosted.org

I hope that this helps.

matyas
  • 2,696
  • 23
  • 29