Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
NumPy not available?
#1
import numpy as np
gives

Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
import NumPy as np
ModuleNotFoundError: No module named 'NumPy'

in my Python 3.7.4 Shell. How can I make that available? Thanks!
Reply
#2
(Aug-01-2020, 10:51 AM)Mark17 Wrote:
import NumPy as np
ModuleNotFoundError: No module named 'NumPy'
No camelcase. Type it out without any caps as you have in the codebox on this post.
Recommended Tutorials:
Reply
#3
Same result with numpy or NumPy.

Is it possible that I don't have it downloaded onto my hard drive at all? I've never tried using it before.
Reply
#4
Have you installed it? Did you install it for this version of Python? Are you using a virtual environment? Basically: more details about your setup please
Reply
#5
(Aug-01-2020, 11:45 AM)ndc85430 Wrote: Have you installed it? Did you install it for this version of Python? Are you using a virtual environment? Basically: more details about your setup please

I have Python Shell 3.7.4 installed. I don't think I installed any packages with that because I started with an intro class online that didn't use them.

This morning, I installed Anaconda3 (thinking maybe this could solve the problem). That's in my Users directory. Python is also in Users but it's several subfolders in (I'm running Windows 10).

Hmmm. When I try the Python app from the Anaconda install, "import numpy as np" gives a long error message with a link at the bottom for troubleshooting. I'll take a look at that and report back.

The error message tells me to install mkl-service package from http://github.com/IntelPython/mkl-service . Should I try to download that?

Near the bottom of the error text, it says:

Original error was: DLL load failed while importing _multiarray_umath: The specified module could not be found.
Reply
#6
(Aug-01-2020, 06:22 PM)Mark17 Wrote: his morning, I installed Anaconda3 (thinking maybe this could solve the problem).
You most activate (base) eg trough Anaconda Prompt
Long Thread here where talk about Anaconda and versions from python.org

For version from python.org
Python 3.8 (3.6-3.7) and pip installation under Windows

Anaconda3 do of course comes with numpy,here manual activate of base.
G:\Anaconda3\Scripts
λ activate

# See (base)
(base) G:\Anaconda3\Scripts
λ pip -V
pip 20.0.2 from G:\Anaconda3\lib\site-packages\pip (python 3.7)

# conda most know about,the pip of Anaconda
(base) G:\Anaconda3\Scripts
λ conda -V
conda 4.8.3

(base) G:\Anaconda3\Scripts
λ python
Python 3.7.3 (default, Mar 27 2019, 17:13:21) [MSC v.1915 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>>
>>> np.__version__
'1.16.2'
>>> exit()

(base) G:\Anaconda3\Scripts
λ deactivate
G:\Anaconda3\Scripts
λ cd ..

G:\Anaconda3
λ cd ..

# Out of Anaconda
G:\
λ python -V
Python 3.8.3

G:\
λ pip -V
pip 20.2 from c:\python38\lib\site-packages\pip (python 3.8)
Reply
#7
(Aug-01-2020, 07:42 PM)snippsat Wrote:
(Aug-01-2020, 06:22 PM)Mark17 Wrote: his morning, I installed Anaconda3 (thinking maybe this could solve the problem).
You most activate (base) eg trough Anaconda Prompt
Long Thread here where talk about Anaconda and versions from python.org
[/python]

What exactly do I do with that code?
Reply
#8
(Aug-01-2020, 08:16 PM)Mark17 Wrote: What exactly do I do with that code?
What do you mean?
You know that you get shortcut to Anaconda Prompt, Navigator, NoteBook, ect when install Anaconda3?
[Image: GbQOa9.png]
Reply
#9
(Aug-01-2020, 08:46 PM)snippsat Wrote:
(Aug-01-2020, 08:16 PM)Mark17 Wrote: What exactly do I do with that code?
What do you mean?
You know that you get shortcut to Anaconda Prompt, Navigator, NoteBook, ect when install Anaconda3?

I think the problem is solved now, actually. I can import numpy and entering
np.array([1,2,3])
returned
array([1,2,3])
Should I uninstall the previous Python Shell I had installed (3.7)?

I'm guessing what worked here is when you directed me to the Navigator and I opened the CMD.exe prompt from there. The first line showed up as "(base) C:\Users\ <my root directory>. I'm able to import numpy, pandas, and math without incident.

Thank you very much!
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020