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

No module named 'modAL.models'; 'modAL' is not a package #31

Closed
notebooklinda opened this issue Jan 15, 2019 · 14 comments
Closed

No module named 'modAL.models'; 'modAL' is not a package #31

notebooklinda opened this issue Jan 15, 2019 · 14 comments

Comments

@notebooklinda
Copy link

After installing modAL by pip install modAL on Ubuntu 16.04 with a virtualenv python3.5, I tried to import modAL, but got the error message as titled. How can I solve this issue?

@cosmic-cortex
Copy link
Member

What did you import specifically? Can you post the exact log with the import and the error message as well? Also, can you execute the

from modAL.models import ActiveLearner

command in a Python console?

I suspect this is a problem with the setup script. I have encountered this issue a long ago, but this was solved since then and I was unable to reproduce it, so I have no idea what went wrong.

Did you install the latest version, which is 0.3.4? (You can check it with pip freeze | grep modAL.)

@notebooklinda
Copy link
Author

Thanks for your reply! The modAL version is the latest version. I eventually solved it by placing the modAL folder in the same path as the python script that imports modAL. I think it this case the path matters.

@cosmic-cortex
Copy link
Member

I am afraid if the script won't run when not in the same folder with modAL, the problem is not solved yet :(
Unfortunately, I was unable to reproduce this error on a freshly installed machine, so I still don't know what might went wrong.

In your script, which one did you try?

import modAL

or

from modAL.models import ActiveLearner

@notebooklinda
Copy link
Author

Both, and they gave me the same error message.
I used a virtualenv, and after running pip install modAL in my virtualenv, I could find modAL was installed and located in site-packages
my working directory is
(activelr) notebooklinda@notebooklinda:/Documents/02-750_automation_of_biological_research/TA$
modAL is located at
(activelr) notebooklinda@notebooklinda:
/Documents/02-750_automation_of_biological_research/TA$ locate -b modAL
/home/notebooklinda/Documents/02-750_automation_of_biological_research/TA/activelr/lib/python3.5/site-packages/modAL
/home/notebooklinda/Documents/02-750_automation_of_biological_research/TA/activelr/lib/python3.5/site-packages/modAL-0.3.4.dist-info

After I copy the entire modAL directory to my working directory, I am able to import modAL.

@kevinkit
Copy link

kevinkit commented Apr 4, 2022

I had the same issue when using Spyder and closing the Console / Restaring the Kernel. Restaring Spyder seems to fix this issue.

An easy check is to start the command tool in your virtual environment and check if you are able to import modAL there.

@mgfcatherall
Copy link

I had the same/similar issue and fixed it by renaming the install folder from modAL to modal, maybe everyone stick to lowercase for package names in future?

@cosmic-cortex
Copy link
Member

I had the same/similar issue and fixed it by renaming the install folder from modAL to modal, maybe everyone stick to lowercase for package names in future?

There was a change in PyPI, modAL has been moved under the name modAL-python. The package modal is a different one! (See #170.)

@evaZQR
Copy link

evaZQR commented Jul 13, 2023

I had the same/similar issue and fixed it by renaming the install folder from modAL to modal, maybe everyone stick to lowercase for package names in future?

There was a change in PyPI, modAL has been moved under the name modAL-python. The package modal is a different one! (See #170.)

I had the same problem,but I can't find the 'modAL.model',but i can find "modal",not 'modAL',it seems like that they are not the same package?

@scao0208
Copy link

I am afraid if the script won't run when not in the same folder with modAL, the problem is not solved yet :( Unfortunately, I was unable to reproduce this error on a freshly installed machine, so I still don't know what might went wrong.

In your script, which one did you try?

import modAL

or

from modAL.models import ActiveLearner

Hey I think it may be "pip install modAL-python"

@swayson
Copy link

swayson commented Mar 4, 2024

Wow, so the docs is wrong? it is not pip install modAL but "pip install modAL-python".
The latter resolved the issue for me.

@breakthewall
Copy link

This happens also when the filename from where you do the import is modAL.py. A simple renaming fixes the issue.

@kevinbleakley
Copy link

I now have the situation where I have modal-python version 0.4.2 installed, but commands like: from modAL.models import ActiveLearner bring up the error: ModuleNotFoundError: No module named 'modAL' . This all worked fine before, but after a reinstall of anaconda3 today, everything has gone to hell !

@pducrot
Copy link

pducrot commented Jan 3, 2025

same with me, since I reinstalled anaconda3 I have the following error

from modAL.aquisition import BaseLearner
ModuleNotFoundError: No module named 'modAL.aquisition'

@kiodia
Copy link

kiodia commented Jan 11, 2025

Same problem, I solved it by using:

Alternatively, you can install modAL directly from source:

pip install git+https://github.com/modAL-python/modAL.git

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