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

Can't run on Ubuntu 20.04 #4

Open
ricardogffcouto opened this issue May 4, 2021 · 5 comments
Open

Can't run on Ubuntu 20.04 #4

ricardogffcouto opened this issue May 4, 2021 · 5 comments

Comments

@ricardogffcouto
Copy link

Hello Daniel! Great work on developing this app :)

I've followed all steps but cannot get it to run on Ubuntu 20.04. I get the following error:
Traceback (most recent call last): File "/home/ricardo/.local/share/virtualenvs/snooker-ball-tracker-YBvYRYDk/lib/python3.8/site-packages/snooker_ball_tracker-0.1.0-py3.8.egg/snooker_ball_tracker/settings.py", line 75, in __getattr__ KeyError: '__path__'

Any idea why this is happening?

Thanks!

@Danthewaann
Copy link
Owner

Hi @ricardogffcouto.

How are you running the app?

The attributes that are available from the settings.py file are:

['JSONEncoder', 'SnookerColour', '__DEFAULT_SETTINGS', '__SETTINGS', '__SettingsJSONEncoder', '__builtins__', '__cached__', '__doc__', '__file__', '__getattr__', '__loader__', '__name__', '__package__', '__settings_object_hook', '__spec__', 'json', 'load', 'np', 'save']

So trying to access __path__ from settings.py will fail in this case.

@ricardogffcouto
Copy link
Author

So, step by step:

  • pipenv install pyqt5 (to create a virtual environment for the project with Python 3.8.5 & pyqt5)
  • pipenv shell
  • python setup.py install
  • python -m snooker_ball_tracker.gui

@Danthewaann
Copy link
Owner

I've been able to fix the __path__ issue (I'll get it committed soon), however another issue arises:

if you are installing pyqt5 through pipenv it will install version 5.15.4.
For some reason opencv-python will not work with this version of pyqt5.

You can get the gui to work by installing opencv-python-headless instead of opencv-python. (However cli.py will no longer work as it relies on the gui components of opencv that don't get installed in opencv-python-headless.

I'll have to rework cli.py to create a small window using pyqt5 to display images instead, but for now you can get gui.py to work with the workaround above.

Danthewaann added a commit that referenced this issue May 5, 2021
Danthewaann added a commit that referenced this issue May 5, 2021
@ricardogffcouto
Copy link
Author

These steps fixed my problem! Thanks :)

@Danthewaann
Copy link
Owner

Will target some work to rework cli.py and to swap over to using opencv-python-headless by default.

@Danthewaann Danthewaann reopened this May 6, 2021
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