I use twine to release packages to an internal repo. Our last CI build downloaded requests-toolbelt 0.9.0 and crashed with the following error:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/requests_toolbelt/_compat.py", line 56, in <module>
from requests.packages.urllib3.contrib.pyopenssl \
File "/usr/local/lib/python3.6/site-packages/urllib3/contrib/pyopenssl.py", line 46, in <module>
import OpenSSL.SSL
ModuleNotFoundError: No module named 'OpenSSL'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/local/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/usr/local/lib/python3.6/site-packages/twine/__main__.py", line 20, in <module>
from twine.cli import dispatch
File "/usr/local/lib/python3.6/site-packages/twine/cli.py", line 23, in <module>
import requests_toolbelt
File "/usr/local/lib/python3.6/site-packages/requests_toolbelt/__init__.py", line 12, in <module>
from .adapters import SSLAdapter, SourceAddressAdapter
File "/usr/local/lib/python3.6/site-packages/requests_toolbelt/adapters/__init__.py", line 12, in <module>
from .ssl import SSLAdapter
File "/usr/local/lib/python3.6/site-packages/requests_toolbelt/adapters/ssl.py", line 16, in <module>
from .._compat import poolmanager
File "/usr/local/lib/python3.6/site-packages/requests_toolbelt/_compat.py", line 59, in <module>
from urllib3.contrib.pyopenssl import PyOpenSSLContext
File "/usr/local/lib/python3.6/site-packages/urllib3/contrib/pyopenssl.py", line 46, in <module>
import OpenSSL.SSL
ModuleNotFoundError: No module named 'OpenSSL'
It seems pyopenssl was not installed as a dependency for requests-toolbelt==0.9.0. The following packages where installed when installing twine==1.11.0:
Collecting twine==1.11.0
Downloading https://files.pythonhosted.org/packages/65/ae/9cfdff186dd4812c59bad890435538858f13fe43dbe6923e0fb20f0adfc8/twine-1.11.0-py2.py3-none-any.whl
Collecting pkginfo>=1.4.2 (from twine==1.11.0)
Downloading https://files.pythonhosted.org/packages/e6/d5/451b913307b478c49eb29084916639dc53a88489b993530fed0a66bab8b9/pkginfo-1.5.0.1-py2.py3-none-any.whl
Collecting requests-toolbelt>=0.8.0 (from twine==1.11.0)
Downloading https://files.pythonhosted.org/packages/05/3b/facf65bc2173e3fa014f13ce7096b15577ae0e1244a3fd185804c4e3db5d/requests_toolbelt-0.9.0-py2.py3-none-any.whl (54kB)
100% |████████████████████████████████| 61kB 38.6MB/s
Collecting tqdm>=4.14 (from twine==1.11.0)
Downloading https://files.pythonhosted.org/packages/76/4c/103a4d3415dafc1ddfe6a6624333971756e2d3dd8c6dc0f520152855f040/tqdm-4.30.0-py2.py3-none-any.whl (47kB)
100% |████████████████████████████████| 51kB 32.9MB/s
Requirement already satisfied: setuptools>=0.7.0 in /usr/local/lib/python3.6/site-packages (from twine==1.11.0) (40.6.3)
Collecting requests!=2.15,!=2.16,>=2.5.0 (from twine==1.11.0)
Downloading https://files.pythonhosted.org/packages/7d/e3/20f3d364d6c8e5d2353c72a67778eb189176f08e873c9900e10c0287b84b/requests-2.21.0-py2.py3-none-any.whl (57kB)
100% |████████████████████████████████| 61kB 37.7MB/s
Collecting chardet<3.1.0,>=3.0.2 (from requests!=2.15,!=2.16,>=2.5.0->twine==1.11.0)
Downloading https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl (133kB)
100% |████████████████████████████████| 143kB 54.3MB/s
Collecting urllib3<1.25,>=1.21.1 (from requests!=2.15,!=2.16,>=2.5.0->twine==1.11.0)
Downloading https://files.pythonhosted.org/packages/62/00/ee1d7de624db8ba7090d1226aebefab96a2c71cd5cfa7629d6ad3f61b79e/urllib3-1.24.1-py2.py3-none-any.whl (118kB)
100% |████████████████████████████████| 122kB 58.5MB/s
Collecting idna<2.9,>=2.5 (from requests!=2.15,!=2.16,>=2.5.0->twine==1.11.0)
Downloading https://files.pythonhosted.org/packages/14/2c/cd551d81dbe15200be1cf41cd03869a46fe7226e7450af7a6545bfc474c9/idna-2.8-py2.py3-none-any.whl (58kB)
100% |████████████████████████████████| 61kB 41.2MB/s
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.6/site-packages (from requests!=2.15,!=2.16,>=2.5.0->twine==1.11.0) (2018.11.29)
Installing collected packages: pkginfo, chardet, urllib3, idna, requests, requests-toolbelt, tqdm, twine
Successfully installed chardet-3.0.4 idna-2.8 pkginfo-1.5.0.1 requests-2.21.0 requests-toolbelt-0.9.0 tqdm-4.30.0 twine-1.11.0 urllib3-1.24.1
I use twine to release packages to an internal repo. Our last CI build downloaded requests-toolbelt 0.9.0 and crashed with the following error:
It seems pyopenssl was not installed as a dependency for
requests-toolbelt==0.9.0. The following packages where installed when installingtwine==1.11.0: