Opened 5 years ago
Closed 5 years ago
#22775 closed defect (fixed)
conway_polynomials not compatible with python3
Reported by:  chapoton  Owned by:  

Priority:  major  Milestone:  sage8.0 
Component:  python3  Keywords:  
Cc:  jdemeyer, vbraun, jhpalmieri, jpflori, pbruin  Merged in:  
Authors:  Frédéric Chapoton  Reviewers:  Travis Scrimshaw 
Report Upstream:  N/A  Work issues:  
Branch:  339a49d (Commits, GitHub, GitLab)  Commit:  339a49d64e447cbf00ae89ff736b1dfc3605d6b4 
Dependencies:  Stopgaps: 
Description (last modified by )
The package conway_polynomials does not compile with SAGE_PYTHON3=yes.
Let us use pickle instead of sage own saveandload.
[conway_polynomials0.4.p0] Thread model: posix [conway_polynomials0.4.p0] gcc version 5.4.0 (GCC) [conway_polynomials0.4.p0] **************************************************** [conway_polynomials0.4.p0] Traceback (most recent call last): [conway_polynomials0.4.p0] File "./spkginstall", line 4, in <module> [conway_polynomials0.4.p0] from sage.structure.sage_object import save [conway_polynomials0.4.p0] ImportError: No module named 'sage.structure.sage_object' [conway_polynomials0.4.p0]
Tarball: https://trac.sagemath.org/rawattachment/ticket/22775/conway_polynomials0.5.tar.bz2
Attachments (1)
Change History (21)
comment:1 Changed 5 years ago by
 Cc jdemeyer added
 Component changed from PLEASE CHANGE to python3
 Type changed from PLEASE CHANGE to defect
comment:2 Changed 5 years ago by
comment:3 Changed 5 years ago by
@jdemeyer, do you have any idea of what to do here ? This is my current blocking point.
comment:4 Changed 5 years ago by
 Cc vbraun jhpalmeri added
and sage (with python3) itself fails to launch because of the line
> 39 from sage.structure.sage_object import SageObject
in sage/repl/rich_output/display_manager.py
comment:5 Changed 5 years ago by
conway_polynomials depends on sagelib, so the latter has be become inportable into python3 first.
Arguably this is a bad state of affairs, conway_polynomials should just use some Sageindependent format to serialize itself (e.g. plain Python pickles / sqlite / ...).
comment:6 Changed 5 years ago by
Thanks, Volker. I do not think I will be able to fix that..
By the way, trying to import sage in my python3sage build, I get
./sage python Python 3.5.1 (default, Apr 16 2017, 11:35:45) [GCC 6.2.0 20161005] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from sage.all import * Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/chapoton/sage3/local/lib/python3.5/sitepackages/sage/all.py", line 86, in <module> import sage.misc.lazy_import ImportError: No module named 'sage.misc.lazy_import'
So it seems that there is some problem with the cython extensions..
comment:7 Changed 5 years ago by
 Branch set to public/experimental_python3_v0
 Commit set to 18bd95dc50ddbb69e80824a8d92d5f03b6f3f2f7
here is my current experimental branch, where all pyx files compile with SAGE_PYTHON3=yes
Last 10 new commits:
e55ac1b  trac 22756: fix merge error with #22764.

7699f3f  trac 22756: check name of _scproxy .so file correctly for Python 3.

dcc3fb4  trac 22756: remove two invalid configure options for Python 3

678fb20  trac 22756: port a fix for pyports.h from

6762fe4  trac 22756: rebase better on top of 22764

ab246fd  Merge branch 'u/jhpalmieri/python3_osx' of ssh://trac.sagemath.org:22/sage into test

02a2b13  py3.6 compatible weak dictionaries

787975e  trac 22305 adding the new weak_dict.pyx

39c189d  Merge branch 'public/22305' of ssh://trac.sagemath.org:22/sage into test

18bd95d  VERY experimental python3 branch

comment:8 Changed 5 years ago by
 Commit changed from 18bd95dc50ddbb69e80824a8d92d5f03b6f3f2f7 to b13a9e1cf18f3456e00323e087e35104ec4123c6
comment:9 Changed 5 years ago by
 Cc jpflori pbruin added
comment:10 Changed 5 years ago by
 Branch changed from public/experimental_python3_v0 to u/chapoton/conway_pickle
 Commit changed from b13a9e1cf18f3456e00323e087e35104ec4123c6 to 2a7197dbf419288dcb27bad78a8d3e41b623d8b6
here is a tentative, not yet tested, to use pickle
New commits:
2a7197d  trying to make conway package sageindependent

comment:11 Changed 5 years ago by
 Commit changed from 2a7197dbf419288dcb27bad78a8d3e41b623d8b6 to 467e4e147c8b18e4cc671af87d6df2f33181a7dd
Branch pushed to git repo; I updated commit sha1. New commits:
467e4e1  trac 22775 fixing details

comment:12 Changed 5 years ago by
 Description modified (diff)
 Status changed from new to needs_review
this seems to work
comment:13 Changed 5 years ago by
But fails on python3 with
[conway_polynomials0.4.p1] gcc version 6.2.0 20161005 (Ubuntu 6.2.05ubuntu12) [conway_polynomials0.4.p1] **************************************************** [conway_polynomials0.4.p1] Traceback (most recent call last): [conway_polynomials0.4.p1] File "./spkginstall", line 22, in <module> [conway_polynomials0.4.p1] create_db() [conway_polynomials0.4.p1] File "./spkginstall", line 11, in create_db [conway_polynomials0.4.p1] from src import conway_polynomials [conway_polynomials0.4.p1] File "/home/chapoton/sage3/local/var/tmp/sage/build/conway_polynomials0.4.p1/src/__init__.py", line 1, in <module> [conway_polynomials0.4.p1] from table import * [conway_polynomials0.4.p1] ImportError: No module named 'table' [conway_polynomials0.4.p1] [conway_polynomials0.4.p1] real 0m0.177s [conway_polynomials0.4.p1] user 0m0.056s [conway_polynomials0.4.p1] sys 0m0.024s [conway_polynomials0.4.p1] ************************************************************************ [conway_polynomials0.4.p1] Error installing package conway_polynomials0.4.p1
comment:14 Changed 5 years ago by
From the error, looks like a relative import that will needs to be an absolute import. You probably should also fix this from src import conway_polynomials
in spkginstall
too.
Changed 5 years ago by
comment:15 Changed 5 years ago by
 Commit changed from 467e4e147c8b18e4cc671af87d6df2f33181a7dd to 339a49d64e447cbf00ae89ff736b1dfc3605d6b4
Branch pushed to git repo; I updated commit sha1. New commits:
339a49d  new version of conway polynomial package

comment:16 Changed 5 years ago by
 Reviewers set to Travis Scrimshaw
Works for me with Python2. If you tested it with Python3, then set a positive review.
comment:17 Changed 5 years ago by
 Status changed from needs_review to positive_review
works for me in python3 (so that, for the first time ever, I got the message "Sage build/upgrade complete!" with python3 !!)
comment:18 Changed 5 years ago by
 Description modified (diff)
comment:19 Changed 5 years ago by
 Cc jhpalmieri added; jhpalmeri removed
comment:20 Changed 5 years ago by
 Branch changed from u/chapoton/conway_pickle to 339a49d64e447cbf00ae89ff736b1dfc3605d6b4
 Resolution set to fixed
 Status changed from positive_review to closed
Potentially the same problem with database_odlyzko_zeta ?