Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
frustrating practice
#1
Morning,

I'm old and I'm new to python. I am in a course that is using "Starting Out with Python" by Tony Gaddis and I have run into a problem with program 5 - 28. At the start of the program, you are told to import circle and import rectangle. I am getting a /ModuleNotFoundError: No module named 'circle'/. I have two questions, 1) Does this mean that the modules have not been imported? 2) How do I get them imported?

I have uninstalled python and reinstalled it again fresh, and still have the same issue. This has happened to all of the programs I have done in this chapter and is getting frustrating.

Thanks in advance for any assistance
ta
Reply
#2
install the modules. From the command line enter
pip install circle
pip install rectangle
Then those modules will be available to you
Reply
#3
(Nov-12-2020, 08:00 PM)jefsummers Wrote: install the modules. From the command line enter
pip install circle
pip install rectangle
Then those modules will be available to you

Thanks but it came back with an invalid syntax
Reply
#4
pip is a command that installs a package. It is something you run from a command shell, not something you embed in a python program.

https://www.pythonforbeginners.com/basic...e-packages.

When you get the "Module not found" error it means that Python cannot find the file in your distribution. Usually this means you are trying to import a package that you didn't install, but it could also be as simple as one of your files not being in the right folder or a spelling error.

In your case Python is looking for circle.py and rectangle.py. Where do you expect these files to be? Are these files you are supposed to download for your course, or are they files you are expected to write?
Reply
#5
there is code for circle.py (6-11) and rectangle.py (6-12) in 6.4. Storing Functions in Modules
i.e. these are modules that you are supposed to create, not install with pip
Of course, you need to learn how to install via pip, because it's essential
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
Thank you I will try that.
Reply
#7
FYIL Note that ( as stated in one of above posts ), pip is run from command line, not from python script.
Reply
#8
Thank you all. I have a bigger issue now. Python will not work. I get a start up failure and the shell shuts down. I have uninstalled Python 3 times and still receive the same message. I went through the docs and still get the same sub process connection failure. Is the a easier IDE to use?
Reply
#9
I like using Anaconda to install python and manage environments, and within anaconda Spyder is a great IDE to start with, VSCode when you are more established.

Also consider online versions such as colab.research.google.com
Reply
#10
Anaconda?? Is that the name of the site? You have me at a disadvantage, not new to life but not good with this. I was told that python was the easiest to learn, but there are a lot of other things I need to learn as well.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Sorting a DataFrame - Best Practice? lummers 1 1,750 Feb-10-2020, 04:41 AM
Last Post: satyashetty
  Pre-release practice help! Wilson1218 3 3,327 Nov-05-2017, 04:21 PM
Last Post: buran
  Practice Question Excersizes A3G 5 6,215 Oct-16-2016, 12:38 PM
Last Post: A3G

Forum Jump:

User Panel Messages

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