Repository navigation
Closed
Milestone
Description
If I try and run the matplotlib tests with Python 3.1 or 3.2 on MacOS X I get the following error (several times):
Traceback (most recent call last):
File "/Users/Shared/Jenkins/Home/virtualenvs.nose/python3.1-numpy1.6.1/lib/python3.1/site-packages/nose/failure.py", line 37, in runTest
raise self.exc_class(self.exc_val).with_traceback(self.tb)
File "/Users/Shared/Jenkins/Home/virtualenvs.nose/python3.1-numpy1.6.1/lib/python3.1/site-packages/nose/loader.py", line 379, in loadTestsFromName
module = resolve_name(addr.module)
File "/Users/Shared/Jenkins/Home/virtualenvs.nose/python3.1-numpy1.6.1/lib/python3.1/site-packages/nose/util.py", line 321, in resolve_name
module = __import__('.'.join(parts_copy))
File "/Users/Shared/Jenkins/Home/virtualenvs.nose/python3.1-numpy1.6.1/lib/python3.1/site-packages/matplotlib/tests/test_text.py", line 4, in <module>
from matplotlib.testing.decorators import image_comparison, knownfailureif
File "/Users/Shared/Jenkins/Home/virtualenvs.nose/python3.1-numpy1.6.1/lib/python3.1/site-packages/matplotlib/testing/decorators.py", line 9, in <module>
from matplotlib import pyplot as plt
File "/Users/Shared/Jenkins/Home/virtualenvs.nose/python3.1-numpy1.6.1/lib/python3.1/site-packages/matplotlib/pyplot.py", line 24, in <module>
from matplotlib.figure import Figure, figaspect
File "/Users/Shared/Jenkins/Home/virtualenvs.nose/python3.1-numpy1.6.1/lib/python3.1/site-packages/matplotlib/figure.py", line 19, in <module>
from .axes import Axes, SubplotBase, subplot_class_factory
File "/Users/Shared/Jenkins/Home/virtualenvs.nose/python3.1-numpy1.6.1/lib/python3.1/site-packages/matplotlib/axes.py", line 21, in <module>
import matplotlib.dates as mdates
File "/Users/Shared/Jenkins/Home/virtualenvs.nose/python3.1-numpy1.6.1/lib/python3.1/site-packages/matplotlib/dates.py", line 122, in <module>
from dateutil.rrule import rrule, MO, TU, WE, TH, FR, SA, SU, YEARLY, \
File "<string>", line None
SyntaxError: invalid syntax (rrule.py, line 55)
Activity
mdboom commentedon Mar 20, 2012
What directory are you running the test from? It looks like it's loading a non 2to3'd
rrule.py.astrofrog commentedon Mar 20, 2012
I'm running the tests from the top level directory (same one the contains
setup.py)pelson commentedon Aug 19, 2012
@astrofrog: Is this still happening?
pwuertz commentedon Aug 21, 2012
I have the same problem with the current master with python3 on ubuntu..
pelson commentedon Aug 21, 2012
Are you building matplotlib in place (i.e.
python3 setup.py build_ext --inplace)? Is there arrule.pyfile in your pwd?Would you mind providing the full traceback?
We should try to get an answer to this (even if it is a case of a user issue) before 1.2.x.
pwuertz commentedon Aug 21, 2012
I used
python3 setup.py install --userand my working directory was the matplotlib source root.In the matplotlib root there is no rrule.py or dateutil directory.
astrofrog commentedon Aug 21, 2012
@pelson - I'm still getting the exact same error with 62fe17f . As @mdboom pointed out, the rrule.py file is not being 2to3'd, which is what's causing the issue.
mdboom commentedon Aug 21, 2012
I've been not seeing this issue because I installed dateutil directly by hand. Obviously there's a problem when installing the matplotlib-shipped dateutil, and this should probably be addressed as part of #983.
pwuertz commentedon Aug 22, 2012
The dateutil related error is gone, but the test modules are not found when running tests.py with python3..
mdboom commentedon Aug 22, 2012
Hmm... I'm having trouble reproducing this. Are you sure you're installing matplotlib in your Python 3 environment first?
pwuertz commentedon Aug 22, 2012
Embarrassingly, the tests are working just fine when my CWD isn't the matplotlib source folder. I installed matplotlib using "python3 setup.py install --user". I can call the tests.py from another folder or run python3, import matplotlib and run matplotlib.test(). This also works for the current master without your dateutil updates...
mdboom commentedon Aug 22, 2012
Ok -- I'll give the OP @astrofrog a chance to comment, but I'd like to merge this into the 1.2 release asap.
astrofrog commentedon Aug 22, 2012
@mdboom - the code you've attached to #983 seems to do the trick, so once that's merged, this ticket can be closed.