kitao / pyxel

A retro game engine for Python
MIT License
15.31k stars 847 forks source link

Pyxel fails on Raspberry Pi 4 #558

Closed son-link closed 3 months ago

son-link commented 3 months ago

Good afternoon.

I'm testing my projects on my Raspberry Pi 4 with aarch64, but when I run pyxel run game.py I get this error:

Traceback (most recent call last):
  File "/home/pi/ticoban/venv/bin/pyxel", line 8, in <module>
    sys.exit(cli())
  File "/home/pi/ticoban/venv/lib/python3.9/site-packages/pyxel/cli.py", line 62, in cli
    command[1](*sys.argv[2:])
  File "/home/pi/ticoban/venv/lib/python3.9/site-packages/pyxel/cli.py", line 178, in run_python_script
    runpy.run_path(python_script_file, run_name="__main__")
  File "/usr/lib/python3.9/runpy.py", line 268, in run_path
    return _run_module_code(code, init_globals, run_name,
  File "/usr/lib/python3.9/runpy.py", line 97, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "ticoban.py", line 2, in <module>
    from rock import Rock
ModuleNotFoundError: No module named 'rock'

I tried to install the requested module, but I get another error, ImportError: cannot import name 'Rock' from 'rock' (/home/pi/ticoban/venv/lib/python3.9/site-packages/rock/__init__.py).

I've been looking, but I can't find a solution, and I don't see that Pyxel depends on such a module.

Does anyone know how to fix it? Thanks in advance

DiddiLeija commented 3 months ago

As I see it, this is not an issue with Pyxel, but a problem related to your project. Apparently it relies on a ticoban.py file, which AFAIK is not a Pyxel thing. Check if your project has a file with that name, I believe that would help you better.

(NOTE: Just to verificate that Pyxel is unrelated to your issue, you can try running python game.py, without relying on pyxel run).

son-link commented 3 months ago

Sorry, I had so long without touching the code that I had it separated into several files, one of them rock, and the habit that in the Fantasy Consoles this all the code in a file, it made me forget completely and did not copy all the files to the Raspberry Pi or a Docker that I am for this. Sorry for the inconvenience.

P.S.: I'm also doing all this to get a port for emulator consoles, such as the RS36S, Ambernic, etc. If all goes well, I will explain the steps for those of you interested