Closed tudortimi closed 8 years ago
Hi. Thanks for reporting. I'm not sure why the import statement fails in your case. Could you give me some background on how you installed the library, and how you use it. The change you propose also doesn't work for me, so I would rather find out what the issue could be before pulling this in
I downloaded the library and I'm just trying to run the example under Windows:
git clone ...
cd ipyxact
python gen_c_header.py generic_example.xml
It should work without installing anything since I'm running it from the root directory.
I get the same issue in Linux. On both setups, there isn't any PYTHONPATH variable defined (nor should there be).
Even running selftest.sh (which sets PYTHONPATH to ipyxact) doesn't work (same error).
I think I figured out what the problem is. I didn't test this with Python 2.7. 19754d2 should hopefully fix this. Please let me know if that helps
Interesting.... So this means that the imports look different depending on the Python version(2 vs 3)? Would it be easier to just say you require Python3 (since you don't test it on Python2) and just develop for that?
Yes, it would be easier to just support Python3, but there are still quite some people on 2.7, so I usually try to support that as well if it doesn't require too many workaround.
And I also had no idea that they had made these changes to the import system. Very strange
I've tested https://github.com/olofk/ipyxact/commit/19754d25070a7082bc1ef2fee068cfeac0b229cb and it works on Python 2.7. I'll close the pull request as it's not needed anymore.
Without changing the 'import' line I couldn't get it working. The 'from ipyxact' shouldn't be needed since 'ipxact_yamp' is in the same directory and that gets looked up first.
I also added a gitignore for 'pyc' files.