내가 파일이 없습니다 :AttributeError : 모듈 '...'더 속성 '...'
biomes.py
import animals
...
class woodsBiome(baseBiome):
# I do stuff
def __init__(self):
self.animals = animals.generateAnimals(5)
animals.py을
def generateAnimals(quantity):
# I do stuff
__init__
을 biomes.woodsBiome
에서 실행하면 animals.generateAnimals(5)
에 실패합니다. 그것은 다음과 같습니다 :
Traceback (most recent call last):
File "game.py", line 10, in <module>
import animals
File "/path/to/files/animals.py", line 4, in <module>
from game import die
File "/path/to/files/game.py", line 22, in <module>
areaMap = biomes.generateMap(xMax, yMax)
File "/path/to/files/biomes.py", line 85, in generateMap
biomeList = [woodsBiome(), desertBiome(), fieldBiome()]
File "path/to/files/biomes.py", line 41, in __init__
self.animals = animals.generateAnimals(5)
AttributeError: module 'animals' has no attribute 'generateAnimals'
나는 뭔가 빠져 있다는 느낌이 들었습니다. 누군가 올바른 방향으로 나를 가리킬 수 있습니까?
감사합니다.
소리가 순환적인 가져 오기 문제와 유사합니다. – user2357112
이것은 몇 가지 다른 것들 일 수 있습니다. 아나콘다 (Anaconda) 나 캐노피 (Canopy)와 같은 것으로 이것을 실행하고 있습니까? – roganjosh
예. 'animals.py'도'바이오 메스 '를 가져 옵니까? –