Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python importing conflicts #224

Open
wdeconinck opened this issue Jun 5, 2012 · 4 comments
Open

python importing conflicts #224

wdeconinck opened this issue Jun 5, 2012 · 4 comments

Comments

@wdeconinck
Copy link
Member

After putting the PYTHONPATH to the coolfluid/dso directory,
and in python calling
import numpy,
a conflict appears:


Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/__init__.py", line 136, in <module>
    import add_newdocs
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/add_newdocs.py", line 9, in <module>
    from numpy.lib import add_newdoc
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/lib/__init__.py", line 4, in <module>
    from type_check import *
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/lib/type_check.py", line 8, in <module>
    import numpy.core.numeric as _nx
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/__init__.py", line 40, in <module>
    from numpy.testing import Tester
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/testing/__init__.py", line 8, in <module>
    from unittest import TestCase
ImportError: cannot import name TestCase

The reason is the file "unittest.py" inside the coolfluid/dso dir, that was added recently. @barche, do you know a way around this?

@barche
Copy link
Member

barche commented Jun 5, 2012

Yes, let's just remove our unittest.py, and move the functions to coolfluid.py, preferably as members of a unittest class. I was unaware that we had this, I think this also explains why ipython doesn't start anymore with the dso dir in the PYTHONPATH

@wdeconinck
Copy link
Member Author

I was also unaware. It seems to be Vivian's good work. We should indeed try to find a solution for this in a more pythonic way, including classes, namespaces etc.

@wdeconinck
Copy link
Member Author

In the latest commit I renamed the unittest.py file to check.py to solve this temporarily

@barche
Copy link
Member

barche commented Jun 13, 2012

OK, good, this might not even need to be so temporary, we just need to come up with a design for the part of our module that will be implemented in python

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants