You are not logged in.

#1 2017-01-10 14:24:36

NickTouik
Member
Registered: 2014-01-15
Posts: 19

[SOLVED] SageMath notebook not running anymore (ssl issue, I think)

At some point the SageMath notebook stopped running on my system. I can launch sage but when type

sage: notebook()

I get errors which finishes with:

VerificationError: importing '/usr/lib/python2.7/site-packages/cryptography-0.9.1-py2.7-linux-x86_64.egg/cryptography/_Cryptography_cffi_a269d620xd5c405b7.so': /usr/lib/python2.7/site-packages/cryptography-0.9.1-py2.7-linux-x86_64.egg/cryptography/_Cryptography_cffi_a269d620xd5c405b7.so: undefined symbol: SSLv3_server_method

I have already taken the following steps:
1) Ensure that

sage-notebook

is installed (from the official repositories)
2) pacman -Syu
3) Remove and reinstall sage.
4) Install

python2-cryptography

5) Reboot my machine.
6) Paste the error message in google and look for solutions; although, maybe some of you are better error googlers than myself :-)

I'm a bretty basic archlinux user, the most exotic thing I do is use the AUR. Otherwise I do my best to adhere to best package management practices.

Here is some further weirdness, when I run

sage --notebook=jupyter

I get:

The Jupyter notebook requires ssl, even if you do not use
https. Install the openssl development packages in your system and
then rebuild Python (sage -f python2).

But

pacman -Q openssl

says it is installed. Another random fact

jupyter-notebook

works fine.

Last edited by NickTouik (2017-02-16 13:50:09)

Offline

#2 2017-01-10 14:46:11

arojas
Developer
From: Spain
Registered: 2011-10-09
Posts: 2,311

Re: [SOLVED] SageMath notebook not running anymore (ssl issue, I think)

NickTouik wrote:

I get errors which finishes with:

VerificationError: importing '/usr/lib/python2.7/site-packages/cryptography-0.9.1-py2.7-linux-x86_64.egg/cryptography/_Cryptography_cffi_a269d620xd5c405b7.so': /usr/lib/python2.7/site-packages/cryptography-0.9.1-py2.7-linux-x86_64.egg/cryptography/_Cryptography_cffi_a269d620xd5c405b7.so: undefined symbol: SSLv3_server_method

How did you install python2-cryptography? That file is not from our package.

Here is some further weirdness, when I run

sage --notebook=jupyter

I get:

The Jupyter notebook requires ssl, even if you do not use
https. Install the openssl development packages in your system and
then rebuild Python (sage -f python2).

That is a known Sage jupyter notebook issue, it will report missing ssl regardless of what the real reason is why it can't be launched (the actual reason is that we don't provide the python2 version of the jupyter notebook)

Offline

#3 2017-01-10 16:59:25

NickTouik
Member
Registered: 2014-01-15
Posts: 19

Re: [SOLVED] SageMath notebook not running anymore (ssl issue, I think)

Thanks for getting back to me.

arojas wrote:

How did you install python2-cryptography? That file is not from our package.

I installed it via pacman. I hoped it may provide the kind of ssl sage was looking for. By the way, let's ignore jupyter for now.

Last edited by NickTouik (2017-01-10 17:00:00)

Offline

#4 2017-01-10 17:06:25

arojas
Developer
From: Spain
Registered: 2011-10-09
Posts: 2,311

Re: [SOLVED] SageMath notebook not running anymore (ssl issue, I think)

NickTouik wrote:

I installed it via pacman. I hoped it may provide the kind of ssl sage was looking for. By the way, let's ignore jupyter for now.

No - as I said, that file is not from our repos. We have cryptography 1.7.1, not 0.9.1. Get rid of all foreign python stuff from your system and use the official packages.

Offline

#5 2017-01-10 17:18:23

NickTouik
Member
Registered: 2014-01-15
Posts: 19

Re: [SOLVED] SageMath notebook not running anymore (ssl issue, I think)

Erm...

pacman -Q python2-cryptography
python2-cryptography 1.7.1-2

Please bear with me. What is it you mean exactly by "foreign stuff". Is it that:

a) Some python packages installed via pacman are interfering with sage?
b) I have some non-official packages (probably from AUR) that are messing everything up?
c) I enables some other pacman repo that is messing everything up? The only "funky" one I have is multilib.

By the way on my other computer this package is installed and sage works fine.

Last edited by NickTouik (2017-01-10 17:21:17)

Offline

#6 2017-01-10 17:20:08

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: [SOLVED] SageMath notebook not running anymore (ssl issue, I think)

Could be any of that, as well as pip.

Offline

#7 2017-01-10 17:24:53

NickTouik
Member
Registered: 2014-01-15
Posts: 19

Re: [SOLVED] SageMath notebook not running anymore (ssl issue, I think)

Scimma wrote:

Could be any of that, as well as pip.

Ah, right. I went pip crazy a while back. So the sage error message says that crypto is at cryptography-0.9.1, but pacman says it's at 1.7.1-2.

I'm not sure how to go about fixing this.

Last edited by NickTouik (2017-01-10 17:25:06)

Offline

#8 2017-01-11 01:40:30

NickTouik
Member
Registered: 2014-01-15
Posts: 19

Re: [SOLVED] SageMath notebook not running anymore (ssl issue, I think)

Success :-)

First of all thank you arojas for helping me interpret the sage error message and thank you Scimmia for mentioning pip, which I never would have thought of!

First question: I never thought that pip and pacman could interfere with one another. Is there a best package management practice to avoid this problem in the future?

I have another question, but first I should describe in detail how I ended up fixing the sage notebook.

After running

sudo pip2 list

I saw that this is where the outdated version of cryptography was. After uninstalling it I made some progress: the notebook in sage was giving new error messages, but this time with respect to openssl. I therefore attempted

sudo pip2 uninstall pyOpenSS

but I got error messages ending with:

OSError: [Errno 2] No such file or directory: '/usr/lib/python2.7/site-packages/pyOpenSSL-0.15.1-py2.7.egg'

The sage notebook still didn't work. I then tried to use pip2 to upgrade that package, which did some stuff, but ended in error messages. I then re attempted to use pip2 to uninstall pyOpenSSL again, and this time it worked. The sage notebook now works.

I think I messed up python when upgrading archlinux. Pacman didn't want to upgrade python2 due to mysterious python2 files. I used pacman to check which package owns the file, and it said none. In this case I read that I could exceptionally force the upgrade, which I did.

My second question: Is there a way to verify the integrity of my python2 installation, because I'm not sure what else might be broken.

Offline

Board footer

Powered by FluxBB