Joe
Joe

Reputation: 13101

Python pandas modin - no module found

I am using anaconda and just tried:

pip install modin

that finished without issue.
Then created very simple python script and in it only have one line:

import modin.pandas as pd

Error that I am getting:

ModuleNotFoundError: No module named 'modin.pandas'; 'modin' is not a package

If I use regular panda package - all works fine.

In addition tried:

pip install --upgrade pip
pip install pandas==0.23.4  --force-reinstall
pip install modin  --force-reinstall
pip install ray  --force-reinstall

But that did not help (same error). What should be done?

Upvotes: 5

Views: 7977

Answers (6)

TL/DR - For Fedora 37 (6.5.12-100.fc37.x86_64) this works for me:

env MPICC=/usr/lib64/openmpi/bin/mpicc python3 -m pip install --no-cache-dir mpi4py unidist[all] "modin[all]"

Following the Modin documentation, MPI must be previously installed to make modin[mpi] work. Then in mpi4py documentation the next command is given:

python -m pip install mpi4py

By following mpi.h: No such file or directory #include <mpi.h>, I first installed the Fedora MPI packages that include the compiler. That is: sudo dnf install openmpi openmpi-devel.

If the mpicc compiler wrapper is not on your search path you must use:

env MPICC=/path/to/mpicc python -m pip install mpi4py

Then, to install the package removing the previous built files the --no-cache-dir can be used.

In this way, the command wrapping everything for Fedora is the one initially shown.

Upvotes: 1

jfc
jfc

Reputation: 26

what is your script name? I had same issue when I named my script as modin.py. After I renamed it to something else, the issue was gone.

Upvotes: 0

James Huang
James Huang

Reputation: 61

This pip install 'modin[dask]'works for me.

I am using Python 3.9.

Upvotes: 0

ANKIT KUMAR
ANKIT KUMAR

Reputation: 1

If you are using Anaconda environment then you should firstly install modin through following command:

conda install -c conda-forge modin

Then import

import modin.padas as pd

Upvotes: 0

C&#233;sar Gomes
C&#233;sar Gomes

Reputation: 31

You should use:

pip install modin[ray] as python suggests

Upvotes: 3

Prayson W. Daniel
Prayson W. Daniel

Reputation: 15568

Try work in an environment:

conda create --name modin python=3.6 pandas modin --channel conda-forge

So we created environment called modin with Python 3.6. pandas and mod in from conda-forge channel. Let conda deal with extra-requirements. Activate the environment and install other packages.

Note ray is yet to be support in Windows. Windows usera use WSL

conda activate modin
conda install ray -c bioconda

Test if everything is okay:

python -c "import modin.pandas as pd"

If no error! You are good to go!

Upvotes: 1

Related Questions