Home > Enterprise >  Import numpy can't be resolved ERROR When I already have numpy installed
Import numpy can't be resolved ERROR When I already have numpy installed

Time:03-24

I am trying to run my chatbot that I created with python, but I keep getting this error that I don't have numpy installed, but I do have it installed and whenever I try to install it it tells me that it is already installed. The error reads "ModuleNotFoundError: No module named 'numpy'"

I don't understand what the problem is, why is it always throwing this error? even for nltk and tensorflow even though I have them all installed.

How can I resolve this issue?

Here is a screen shot when i install numpy:

enter image description here

Here is a screen shot of the error:

enter image description here

CodePudding user response:

I fixed the problem by deleting a python folder that was in the root directory of C:/ which caused installing the package to be ignored and not be installed in the correct directory which is in C:/Users/

CodePudding user response:

This is not a very correct decision, but I had same problem with another libraries. You can be using different python interpreters (in my case it was anaconda) => libraries can be installed in different folders

It was a temporarly solution, but I created new venv

pip install virtualenv
mkdir python-virtual-environments && cd python-virtual-environments
python3 -m venv env
source env/bin/activate    # activate venv

There you can install all packages for your project, and deactivate it (with deactivate) command

  • Related