Importing numpy from Thonny: ModuleNotFoundError
16,780
Thonny uses its own virtual environment by default. Open "Tools => Manage packages" or "Tools => Open system shell" in order to install into this environment.
Related videos on Youtube
Author by
John Smith
Updated on June 04, 2022Comments
-
John Smith about 2 years
I typed into the command prompt: C:\Users\JoshPC>pip install numpy
and it said:
Requirement already satisfied: numpy in c:\users\joshpc\appdata\local\programs\python\python36\lib\site-packages
Then in Thonny I wrote:
import numpy as np
and I get the error:
Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'numpy'
So it's some kind of path error, but I am not sure how to solve this.
-
John Smith over 6 yearsThanks for responding ... but unfortunately I get the same error as before. ModuleNotFound
-
specialk1st over 3 yearsFor completeness I will add that once you are in the Thonny System Shell you can run either "pip" or "pip3" to install the module you need. For example: "pip3 install requests" OR "pip install requests" to install the HTTP requests module.