-
Notifications
You must be signed in to change notification settings - Fork 567
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. #93
Comments
Could you provide a minimal repo? Not sure if this has been fixed or maybe there is some extra configurations or perhaps you're using a self-hosted runner? I tried the following and it everything seems to be working.
|
We are using a self-hosted runner. |
Yup, it's failing towards the end of the the setup script, ssl related: https://github.com/actions/python-versions/blob/10f5e8e4f5b3118624f86839a5c64c6e095094f7/installers/nix-setup-template.sh#L54 If you try to do I don't know of a good solution at this time... we could update the |
We are also experiencing problems with this on a self-hosted runner. Has this been solved yet?
|
Has anyone found a resolution for this issue? I just upgraded from Python 2.7.5 to Python 3.8.1 and upgraded Pip and having this same issue. |
@EvanPHamilton, that's what I did, and it helped. The problem is that the environment variables must be set individually for every Python version because the Github Actions runner does not work with openssl1.1. |
@utapyngo , i'm trying to install tesseract-ocr on Windows 10 I set my environment variable for path for tesseract-ocr. Any suggestions? I would really appreciate any assistance, Regard bjorn |
@debtha , did you come right here? |
resolved.
|
thanks, resolved. |
could you please elaborate on the second step, please ? |
download python source from https://www.python.org/downloads/source/ such as Python-x.x.x.tgz, then tar -xvf Python-x.x.x.tgz, and cd Python-x.x.x, do /configure --with-openssl=/home/username/openssl. |
I was able to get a version of python built to use a openssl in a home directory, however the |
I install ssl and use same command , last command not working "python3 -m ssl" , same problem not resolved |
I have the problem to not be able to find the bash_profile I am using Kali Linux on VMWare, and it copied the vmware iso (not the installer, i don't know if there is a difference) I did all others steps but I am guessing the change in the bash_profile is mandatory, unfortunately i cant do it Can someone help ? |
try . ~/.profile instead or editing bashrc https://askubuntu.com/questions/510709/i-cannot-find-bash-profile-in-ubuntu |
I managed to include SSL library with export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/home/username/openssl/lib/ before step now |
I was encountering this problem while attempting to |
this worked with the openssl 1.1.1k version for python 3.9.5 on Linux lite ( or a custom kernel based on ubuntu 20.04) . I had installed openssl source built it following the instructions from that link and then configured from python readme.rst with ./configure --with-openssl=/home/username/openssl --enable-optimizations followed the python make and build instructions and after python3 -m ssl I got no errors and pip worked. I even finally got to update to pip 21.1.2. These posted have helped me the most on a barely mainstream custom linux kernel thank you again everyone. |
The solution used here (https://bugs.python.org/issue34028#msg339455) helped me:
|
If any body still facing issue set execute in Python folder |
Nothing worked for me until I yum installed |
In Ubuntu 20.04 I fixed the similar error, trying to install Django by using super user |
This is great resolved, thank bro |
I followed your guide but still got some error bro, "/usr/local/bin/python3.10: No module named openssl" |
Worked for me. I had to install openssl and then it worked like a charm. |
working but still getting this error: WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. Please advise... |
Hi, @qudos-tech 👋 Could you provide us with some more details about your case in order to be able to reproduce it. You can use this template as example. |
This is on CentOS 7. Openssl-devel and bzip2-devel mentioned here are up to date. I have installed Python 3.10 as root so everyone can use it. python3 -m pip install requests Installed openssl for myself as suggested above and I still get the same errors when trying to install python packages. python3 -m ssl results in Traceback (most recent call last): |
Hi @gezabohus, Your case is a bit specific because you are using CentOS compared to other self-hosted runners. The issue here is that prebuilt Python binaries are prebuilt for Ubuntu so we cannot guarantee this Python build would work on other distributions. If you would like to build Python on your own for CentOS there is no need to use the setup-python action, since this action is using prebuilt binaries as explained above. Your issue is not related to setup-python action, probably you can open a topic on the python bug tracker: https://bugs.python.org or https://github.com/python/cpython/issues. Cheers |
Hi @panticmilos, Thanks for the info. I wasn't completely clear, sorry. When I wrote "installed" I meant going through the get tar - configure - make cycle. I suppose that should build from source. Right? |
Hi @gezabohus, You are welcome. Yes, that is correct, these are building phases. And since you are building it on your own, that's why I think raising the issue on one of these two bug trackers could help you. If I can help you additionally feel free to continue the discussion. :) |
Hi @panticmilos, Got it. Thanks for the info. |
Hi all, A bit of fudging with this answer solved my problem. (Plus using virtual env.) |
Thanks a lot for all these answers. For me, I also found that it also worked even after I removed the openssl installed in my home directory and cancel export LD_LIBRARY_PATH for it's lib. So I just tried many other times for digging into it. And I summarize as follows: Firstly. I installed openssl in my home directory and set its related LD_LIBRARY_PATH before I installed python3.9 from source code with ./configure --with-openssl={openssl path I just installed manually}. And ./pip3 install worked without any SSL error. Afterwards, I removed the openssl and unset the environment variable for it, but still no SSL error when I use ./pip3 to install packages. Another time, I remove all the things mentioned above and install openssl again. This time I didn't set its LD_LIBRARY_PATH and only set --with-openssl={openssl path I just installed manually} and then install python3.9 before I removed openssl again. So there is no manually installed openssl any more. Still, it worked. In conclusion, I guess the procedure of 'configure' python3.9 needs an openssl directory and only needs for 'configure', for some reason it cannot find one (I mean it cannot find the default openssl the system already has). So just install and set one explicitly. After configuring, making and installing python, it is of no use for normally running python and pip. I encountered this problem on one of my lab servers (labeled as 1), but everything went well on another (labeled as 0). I cannot find where is different between them since both default openssl are on /usr (but for 1 is on /usr/local/bin and for 0 on /usr/bin). |
On Ubuntu (tested on 22.04) it is sufficient to install libssl-dev and then rerun configure. There is no need to install a local openssl. |
If re-running configure on a machine that already has the required libs is all that's needed, can that be added to setup-python? I feel like almost none of the comments are focusing on the actual Action we are supposedly trying to use. |
Thank you very much this pretty much saved my life :D |
Got this working for installing Python 3.11.2 on Amazon Linux 2. (An OS Similar to CentOS 7/Rhel 7) I had to install a different openssl version, which Amazon Repo's provide. You can still leave the regular openssl rpm installed, but you must REMOVE openssl-devel if installed. The three packages you must install AFTER REMOVING openssl-devel are:
Once installed just run ./configure --enable-optimizations (no need for the --with-openssl as the configure script already has a defined locations to look for your openssl, you only need to provide it if your openssl is not within those standard directories, you can find the locations in the script) Do not let the g fool you, amazon updates their RPM's without changing the letter at the end, so yes it's patched for vulnerabilities. Reference: https://alas.aws.amazon.com/AL2/ALAS-2023-1934.html Hope this helps! Also some more info if interested: Everytime you run ./configure it creates a config.log. I saw it was finding my original openssl in the config.log, however, it was not happy with the version I was using, and the capabilities of that version based on some tests it would do. Which is what led me to find out there was a different openssl Amazon provided in which python3.11.2 was happy with. |
this solution works for me too! |
The reason can also be that the OpenSSL installation (e.g, in |
Those commands will fix the issue: $ sudo yum install yum-utils
$ sudo yum-builddep python3 or $ sudo apt build-dep python3
$ sudo apt install pkg-config or $ sudo dnf install dnf-plugins-core
$ sudo dnf builddep python3 See: https://devguide.python.org/getting-started/setup-building/index.html#linux |
In case anyone is running into this issue with the amazonlinux:2 docker image, here is a Thanks to everyone that's contributed to working through this issue. Collectively I was able to piece the proper magic settings to get it working. And right when I was almost about to give up!
|
I found a really good and complete explanation bellow.
|
This is the only comment that worked for me, Thanks a ton!!!!!!! |
This help me |
Trying to use Python 3.6 on Ubuntu 16.04:
The text was updated successfully, but these errors were encountered: