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

ROIBuddy do not Launch #24

Open
Ron89 opened this issue May 26, 2016 · 3 comments
Open

ROIBuddy do not Launch #24

Ron89 opened this issue May 26, 2016 · 3 comments

Comments

@Ron89
Copy link
Contributor

Ron89 commented May 26, 2016

After successfully installed ROIBuddy with

pip2 install roibuddy --user
mv ~/.local/bin/roibuddy ~/.local/bin/roibuddy2
pip3 install roibuddy --user
mv ~/.local/bin/roibuddy ~/.local/bin/roibuddy3

If I use Python 2 version of ROIBuddy, roibuddy2, following error occurs

home/chong/.local/lib/python2.7/site-packages/skimage/filter/__init__.py:6: skimage_deprecation: The `skimage.filter` module has been renamed to `skimage.filters`.  This placeholder module will be removed in v0.13.
  warn(skimage_deprecation('The `skimage.filter` module has been renamed '
Traceback (most recent call last):
  File "/home/chong/.local/bin/roibuddy2", line 7, in <module>
    from roibuddy.roi_buddy import main
  File "/home/chong/.local/lib/python2.7/site-packages/roibuddy/roi_buddy.py", line 32, in <module>
    from guidata import qthelpers
  File "/home/chong/.local/lib/python2.7/site-packages/guidata/__init__.py", line 541, in <module>
    import guidata.config
  File "/home/chong/.local/lib/python2.7/site-packages/guidata/config.py", line 15, in <module>
    from guidata.configtools import add_image_module_path, get_translation
  File "/home/chong/.local/lib/python2.7/site-packages/guidata/configtools.py", line 22, in <module>
    from guidata.qt.QtGui import (QFont, QLabel, QPixmap, QIcon, QHBoxLayout,
  File "/home/chong/.local/lib/python2.7/site-packages/guidata/qt/__init__.py", line 25, in <module>
    sip.setapi('QString', 2)
ValueError: API 'QString' has already been set to version 1

And if I use Python 3 version of ROIBuddy, roibuddy3, following error occurs

Traceback (most recent call last):
  File "/home/chong/.local/bin/roibuddy3", line 9, in <module>
    load_entry_point('roibuddy==1.0.0', 'gui_scripts', 'roibuddy')()
  File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 542, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2569, in load_entry_point
    return ep.load()
  File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2229, in load
    return self.resolve()
  File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2235, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/home/chong/.local/lib/python3.5/site-packages/roibuddy/__init__.py", line 1, in <module>
    from roiBuddyUI import *
ImportError: No module named 'roiBuddyUI'

Eventually 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?

@nbdanielson
Copy link
Contributor

nbdanielson commented Jul 15, 2016

@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?

@Ron89
Copy link
Contributor Author

Ron89 commented Jul 16, 2016

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

jzaremba added a commit that referenced this issue Aug 31, 2016
@jzaremba
Copy link
Member

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.

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

3 participants