Ask Your Question
2

Sage pip not compatible with PyPI

asked 2017-09-07 00:13:34 -0600

paragon gravatar image

updated 2017-09-07 15:20:38 -0600

I want to make a PyPI package for sage, similar to

https://pypi.python.org/pypi/darmonpo...

or

https://pypi.python.org/pypi/surface_...

that can be installed by anyone by typing one line. But trying these out, the installation instructions don't work! I get an error:

$~/SageMath/sage -pip install surface_dynamics
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Collecting surface_dynamics
  Could not fetch URL https://pypi.python.org/simple/surface-dynamics/: There was a problem confirming the ssl certificate: Can't connect to HTTPS URL because the SSL module is not available. - skipping
  Could not find a version that satisfies the requirement surface_dynamics (from versions: )
No matching distribution found for surface_dynamics

I believe that it is because sage is using pip 8.x, and a later version is required for PyPI. If I try installing surface_dynamics with using pip 9.01, it downloads it (but gives an error later because it is not in sage), so I do think the version is a problem.

I just updated to sage 8.0. Is this planning to be fixed soon? If there is a workaround for me, I guess that is nice, but it defeats the purpose of getting my code hosted on PyPI if I still have to give the users complicated instructions.

Or maybe my sage installation is broken? Do others get the same error?

EDIT: In light of eric_g's answer, I tried installing the developer version of 8.1. Indeed the sage pip is now 9.01, but the same error persists. So I guess my theory about the versions is wrong. It must be something else funny with the sage pip?

edit retag flag offensive close merge delete

3 answers

Sort by ยป oldest newest most voted
2

answered 2017-09-09 07:53:43 -0600

tmonteil gravatar image

updated 2017-09-09 07:54:34 -0600

It is likely you complied Sage's Python without SSL support. Could you try to recompile it with libssl-dev package installed (or similar package depending on your distro) ?

edit flag offensive delete link more

Comments

I'm using a MacBook with OS X 10.12.5. Apparently it doesn't come with SSL support: https://github.com/saghul/pythonz/iss.... I have now installed opensll and rebuild sage 8.0. I still get the same error. At least I know that it is a problem with my computer and not with sage.

paragon gravatar imageparagon ( 2017-09-12 11:52:48 -0600 )edit
2

answered 2017-09-07 03:55:41 -0600

eric_g gravatar image

pip 9.0.1 will be available in Sage 8.1 (cf. the ticket #23615, which has been merged in Sage 8.1.beta4). If you want to use it right now, you have to use the develop version of Sage:

git clone https://github.com/sagemath/sage.git
cd sage
git checkout -b develop
git pull origin develop
MAKE="make -j8" make
edit flag offensive delete link more

Comments

Thank you! This is what I was hoping for. But unfortunately it didn't fix the problem (see edit).

paragon gravatar imageparagon ( 2017-09-07 15:20:02 -0600 )edit
1

answered 2017-09-09 11:40:59 -0600

The error you report, as @tmonteil answered, comes from using a Sage built without SSL support.

Lack of SSL support won't let you pip-install using

sage -pip install name_of_the_package

Instead, you can download it, extract it, and do

sage -pip install /path/to/the/downloaded/package
edit flag offensive delete link more

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: 2017-09-07 00:13:34 -0600

Seen: 108 times

Last updated: Sep 09