Ask Your Question
1

I can't use pip to add a python toolbox due to the mac openSSL problem. What is the current best work around?

asked 2021-06-25 05:02:22 +0200

takashi gravatar image

I want to install qutip, which is a quantum mechanics toolkit.

I can't install it using pip because of the mac openSSL problem.

None of the workarounds I have found online have worked for me.

I tried installing my own copy of python 3 using home-brew, and then successfully installed qutip, only to discover that sage math uses its own copy of python 3 located in a different directory.

Is there a way for me to manually install the toolkit based on how pip successfully installed it on my own copy of python 3?

Is there another workaround?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2021-06-25 09:55:17 +0200

slelievre gravatar image

Sage 9.3 should no longer have this problem on macOS.

So your options include the following.

Either way, installing with sage --pip install will then become possible.

edit flag offensive delete link more

Comments

I can't use Sage 9.3 because I'm running High Sierra, so I followed READ_ME directions to install patch.

I navigated to the correct directory: "cd /Users/ssalser/Downloads/fix_mac_sage-master/" I installed the patch: "/Applications/SageMath-9.1.app/sage -python -m fix_mac_sage9.fix"

Terminal output: "Installing Tk 8.6.10 in /Library/Frameworks -- please choose the defaults." "The file /Users/ssalser/Downloads/fix_mac_sage-master/fix_mac_sage9/TclTk-8.6.10.pkg does not exist." "Adding the _tkinter and _ssl modules to Sage' "Rewriting id and dependency paths in _ssl, libssl and libcrypto."

After doing this I typed in "/Applications/SageMath-9.1.app/sage -python -m pip install qutip"

The terminal said: "pip is configured with locations that require TLS/SSL, however the ssl module...

takashi gravatar imagetakashi ( 2021-06-26 00:37:05 +0200 )edit

I also tried typing this: "/Applications/SageMath-9.1.app/sage --pip install qutip"

But got the same message: "pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available."

takashi gravatar imagetakashi ( 2021-06-26 00:40:25 +0200 )edit

Further advice much appreciated.

By the way, am I supposed to communicate using comments, or in a different way?

takashi gravatar imagetakashi ( 2021-06-26 00:43:02 +0200 )edit

Yes, comments work for the discussion.

First, run this in a terminal to place a symlink to the Sage executable in your PATH:

ln -s /Applications/SageMath-9.1.app/sage /usr/local/bin

or if that does not work, then same with sudo:

sudo ln -s /Applications/SageMath-9.1.app/sage /usr/local/bin

and enter the password for your account on that Mac when prompted.

Then you can type sage instead of /Applications/SageMath-9.1.app/sage.

slelievre gravatar imageslelievre ( 2021-06-26 04:13:33 +0200 )edit

Then try this:

sage -i openssl
sage -f python3

This will rebuild a lot of things and take some time. But if it succeeds you will be able to use pip.

slelievre gravatar imageslelievre ( 2021-06-26 04:19:07 +0200 )edit

But really, if you have homebrew, I would suggest installing Sage 9.3 from source.

slelievre gravatar imageslelievre ( 2021-06-26 04:21:27 +0200 )edit

sage -i openssl took a long time, but it seemed to work sage -f python 3 yielded an "Error building Sage." "make: * [python3] Error 1"

will Sage 9.3 work in High Sierra if I build it from source?

( the reason I installed Sage 9.1 is because the Sage 9.2 and 9.3 prebuilt applications seemed to require a more advanced OS. )

takashi gravatar imagetakashi ( 2021-06-26 07:40:22 +0200 )edit

The new Sage-macOS app should work with High Sierra.

Get the latest version from the releases page.

It supports SSL and installing extra packages with pip.

Building Sage 9.3 (or 9.4.beta3 if you feel more adventurous) from source should also produce a working Sage on High Sierra.

slelievre gravatar imageslelievre ( 2021-06-26 13:54:43 +0200 )edit

I just discovered my computer is actually running Sierra, not High Sierra.
( The Sage-macOS app quits unexpectedly instead of working. )

Is there a way to get pip working in Sage 9.1? Should I try the fix_mac_sage script again?

takashi gravatar imagetakashi ( 2021-06-26 19:37:51 +0200 )edit

When I try to go back to Sage 9.1 the application will no longer opens up. It gets stuck halfway through "verifying". I have tried downloading a copy of the app from a different server, but ran into the same problem. Is there something I need to uninstall or undo?

takashi gravatar imagetakashi ( 2021-06-27 18:49:16 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2021-06-25 05:02:22 +0200

Seen: 290 times

Last updated: Jun 25 '21