Install Python Packages for Cubit Python

Hi,

Since matplotlib isn’t a default library of python, I wanted to install that for Python used by Cubit, but I got the error//warning shown below.

How can I solve this problem or is there a way to include the packages already installed by anaconda?

Best regards
Andreas

WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(“Can’t connect to HTTPS URL because the SSL module is not available.”)’: /simple/matplotlib/

ERROR: Could not find a version that satisfies the requirement matplotlib (from versions: none)

ERROR: No matching distribution found for matplotlib

Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host=‘pypi.org’, port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(“Can’t connect to HTTPS URL because the SSL module is not available.”)) - skipping

Hi Andreas,

What version of Coreform Cubit are you using? Do Greg’s comments on Adding NumPy and other extra Python modules to Trelis - Coreform Cubit / General Topics - Coreform LLC work for you?

Thanks,
Karl

Hi Karl,

I am using Coreform Cubit 2022.4.
Unfortunately it did not work.
I think there is a problem with pip:

WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.

Andreas

Hi Andreas, what OS are you on?

Hi Scot,

I am using Ubuntu 22.04.1 LTS.

OK. What’s the exact command line you’re using with the Cubit python? Executing this in the Cubit bin/python3 folder should work: ./python3 -m pip install matplotlib

Exactly, I used the same command, but then I got the warnings and errors listed in the txt file below.

terminalOutput.txt (2.0 KB)

Try installing libssl-dev into your environment.

The newest version is already installed.
I have Cubit in the root directory. Can this cause any problems?

I don’t think so, Cubit is normally installed into /opt with root permissions. You can try moving Cubit to /opt, but I don’t think that’s the issue here. The problem is that Python can’t find the SSL certificates needed for HTTPS.

One of our team members reached out to me with the solution for this. This is a bug that we’ve fixed in later versions of Cubit. The fix is to add symlinks into the Python distribution that point it to libcrypto.so.1.1 and libssl.so.1.1.
So in the bin/python3/lib folder, execute these commands:

ln -s ../../libcrypto.so.1.1 libcrypto.so.1.1
ln -s ../../libssl.so.1.1 libssl.so.1.1

Ok.
I created the symlink but same problem as before.

When you do a ls -l in the python3/lib folder, do you see that those symlinks are valid?

Yes, they are (they are green :slight_smile: )

Huh. Are you able to update Cubit to a later version?

Yeah, I can do that.

cubit_python_ssl.tar.gz (1.3 MB)
After untarring, try placing the two files in bin/python3/

It works.
I was able to install matplotlib.

Thank you!!!

@brian – I tried this on Windows as well… it seems that pip isn’t packaged with the windows install?

PS C:\Users\Owner\OneDrive\GitHub\1D_C0_FEA>  & 'C:\Program Files\Coreform Cubit 2022.10\bin\python3\python.exe' -m pip install matplotlib
C:\Program Files\Coreform Cubit 2022.10\bin\python3\python.exe: No module named pip

So I then tried bootstrapping pip using https://bootstrap.pypa.io/pip/get-pip.py

PS C:\Users\Owner\OneDrive\GitHub\1D_C0_FEA>  & 'C:\Program Files\Coreform Cubit 2022.10\bin\python3\python.exe' .\get-pip.py
Defaulting to user installation because normal site-packages is not writeable
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pip/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pip/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pip/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pip/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pip/
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
ERROR: Could not find a version that satisfies the requirement pip (from versions: none)
ERROR: No matching distribution found for pip
PS C:\Users\Owner\OneDrive\GitHub\1D_C0_FEA>

FYI this is with an Oct 19th dev build:
Coreform-Cubit-2022.10-rc+31692-win64

I updated the windows (and mac) packages to ship with pip. The latest dev build should work now.

1 Like