No Module named numpy; but it already installed - python

Traceback (most recent call last):
File "C:/Users/acer/Downloads/len.py", line 1, in
from numpy import log
ModuleNotFoundError: No module named 'numpy'
what i have to do?? please help me

You said you installed it, how did you proceed ? I would suggest to run
pip install numpy
from the terminal.

Related

Can't use nba_api

I'm trying to use the nba_api module.
I always install my packages on my Mac using the 'pip3 install' command.
Today I installed successfully the nba_api module but I can't use it due to the following error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'nba_api'
Also, I installed it using the 'pip install' command but I have the same problem.
The interpreter I use is Python 3.9.7.
Any help will be welcomed.

Python cannot find module, pip list does

So, this was my first time making a python package. I tried and tested and got it to work. This meaning that pip install . didn't complain and that
$sudo python3
>>>from LEDController import prettyLight
>>>prettyLight().light('whatsapp',100)
provided expected output and actions in my LED matrix.
Also pip list includes LEDControllerm but as soon as I start python3 anywhere but in the LEDController package directory, the module is not being found.
Running pip install /path/to/LEDController/ is still successfull, as is pip3 install /path/to/LEDController/.
Yet I get
$sudo python3
>>> import LEDController
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'LEDController'
>>> from LEDController import prettyLight
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'LEDController'
What am I missing?
As #sinoroc said, installing only using pip is not the safest option. Instead using python3 -m pip install /path/to/module fixed the issue perfectly.
I'll put his link here so future viewers can read up on why this is.

python numpy was installed but throws " ModuleNotFoundError: No module named 'numpy'"

I have installed numpy on ubuntu. it works fine on terminal but when i want to import it to my working directory its shows me this error
Traceback (most recent call last):
File "", line 1, in
ModuleNotFoundError: No module named 'numpy'
Try this:
sudo pip install numpy
Also this
sudo pip install spyder (numpy is included)
or
sudo easy_install numpy

Module tkinter working with python 3.5, but not python 3.6

I am on Ubuntu 16.04 and have just installed installed python 3.6. via apt.
When importing tkinter, I get the oft-seen error
ImportError: No module named '_tkinter', please install the python3-tk package
Trouble is, the python3-tk package is installed.
$> python3.5 -c "import tkinter"
[no output]
$> python3.6 -c "import tkinter"
Traceback (most recent call last):
File "/usr/lib/python3.6/tkinter/__init__.py", line 37, in <module>
import _tkinter
ModuleNotFoundError: No module named '_tkinter'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python3.6/tkinter/__init__.py", line 39, in <module>
raise ImportError(str(msg) + ', please install the python3-tk package')
ImportError: No module named '_tkinter', please install the python3-tk package
How can I fix this?
I solved this problem by restoring /usr/lib/python3.6 from backup. I've now seen it several times that when stuff goes missing from there, the package manager cannot reinstall it, despite claiming to do so.

i am getting an error message while importing numpy package in windows platform?

import numpy as np
Error:
Traceback (most recent call last):
  File "", line 1, in
   import numpy as np
ImportError: No module named 'numpy'
I have tried to install with pip command but in vain. i am using python 3.4.1 version.
On Windows use this from anywhere in the command prompt
python -m pip install numpy

Categories

Resources