No module named prodigy

I think I may have installed incorrectly somehow, as calling prodigy from the command line yields
“/usr/bin/python: No module named prodigy”

1 Like

Hi! Sorry you were having problems – in some cases, the prodigy command does’t seem to be recognised correctly, so the easiest solution is to simply prefix it with python -m, for example:

python -m prodigy dataset my_set

See this thread for more details. If you want a shorter command, you can always create your own alias that maps prodigy=python -m prodigy (or pgy or any other command you like).

Lol this didn’t work either until I remembered I had installed with pip3… :smiley:

python3 -m did the trick :slight_smile: thanks for the help and the quick response!

2 Likes

Thanks for updating with the solution and glad you got it working! :+1: Will add a note about this to the docs as well – this has definitely come up before and is an easy mistake to make (and the errors you get from it are not particularly useful – so if we can save others the headache and frustration, that’d be pretty nice).

2 Likes

Hey,
I have successfully installed prodigy on my mac. However, the following error occurs when I run 'python -m prodigy stats'

Traceback (most recent call last):
File "/opt/anaconda3/lib/python3.7/runpy.py", line 183, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/opt/anaconda3/lib/python3.7/runpy.py", line 142, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "/opt/anaconda3/lib/python3.7/runpy.py", line 109, in _get_module_details
import(pkg_name)
File "/opt/anaconda3/lib/python3.7/site-packages/prodigy/init.py", line 1, in
from .util import init_package
ModuleNotFoundError: No module named 'prodigy.util'

I am using macOS 10.14.6 and python version 3.7.4

Hi! This might indicate hat the (compiled) modules that were installed when you installed Prodigy aren't available in the installation, at least not for the given Python version. How did you install the Prodigy wheel? pip install or pip3 install? And if you run which python and which pip etc., do the locations match?

Hi Ines,
Thanks for the quick response.

I installed it using pip and the location of python and pip are same.
Actually I had changed the file name from windows to macOS, is that the reason it's not working?

Oh, if you used the Windows installer on macOS, that's likely the problem. The different wheel installers are built for the respective platform, so you should always use the platform-specific installer.

Hi,
I am trying to install it on windows now, but it's giving me the following error:

pip install prodigy-1.9.9-cp36.cp37.cp38-cp36m.cp37m.cp38m-win_amd64.whl
ERROR: prodigy-1.9.9-cp36.cp37.cp38-cp36m.cp37m.cp38m-win_amd64.whl is not a supported wheel on this platform.

Python version is 3.8.3

Did you check the instructions here and test whether the platform returned by distutils.util.get_platform() matches the wheel file name? Also, just to be sure, double-check that the file definitely exists at that location (because pip may raise the same error in this case).

The .whl file is really just an archive, so if pip doesn't want to install it, you can always unzip it and put it in your site-packages directory manually.

I have unpacked the whl file as you mentioned, can you just guide on what to do next after putting 'prodigy-1.9.9' folder in sit-packages

The directory to put in the site-packages should be the prodigy module directory. If the site packages are on your Python path, this should just work and Python should find it.

If installing the wheel works but prodigy can't be found, then the problem is likely related to your Python environments. For example, the python you're executing when you run python -m prodigy is not the same python/pip the package was installed with. In that case, you probably want to resolve this first and make sure the directories that pip installs to are on your PATH. Because otherwise, it can cause you all kinds of other similar problems later on.

I am having this problem and could do with some help - I think I have tried the solutions offered on this thread.

OS Monterey v12.0.1
Python: Python 3.10.0
Whichpip: /Library/Frameworks/Python.framework/Versions/3.10/bin/pip

I have installed the wheel:[Processing: prodigy-1.11.5-cp310-cp310-macosx_11_0_universal2.whl which I have renamed from the download prodigy-1.11.5-cp39-cp39-macosx_11_0_arm64.whl

I have the prodigy and python alias shortcuts in my profile but have also tried python-m prodigy and python3.10 -m python as an alternative.

I am still getting the error: ModuleNotFoundError: No module named 'prodigy.util'

any thoughts on how to resolve this?

Phil

We don't have Prodigy wheels for Python 3.10 yet (since it's new and the libraries Prodigy depends on only just got Python 3.10 support). So you'd have to use Python 3.9 environment until the next release!

ah - thanks