mongoq
mongoq

Reputation: 21

Ampy - ModuleNotFoundError: No module named 'progress_bar'

I tried installing https://github.com/scientifichackers/ampy from source.
I'm running Ubuntu 23.04 and Python 3.11.2.

I ran this command in the source folder:

sudo python3 setup.py install

The installation completed successfully.

Now I get the error message running ampy:

ampy Traceback (most recent call last): File "/usr/local/bin/ampy", line 33, in <module> sys.exit(load_entry_point('adafruit-ampy==1.1.0', 'console_scripts', 'ampy')()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/bin/ampy", line 25, in importlib_load_entry_point return next(matches).load() ^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/importlib/metadata/init.py", line 202, in load module = import_module(match.group('module')) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "<frozen importlib._bootstrap>", line 1206, in _gcd_import File "<frozen importlib._bootstrap>", line 1178, in _find_and_load File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 690, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 940, in exec_module File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed File "/usr/local/lib/python3.11/dist-packages/adafruit_ampy-1.1.0-py3.11.egg/ampy/cli.py", line 31, in <module> ModuleNotFoundError: No module named 'progress_bar'

I tried looking in /usr/local/lib/python3.11/dist-packages for a subdirectory called adafruit_ampy-1.1.0-py3.11.egg.

Theres an archive by that name (ending .egg). I can extract it to a directory in that subfolder ... but running ampy again leads to some debug output relating to meta data. The other .egg files are directories.

The .egg archive includes a Python file called progress_bar.py.

I tried installing the Ubuntu packages python3-progressbar and python3-progressbar2.

Still no luck ...

Upvotes: 1

Views: 726

Answers (1)

Mikael &#214;hman
Mikael &#214;hman

Reputation: 2375

This library is looking for it's own included import, you don't want to try to include anything external here.

There is an open issue https://github.com/scientifichackers/ampy/issues/117 that this software should have namespaced these libraries, which would fix this.

You can easily modify the two lines with the namespace:

from ampy.progress_bar import PorgressBar
from ampy.progress_bar import PorgressBarBath

and reinstall it.

Upvotes: 1

Related Questions