Error in installing shapes module in Python

1.9k views Asked by At

Hey Guys I written some code to make a simple hut using turtle and shapes in python but when i am importing the shapes then it is showing me error this is the error this is the error

here is my code

import turtle
from shapes import *

# naming the turtle
pen = turtle.Turtle()

# setting up turtle
pen.speed(100)
pen.color(0,0,0)
wn = turtle.Screen()
wn.color(66,202,244)

#start drawing
drawWindow(pen,-95,15,"square")
drawHouse(pen)
drawDoor(pen,-25,-20)
drawBush(pen,120,35)
drawWindow(pen,-10,100,"circle")
drawFence(pen)
drawPath(pen)
drawWindow(pen,-95,100,"square")
drawGrass(pen)
drawCloud(pen,75,160)
drawWindow(pen,75,15,"square")
drawSun(pen,-200,160,70)
drawWindow(pen,180,150,"square")

then i read a solution for this to install "pysal" but when I am installing pysal(pip install pysal) from cmd then it is also showing this error while installing pysal this error i am getting in cmd while installing pysal

please resolve it.

2

There are 2 answers

1
AudioBubble On

The error says no module is named shapes to solve that you need to pip install shapes

0
phd On

There is the code in shapes/__init__.py:

from Shape import Shape

The code works under Python 2 and doesn't work under Python 3. For Python 3 it must be either

from shapes.Shape import Shape

or

from .Shape import Shape

The same problem with other relative imports. The bottom line: the package shapes is Python2-only. Please report the problem or even better send a pull-request to fix it.