olofk / ipyxact

Python-based IP-XACT parser
MIT License
121 stars 47 forks source link

Fixed import #3

Closed tudortimi closed 8 years ago

tudortimi commented 8 years ago

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.

olofk commented 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

tudortimi commented 8 years ago

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.

tudortimi commented 8 years ago

I get the same issue in Linux. On both setups, there isn't any PYTHONPATH variable defined (nor should there be).

tudortimi commented 8 years ago

Even running selftest.sh (which sets PYTHONPATH to ipyxact) doesn't work (same error).

olofk commented 8 years ago

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

tudortimi commented 8 years ago

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?

olofk commented 8 years ago

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

tudortimi commented 8 years ago

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.