Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Beginner Getting an error
#6
This error:
Error:
Traceback (most recent call last): File "test11.py", line 71, in <module> Product.create_products() NameError: name 'Product' is not defined
is referring to the fact that on this line:
Product.create_products()
Product is undefined.

I dont see anywhere in your code where Product is defined. I only see product. They are two different things.

Either you are not importing it right or your class is lowercase.

In the module product.py change the class to
class Product(object):
instead of
class product(object):
Recommended Tutorials:
Reply


Messages In This Thread
Beginner Getting an error - by Boa - Jun-22-2019, 10:55 PM
RE: Beginner Getting an error - by metulburr - Jun-22-2019, 11:06 PM
RE: Beginner Getting an error - by Boa - Jun-22-2019, 11:11 PM
RE: Beginner Getting an error - by metulburr - Jun-22-2019, 11:15 PM
RE: Beginner Getting an error - by Boa - Jun-22-2019, 11:20 PM
RE: Beginner Getting an error - by metulburr - Jun-22-2019, 11:46 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Beginner Python Error ianmac88 4 1,416 Sep-05-2022, 12:30 PM
Last Post: jefsummers
  Beginner having Syntax Error problem RyanHo 3 2,536 Sep-10-2020, 08:33 AM
Last Post: cnull
  Beginner - simple package installation error mefeng2008 0 1,817 Mar-13-2020, 09:17 AM
Last Post: mefeng2008
  [split] Python beginner: Weird Syntax Error mnsaathvika 1 2,238 Jul-22-2019, 06:14 AM
Last Post: buran
  Beginner Level - Name Error Aniket 11 5,396 Apr-11-2019, 07:53 PM
Last Post: loomski
  Python beginner: Weird Syntax Error mentoly 5 10,544 Oct-13-2017, 08:06 AM
Last Post: gruntfutuk
  Display error, beginner help :( Armandas 1 3,292 May-02-2017, 08:39 PM
Last Post: sparkz_alot

Forum Jump:

User Panel Messages

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