Python Package Installation Issue: ModuleNotFoundError

183 views Asked by At

I'm trying to use modal-python package.

When using a Google Colab notebook, after I install the package pip install modal-python I can easily use the package as expected. eg: from modAL.models import ActiveLearner.

But When I'm working on my mac, altough my pipfile contains the dependencies as mentioned in the installation page:

numpy >= "1.13"
scipy >= "0.18"
scikit-learn >= "0.18"
modal-python = "*"

after installing the dependecies pipenv install and running the enviroment pipenv shell (Despite getting Requirement already satisfied and Piplock file generated) I get the error ModuleNotFoundError: No module named 'modAl' while running the exact code snippet that works in Google Colab notebook.

How should I find the root of the issue?

The complete trace:

Traceback (most recent call last):
  File "/Users/m/active/hello.py", line 2, in <module>
    from modAl.models import ActiveLearner
ModuleNotFoundError: No module named 'modAl'

When I run pip list all the dependencies are installed:

numpy                         1.26.3
scipy                         1.11.4
scikit-learn                  1.3.2
modAL-python                  0.4.2.1
2

There are 2 answers

1
Gandalf Rahmberg On

Please try to install the modal-python package separately. pip install modal-python

0
smth On

Because you are using a Pipenv, you will have to use:

pipenv run python hello.py

You cannot just run it normally unless you interpreter is set to the environment. If it doesn't work, activate the environment and then try again.