Hi Nathann,

actually, the issue is a licensing one. pip needs some SSL to fetch
sources with https, so if Sage is built sith SSL support you won't have
any problem. If openssl was a standard package, you will not have any
problem either. Unfortunately, openssl is licensed in a way that it can
not be a standard package.

This is a known issue that has been discussed here:
http://trac.sagemath.org/ticket/17368

A short term workaround could be to catch the error and print the
procedure Vincent suggested, with an alternative:

1alt) run "sage -i openssl"

Actually, the use of libssl-dev is already explained in
http://sagemath.org/doc/installation/source.html, however it is somehow
hidden in notebook-specific section. Another short term workaround could
be to refactor this, i just opened a ticket for that:
http://trac.sagemath.org/ticket/17690

A longer term possibility could be to ship e.g. gnutls or nss (which are
LGPL, MozillaPL) as a standard package and try to build python/pip with it
(not sure it is doable).

Ciao,
Thierry



On Thu, Jan 29, 2015 at 10:12:33AM +0100, Nathann Cohen wrote:
> Hello everybody,
> 
> I tried yesterday to install a Python package with 'pip', and ran into the
> following problem (full taceback at the end):
> 
> ~$ sage -pip install line-profiler
> ...
> ImportError: cannot import name HTTPSHandler
> 
> Vincent sent me this link [1], and suggested the following procedure:
> 
> 1) Install libssl-dev
> 2) run "sage -f python"
> 3) run "make", which recompiled most of Sage
> 
> This worked out perfectly.
> 
> Do you think that there is something to do about this "in Sage"? Some doc
> to write somewhere, some dependency to add? Or do we consider this to be an
> unrelated python problem?
> 
> Byeeeeeeeeeeeee,
> 
> Nathann
> 
> [1]
> http://stackoverflow.com/questions/20688034/python-importerror-cannot-import-name-httpshandler
> 
> Traceback (most recent call last):
>   File "/home/ncohen/.Sage/local/bin/pip", line 9, in <module>
>     load_entry_point('pip==1.5.6', 'console_scripts', 'pip')()
>   File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 356, in
> load_entry_point
>   File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 2419, in
> load_entry_point
>   File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 2135, in load
>   File
> "/home/ncohen/.Sage/local/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/__init__.py",
> line 10, in <module>
>     from pip.util import get_installed_distributions, get_prog
>   File
> "/home/ncohen/.Sage/local/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/util.py",
> line 18, in <module>
>     from pip._vendor.distlib import version
>   File
> "/home/ncohen/.Sage/local/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/_vendor/distlib/version.py",
> line 14, in <module>
>     from .compat import string_types
>   File
> "/home/ncohen/.Sage/local/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/_vendor/distlib/compat.py",
> line 31, in <module>
>     from urllib2 import (Request, urlopen, URLError, HTTPError,
> ImportError: cannot import name HTTPSHandler
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sage-devel+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-devel@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to