Open Ron89 opened 8 years ago
@Ron89 @pkaifosh did you guys try this with Python 2? I'm pulled this change and am now getting this error:
nathan@losonczy-server:~/code-checkouts/roibuddy/roibuddy$ python roi_buddy.py Traceback (most recent call last): File "roi_buddy.py", line 24, in <module> from . import guiqwt_patch ValueError: Attempted relative import in non-package
Should this import be python version dependent?
No, direct running roi_buddy.py
will end up with that error. Because on line 24 it did tried to import from a folder(current folder) it doesn't know is a a package. This is not version dependent.
Python recognize package by finding __init__.py
in the folder. But when you call the script directly, the package identification step has not been done yet, hence the error.
To run the script. You need to import the package first, for example:
$ cd ~/code-checkouts/roibuddy
$ python2
>>> import roibuddy.roi_buddy
Hi Ron. I've just pushed a series of commits that should address your issue. I'm going to update the docs as well, but now if you run:
python setup.py install
you should be able to launch ROIBuddy with either:
python -m roibuddy
or just
roibuddy
This should work in both Python 2 and 3, let us know if you are stilling having issues.
After successfully installed ROIBuddy with
If I use Python 2 version of ROIBuddy,
roibuddy2
, following error occursAnd if I use Python 3 version of ROIBuddy,
roibuddy3
, following error occursEventually nothing works...
I am using Arch Linux with the latest pyqt for both Python2 and Python3. What could be the issue? Is there any way to fix it?