1

I have installed

  1. mca package using pip install --user mca
  2. prince package using pip install --user prince

Now, when I trying use them in Spyder by using import command I am getting the below errors:

ModuleNotFoundError: No module named 'prince'

ModuleNotFoundError: No module named 'mca'

I have used below lines of code to import these packages

import prince
import mca

Since I am new to data science and creating models for my understanding, I have not created any virtual environment.

When I go to Anaconda command prompt and use Python command and then import the above packages using import command there is no error.

Where am I going wrong, please guide me in resolving this issue.

Regards

Sudhir

Community
  • 1
  • 1
kbsudhir
  • 151
  • 1
  • 1
  • 10

2 Answers2

0

I had the exact same issue with Anaconda on Windows 10.

I solved it by adding the libraries' path to the PYTHONPATH in Spyder, per https://stackoverflow.com/a/10741803/3889011.

First, you need to find where prince and mca are installed.

Since you didn't install them in a virtual environment, on Windows their location will be something like %LOCALAPPDATA%\Continuum\Anaconda3\Lib\site-packages. (For people who installed them in a virtual environment, their path will be something like %LOCALAPPDATA%\Continuum\Anaconda3\envs\<env name>\Lib\site-packages).

If you're under Linux or Mac, the path is probably something similar.

Once you found where the modules are located, go to the Tools menu in Spyder, and click on PYTHONPATH manager. Then, add the modules' path to the list, and restart Spyder.

rebbj
  • 1
0

I fixed this issue by running

pip install prince

In the anaconda terminal of my environment:

enter image description here

Ignacio Alorre
  • 6,038
  • 6
  • 50
  • 76