When installing nltk==2.0.5, I get the error urllib2.HTTPError: HTTP Error 403: SSL is required
. Really, I'm trying to install newspaper
, but it's failing when trying to install this package.
A minimal Dockerfile to reproduce the issue:
FROM ubuntu:16.04 RUN apt-get update RUN apt-get install -y python-pip # problem occurs with or without the following line RUN pip install --upgrade pip CMD ["pip", "install", "nltk==2.0.5"]
wget https://pypi.python.org/packages/source/d/nltk/nltk-2.0.5.tar.gz
tar -xzf nltk-2.0.5.tar.gz
- change
DEFAULT_URL
from http to https in nltk-2.0.5/distribute_setup.py
- pip install that directory, or if you trust I did the above then do:
pip install https://s3-us-west-2.amazonaws.com/jdimatteo-personal-public-readaccess/nltk-2.0.5-https-distribute.tar.gz
Edit
If the wget link is broken, download ntlk 2.0.5 from pypi
PyPI has disabled non HTTPS access to APIs
You can use:
pip install xxxx -i https://pypi.python.org/simple/
From:https://stackoverflow.com/a/46979531/1304650