Opened 6 years ago

Closed 5 years ago

#22638 closed defect (wontfix)

python = python2 even with SAGE_PYTHON3=yes

Reported by: Jeroen Demeyer Owned by:
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: python3 Keywords:
Cc: Frédéric Chapoton Merged in:
Authors: Reviewers: Jeroen Demeyer
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by Jeroen Demeyer)

When installing Sage with SAGE_PYTHON3=yes, the symlink $SAGE_LOCAL/bin/python points to python2. This is almost certainly caused by #22354.

This causes build-time problems like

[sagelib-7.6.rc1] ************************************************************************
[sagelib-7.6.rc1] Traceback (most recent call last):
[sagelib-7.6.rc1]   File "setup.py", line 54, in <module>
[sagelib-7.6.rc1]     import sage.env
[sagelib-7.6.rc1]   File "/usr/local/src/sage-config/src/sage/env.py", line 87, in <module>
[sagelib-7.6.rc1]     _add_variable_or_fallback('UNAME',           os.uname()[0])
[sagelib-7.6.rc1]   File "/usr/local/src/sage-config/src/sage/env.py", line 71, in _add_variable_or_fallback
[sagelib-7.6.rc1]     import six
[sagelib-7.6.rc1] ImportError: No module named six
[sagelib-7.6.rc1] ************************************************************************
[sagelib-7.6.rc1] Error building the Sage library
[sagelib-7.6.rc1] ************************************************************************
[sagelib-7.6.rc1] Please email sage-devel (http://groups.google.com/group/sage-devel)
[sagelib-7.6.rc1] explaining the problem and including the relevant part of the log file
[sagelib-7.6.rc1]   /usr/local/src/sage-config/logs/pkgs/sagelib-7.6.rc1.log
[sagelib-7.6.rc1] Describe your computer, operating system, etc.
[sagelib-7.6.rc1] ************************************************************************

six is installed as expected in local/lib/python3.5/site-packages/six.py. The directory local/lib/python2.7/site-packages/ is empty.

Change History (15)

comment:1 Changed 6 years ago by Jeroen Demeyer

Summary: "python" = python2 even with SAGE_PYTHON3=yespython = python2 even with SAGE_PYTHON3=yes

comment:2 Changed 6 years ago by Jeroen Demeyer

Description: modified (diff)

comment:3 Changed 6 years ago by Jeroen Demeyer

Description: modified (diff)

comment:4 Changed 6 years ago by Jeroen Demeyer

Description: modified (diff)

comment:5 Changed 6 years ago by Volker Braun

Seems like python2 takes it upon itself to overwrite the symlink even when there is already one. So this is a race between python2 and python3 build, which is why I can't reproduce it.

comment:6 Changed 6 years ago by Volker Braun

Btw in #22582 I'm explictly using pip2 or pip3 to install dependencies instead of trusting some python/pip symlink. That way you can event install both py2/py3 versions of dependencies simultaneously, which is imho useful for testing and debugging.

comment:7 Changed 6 years ago by Volker Braun

Ops, I got confused with the local/lib/python symlink, ignore comment:5.

PEP394 says that "for the time being, all distributions should ensure that python refers to the same target as python2".

comment:8 Changed 6 years ago by John Palmieri

I think that #22764 might fix this problem. Please try it.

comment:9 Changed 6 years ago by Frédéric Chapoton

Is this ticket pertinent for the current problem with python3 build ?

https://groups.google.com/forum/#!topic/sage-devel/FqR-37Fu3tY

comment:10 Changed 6 years ago by John Palmieri

Volker was very insistent at #22582 that python should always be python2, because that is a Python convention. So whether this has to do with the python3 build, there will be resistance to changing it. Perhaps this ticket should be closed, or perhaps it should be repurposed to using sage-python23 in more places in the build process to call a version of Python depending on the setting of SAGE_PYTHON3.

comment:11 Changed 5 years ago by Frédéric Chapoton

Can we close this one now ?

comment:12 Changed 5 years ago by Frédéric Chapoton

Milestone: sage-8.0sage-duplicate/invalid/wontfix
Status: newneeds_review

comment:13 Changed 5 years ago by John Palmieri

It's okay with me to close it. Jeroen, any objections?

comment:14 Changed 5 years ago by Jeroen Demeyer

Reviewers: Jeroen Demeyer
Status: needs_reviewpositive_review

comment:15 Changed 5 years ago by Erik Bray

Resolution: wontfix
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.