简体   繁体   中英

Error in installing shapes module in Python

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这是错误

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这个错误我在安装 pysal 时进入 cmd

please resolve it.

错误说没有模块被命名为形状来解决您需要pip install shapes

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM