Bug 564504 - Importing sympy raises an ImportError
Summary: Importing sympy raises an ImportError
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: sympy
Version: 13
Hardware: All
OS: Linux
low
high
Target Milestone: ---
Assignee: Conrad Meyer
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-02-12 22:11 UTC by Andrew McNabb
Modified: 2010-11-04 23:34 UTC (History)
4 users (show)

Fixed In Version: sympy-0.6.7-5.fc14
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-09-15 22:29:44 UTC


Attachments (Terms of Use)
Fix traceback in compare functions (2.25 KB, patch)
2010-08-30 19:53 UTC, Toshio Ernie Kuratomi
no flags Details | Diff

Description Andrew McNabb 2010-02-12 22:11:42 UTC
Here's the output from the interactive interpreter.  Thanks.

>>> import sympy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.6/site-packages/sympy/__init__.py", line 18, in <module>
    from polys import *
  File "/usr/lib/python2.6/site-packages/sympy/polys/__init__.py", line 2, in <module>
    from monomial import monomials, monomial_count
  File "/usr/lib/python2.6/site-packages/sympy/polys/monomial.py", line 6, in <module>
    from sympy.functions import factorial
  File "/usr/lib/python2.6/site-packages/sympy/functions/__init__.py", line 9, in <module>
    import combinatorial
  File "/usr/lib/python2.6/site-packages/sympy/functions/combinatorial/__init__.py", line 3, in <module>
    import numbers
  File "/usr/lib/python2.6/site-packages/sympy/functions/combinatorial/numbers.py", line 20, in <module>
    from sympy.utilities.memoization import recurrence_memo
  File "/usr/lib/python2.6/site-packages/sympy/utilities/__init__.py", line 20, in <module>
    from pytest import raises
  File "/usr/lib/python2.6/site-packages/sympy/utilities/pytest.py", line 47, in <module>
    from py.__.test.outcome import Outcome, Passed, Failed, Skipped
ImportError: cannot import name Outcome

Comment 1 Conrad Meyer 2010-02-15 14:44:23 UTC
I'm on Fedora 11 and cannot reproduce this.

Comment 2 Andrew McNabb 2010-02-16 18:50:12 UTC
I didn't have the problem with Fedora 11; it is new with Fedora 12.

Comment 3 Toshio Ernie Kuratomi 2010-02-16 22:25:53 UTC
brief look at the code... looks like you want to import and use OutcomeException instead of Outcome.

Comment 4 Andrew McNabb 2010-08-26 19:42:40 UTC
In Fedora 13, sympy fails to load with another ImportError, which looks like there's a dependency problem.

amcnabb@prodigy:~ :) python
Python 2.6.4 (r264:75706, Jun  4 2010, 18:20:31) 
[GCC 4.4.4 20100503 (Red Hat 4.4.4-2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sympy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.6/site-packages/sympy/__init__.py", line 22, in <module>
    from sympy.core import *
  File "/usr/lib/python2.6/site-packages/sympy/core/__init__.py", line 4, in <module>
    from basic import Basic, S, C, sympify
  File "/usr/lib/python2.6/site-packages/sympy/core/basic.py", line 2497, in <module>
    from symbol import Wild, Symbol
  File "/usr/lib/python2.6/site-packages/sympy/core/symbol.py", line 293, in <module>
    from sympify import sympify
  File "/usr/lib/python2.6/site-packages/sympy/core/sympify.py", line 191, in <module>
    from numbers import Integer, Real
  File "/usr/lib/python2.6/site-packages/sympy/core/numbers.py", line 5, in <module>
    import mpmath.libmpf as mlib
ImportError: No module named libmpf
>>>

Comment 5 Conrad Meyer 2010-08-26 19:54:20 UTC
It's not a dependency problem; here's the full story:

Sympy includes a private copy of another python library (libmpf). We had to patch sympy to use the system copy. libmpf or sympy was updated, and the patch either no longer applies, or the old namespace doesn't work. I think both.

At any rate, the patch needs to be re-created, and that's blocking on someone willing to do the work.

IIRC, Sympy was first broken when my comaintainer bumped it to 0.6.6 from 0.6.3 and didn't rebase the patch, but since then libmpf has been updated as well and a new patch is needed.

Comment 6 José Matos 2010-08-28 09:46:26 UTC
Just like for bug #602431 rebuilding sympy-0.6.7-4.fc14 for f13 fixed this problem for me as well.

So just like in the former bug I suggest that a build of f14 for f13 could probably fix this bug.

Comment 7 Toshio Ernie Kuratomi 2010-08-30 19:50:37 UTC
Looks like Jussi may have updated the patch when he went from 0.6.6 to 0.6.7.

There's a traceback with the new code, though, I'll attach a patch here to fix that.

If you're not interested in sympy anymore, perhaps Jussi would take ownership in Fedora?  Currently he's just owner in EPEL which is why he's not getting CC'd on the Fedora bug reports.

Comment 8 Toshio Ernie Kuratomi 2010-08-30 19:53:09 UTC
Created attachment 442019 [details]
Fix traceback in compare functions

The mpmath compare functions traceback when given constants from sympy.  This patch fixes that by adding _mpf_ values to the constants similar to how the constancs already have _sage_() methods.

Comment 9 Susi Lehtola 2010-08-30 20:24:52 UTC
(In reply to comment #5)
> IIRC, Sympy was first broken when my comaintainer bumped it to 0.6.6 from 0.6.3
> and didn't rebase the patch, but since then libmpf has been updated as well and
> a new patch is needed.

Nope, I had bumped sympy to 0.6.6 well before the bundled mpmath was removed (bug #551576), in fact it was you who made the patch ;)

Anyway, if Andrew could try the scratch build of 0.6.7 at
 http://koji.fedoraproject.org/koji/taskinfo?taskID=2435972
that could be swell. If it solves your problem I'll prepare the update for f12 and f13.

Comment 10 Toshio Ernie Kuratomi 2010-08-30 20:50:16 UTC
Note, the traceback is still present when %check is run: http://koji.fedoraproject.org/koji/getfile?taskID=2435973&name=build.log

TypeError: 'NoneType' object is not iterable

Comment 11 Susi Lehtola 2010-08-30 21:16:46 UTC
Right. Well, here's a version with the patch from comment #8 (thanks btw), which isn't suffering from that:
http://koji.fedoraproject.org/koji/taskinfo?taskID=2436064

Comment 12 Fedora Update System 2010-09-06 18:20:15 UTC
sympy-0.6.7-5.fc12 has been submitted as an update for Fedora 12.
https://admin.fedoraproject.org/updates/sympy-0.6.7-5.fc12

Comment 13 Fedora Update System 2010-09-06 18:20:25 UTC
sympy-0.6.7-5.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/sympy-0.6.7-5.fc13

Comment 14 Fedora Update System 2010-09-08 02:18:27 UTC
sympy-0.6.7-5.fc13 has been pushed to the Fedora 13 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update sympy'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/sympy-0.6.7-5.fc13

Comment 15 Fedora Update System 2010-09-15 22:29:32 UTC
sympy-0.6.7-5.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 16 Fedora Update System 2010-09-15 22:35:01 UTC
sympy-0.6.7-5.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 17 Fedora Update System 2010-10-25 12:09:20 UTC
sympy-0.6.7-5.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/sympy-0.6.7-5.fc14

Comment 18 Fedora Update System 2010-11-04 23:34:44 UTC
sympy-0.6.7-5.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.