You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
requests: Can't connect to HTTPS URL because the SSL module is not available. #41
Python 3.11.7 (main, Mar 14 2024, 14:21:08) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>import requests
>>> requests.get("http://google.com")
<Response [200]>
>>> requests.get("https://google.com")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/versions/3.11.7/lib/python3.11/site-packages/requests/api.py", line 73, in get
return request("get", url, params=params, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/versions/3.11.7/lib/python3.11/site-packages/requests/api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/versions/3.11.7/lib/python3.11/site-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/versions/3.11.7/lib/python3.11/site-packages/requests/sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/versions/3.11.7/lib/python3.11/site-packages/requests/adapters.py", line 486, in send
resp = conn.urlopen(
^^^^^^^^^^^^^
File "/opt/versions/3.11.7/lib/python3.11/site-packages/urllib3/connectionpool.py", line 772, in urlopen
conn = self._get_conn(timeout=pool_timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/versions/3.11.7/lib/python3.11/site-packages/urllib3/connectionpool.py", line 295, in _get_conn
return conn or self._new_conn()
^^^^^^^^^^^^^^^^
File "/opt/versions/3.11.7/lib/python3.11/site-packages/urllib3/connectionpool.py", line 1063, in _new_conn
raise ImportError(
ImportError: Can't connect to HTTPS URL because the SSL module is not available.
Does the requests library only use the SSL module in the system to process HTTPS requests?
I need to write more docs. It seems that you didn't enable openssl. If you build without config, then run:
portable-python build 3.11.7 -mopenssl
And do add more, if you need more, on macos for example, I do -mxz,openssl (comma separated list of components to build-in statically).
Run this for example and inspect the build report (you'll see what will be static/shared, not included etc):
portable-python build-report 3.11.7 -mxz,openssl
You can also configure this in a file, here's what I use (on linux, portable python in this case):
If you see openssl shown as "shared" when you run portable-python build-report 3.11.7, then it means that the openssl shared lib was not found at runtime when you try this.
If it shows as "absent", it means your openssl installation was not detected (an -mopenssl will fetch source code of openssl and build it in statically)
And it is because the path is 'build/deps/lib64', and by default, it will search for 'build/deps/lib'.
So before portable-python build 3.11.7 -m openssl, command export LIBRARY_PATH=/opt/py/build/deps/lib64:$LIBRARY_PATH.
And then build success.
Activity
zsimic commentedon Mar 14, 2024
What does this say?
I am not super familiar with
requestsoff the top of my head, but I think it eventually relies on std lib module_ssl.huimzjty commentedon Mar 15, 2024
The command output:
it seem that python compilation does not include OpenSSL support.
zsimic commentedon Mar 15, 2024
I need to write more docs. It seems that you didn't enable openssl. If you build without config, then run:
And do add more, if you need more, on macos for example, I do
-mxz,openssl(comma separated list of components to build-in statically).Run this for example and inspect the build report (you'll see what will be static/shared, not included etc):
You can also configure this in a file, here's what I use (on linux, portable python in this case):
zsimic commentedon Mar 15, 2024
If you see openssl shown as "shared" when you run
portable-python build-report 3.11.7, then it means that the openssl shared lib was not found at runtime when you try this.If it shows as "absent", it means your openssl installation was not detected (an
-mopensslwill fetch source code of openssl and build it in statically)huimzjty commentedon Apr 25, 2024
i found the config.log, it show
And it is because the path is 'build/deps/lib64', and by default, it will search for 'build/deps/lib'.
So before
portable-python build 3.11.7 -m openssl, commandexport LIBRARY_PATH=/opt/py/build/deps/lib64:$LIBRARY_PATH.And then build success.