Opened 3 years ago

Closed 2 years ago

#22638 closed defect (wontfix)

python = python2 even with SAGE_PYTHON3=yes

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

Description (last modified by jdemeyer)

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 3 years ago by jdemeyer

  • Summary changed from "python" = python2 even with SAGE_PYTHON3=yes to python = python2 even with SAGE_PYTHON3=yes

comment:2 Changed 3 years ago by jdemeyer

  • Description modified (diff)

comment:3 Changed 3 years ago by jdemeyer

  • Description modified (diff)

comment:4 Changed 3 years ago by jdemeyer

  • Description modified (diff)

comment:5 Changed 3 years ago by vbraun

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 3 years ago by vbraun

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 3 years ago by vbraun

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 3 years ago by jhpalmieri

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

comment:9 Changed 3 years ago by 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 3 years ago by jhpalmieri

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 3 years ago by chapoton

Can we close this one now ?

comment:12 Changed 3 years ago by chapoton

  • Milestone changed from sage-8.0 to sage-duplicate/invalid/wontfix
  • Status changed from new to needs_review

comment:13 Changed 3 years ago by jhpalmieri

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

comment:14 Changed 3 years ago by jdemeyer

  • Reviewers set to Jeroen Demeyer
  • Status changed from needs_review to positive_review

comment:15 Changed 2 years ago by embray

  • Resolution set to wontfix
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.