Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ImportError with numpy
#1
Hey guys, I'm new to Python but not new to coding, I was coding HTML/CSS in notepad back in the 90s haha.

Anyways, so I thought I had Python installed correctly?

I've got Python installed.
I've got Visual Studio Installed with the Python extenstion.
I've got Anaconda Installed.

I really like using IDLE, but when I run this code in IDLE, I get this error message?

https://pasteboard.co/JNtsHb4.jpg

But when I run the same code in Spyder (from Anaconda), it works

https://pasteboard.co/JNtsPxJ.jpg

How should I organize the folders on my computer and such, with an aim to just really use IDLE, and if I need a little more *omph* I'd like to use Visual Studio Code.

I swear over the last 10 years, folder organization has been thrown out the windows with the newest versions of windows. You got shit EVERYWHERE. Adobe did the same thing, hiding crap everywhere all over the computer. What happened to just plain old C:\Program Files ?

Maybe you guys are too young to remember Windows 95 and 98. I got crap on OneDrive, crap in \users\, now we got two different \Program Files..ect ect. Haha anyways. Looking forward to messing with Python. Tongue Big Grin

Thanks alot! Dance
Larz60+ write Feb-09-2021, 01:24 AM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Please do not use images, especially with a link
Reply
#2
The IDLE error is because the code you tried to run uses the numpy library and you don't have it installed.

Windows 95? 98? Bro, my first coding was QBasic on a 386 running DOS 4.0.

Yes, stuff is scattered and hard to find. I keep all my pygame projects in a folder on my desktop.
Reply
#3
You have at least 2 python installations
The code in IDLE is running on 3.9.1
The other code is running on 3.8

As pointed by @michael1789 numpy is not installed for 3.9.1

And please, in the future - post code, traceback, input/output, etc. in respective BBCode tags.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#4
But doesnt Anaconda install Numpy?

I guess this was a two part question, after we get the Numpy sorted out. Whats the best way to "organize" all this stuff on my PC with all the different editors and downloads?

Do I gotta keep Python versions the same across everything? Should I uninstall everything and just keep Anaconda? Ect ect. Thanks alot! Big Grin Cool
Reply
#5
(Feb-09-2021, 04:37 PM)stylingpat Wrote: But doesnt Anaconda install Numpy?
And as you said - it's working. That is the python3.8

Again - you have at least 2 versions of python - the one from Anaconda - which is 3.8 and another one - 3.9.1 which you try to use IDLE with.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#6
(Feb-09-2021, 04:40 PM)buran Wrote:
(Feb-09-2021, 04:37 PM)stylingpat Wrote: But doesnt Anaconda install Numpy?
And as you said - it's working. That is the python3.8

Thanks for the fast reply, it was faster then my edit of my previous post so I'll just put it here just incase you missed it. Pray

I guess this was a two part question, after we get the Numpy sorted out. Whats the best way to "organize" all this stuff on my PC with all the different editors and downloads?

Do I gotta keep Python versions the same across everything? Should I uninstall everything and just keep Anaconda? Ect ect. Thanks alot! Big Grin Cool
Reply
#7
(Feb-09-2021, 04:41 PM)stylingpat Wrote: Do I gotta keep Python versions the same across everything? Should I uninstall everything and just keep Anaconda? Ect ect. Thanks alot! Big Grin Cool
That's up to you - I for examples don't use Anaconda. But it's a matter of personal preference. If you like you can have multiple installations and you don't have to install all packages across all python versions. Maybe for now keep things simple and choose one of the installations. In the future you will learn about virtual environments as a tool to isolate third-packages installed for particular project.

In any case - better don't use IDLE - it's a poor IDE. There are plenty of other options - from relatively simple ones to full-fledged like VSCode or PyCharm
stylingpat likes this post
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#8
Awesome thank you so much! I'll uninstall everything and try again from scratch! Smile
Reply


Forum Jump:

User Panel Messages

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