PolyMarsDev / Flappuccino

A Pygame game made in 48 hours
355 stars 123 forks source link

Could not import .player from player [ISSUE CLOSED] #6

Closed TTR-maniac closed 3 years ago

TTR-maniac commented 3 years ago

info: pygame 2.0.1 (SDL 2.0.14, Python 3.8.6) Hello from the pygame community. https://www.pygame.org/contribute.html Traceback (most recent call last): File "main.py", line 4, in from .player import Player ImportError: attempted relative import with no known parent package

TTR-maniac commented 3 years ago

I even put main in the same dierectory as data

pablouser1 commented 3 years ago

Can be fixed if you remove the initial "." from some of the imports of main.py

TTR-maniac commented 3 years ago

Can be fixed if you remove the initial "." from some of the imports of main.py

Thanks :)

TTR-maniac commented 3 years ago

nevermind heres what happend Hello from the pygame community. https://www.pygame.org/contribute.html Traceback (most recent call last): File "c:/Users/1751760/Desktop/Flappuccino-main/data/main.py", line 4, in from player import Player File "C:\users\1751760\appdata\local\programs\python\python38\lib\site-packages\player__init__.py", line 14, in from player.layout_impl import layout File "C:\users\1751760\appdata\local\programs\python\python38\lib\site-packages\player\layoutimpl.py", line 10, in from pyramid.compat import text, string_types ModuleNotFoundError: No module named 'pyramid.compat'

TTR-maniac commented 3 years ago

can you fork this project and fix the syntaxs that I have?

pablouser1 commented 3 years ago

nevermind heres what happend Hello from the pygame community. https://www.pygame.org/contribute.html Traceback (most recent call last): File "c:/Users/1751760/Desktop/Flappuccino-main/data/main.py", line 4, in from player import Player File "C:\users\1751760\appdata\local\programs\python\python38\lib\site-packages\playerinit.py", line 14, in from player.layout_impl import layout File "C:\users\1751760\appdata\local\programs\python\python38\lib\site-packages\player\layoutimpl.py", line 10, in from pyramid.compat import text, string_types ModuleNotFoundError: No module named 'pyramid.compat'

That's probably because you have this package installed, which is interfering with our player.py, it hasn't been updated since 2013 so I think you have installed it by mistake

TTR-maniac commented 3 years ago

nevermind heres what happend Hello from the pygame community. https://www.pygame.org/contribute.html Traceback (most recent call last): File "c:/Users/1751760/Desktop/Flappuccino-main/data/main.py", line 4, in from player import Player File "C:\users\1751760\appdata\local\programs\python\python38\lib\site-packages\playerinit.py", line 14, in from player.layout_impl import layout File "C:\users\1751760\appdata\local\programs\python\python38\lib\site-packages\player\layoutimpl.py", line 10, in from pyramid.compat import text, string_types ModuleNotFoundError: No module named 'pyramid.compat'

That's probably because you have this package installed, which is interfering with our player.py, it hasn't been updated since 2013 so I think you have installed it by mistake

I Did not

TTR-maniac commented 3 years ago

/data/main.py pygame 2.0.1 (SDL 2.0.14, Python 3.8.6) Hello from the pygame community. https://www.pygame.org/contribute.html Traceback (most recent call last): File "c:/Users/1751760/Desktop/Flappuccino-main/data/main.py", line 4, in from .player import Player ImportError: attempted relative import with no known parent package

TTR-maniac commented 3 years ago

Just help me...!!!!!

TTR-maniac commented 3 years ago

import pygame, sys, time, random, colorsys, math from pygame.math import Vector2 from pygame.locals import * from .player import Player from background import Background from button import Button from .bean import Bean from .utils import clamp from .utils import checkCollisions These are the imports if you can fix this and tell me how I can fix it I owe you

fel1x0u commented 3 years ago

Okay. Seems like you need to put all the .py files in the same direcony as Data.

Finxx1 commented 3 years ago

it seems like you have a pip package messing with player.py. I would uninstall all packages except for pygame, pip, and setuptools. You also should get rid of all the .'s in the imports.

fel1x0u commented 3 years ago

import pygame, sys, time, random, colorsys, math from pygame.math import Vector2 from pygame.locals import * from .player import Player from background import Background from button import Button from .bean import Bean from .utils import clamp from .utils import checkCollisions These are the imports if you can fix this and tell me how I can fix it I owe you

omg like remove the .s from the Imports...........

mandar1jn commented 3 years ago

Could you close the issue instead of putting it in the title?