Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR: Could not build wheels for cynes, which is required to install pyproject.toml-based projects #1

Closed
ManPython opened this issue Mar 17, 2024 · 10 comments · Fixed by #2
Assignees

Comments

@ManPython
Copy link

ManPython commented Mar 17, 2024

pip install cynes
Collecting cynes
  Downloading cynes-0.0.3.tar.gz (158 kB)
     ---------------------------------------- 158.2/158.2 kB 1.2 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy in e:\python311-venv\lib\site-packages (from cynes) (1.25.0)
Collecting pysdl2-dll (from cynes)
  Downloading pysdl2_dll-2.30.0-py2.py3-none-win_amd64.whl.metadata (4.0 kB)
Collecting pysdl2 (from cynes)
  Downloading PySDL2-0.9.16.tar.gz (773 kB)
     ---------------------------------------- 773.5/773.5 kB 4.5 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Downloading pysdl2_dll-2.30.0-py2.py3-none-win_amd64.whl (4.1 MB)
   ---------------------------------------- 4.1/4.1 MB 4.7 MB/s eta 0:00:00
Building wheels for collected packages: cynes, pysdl2
  Building wheel for cynes (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for cynes (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [15 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-cpython-311
      creating build\lib.win-amd64-cpython-311\cynes
      copying cynes\emulator.py -> build\lib.win-amd64-cpython-311\cynes
      copying cynes\__init__.py -> build\lib.win-amd64-cpython-311\cynes
      running build_ext
      building 'cynes.emulator' extension
      creating build\temp.win-amd64-cpython-311
      creating build\temp.win-amd64-cpython-311\Release
      creating build\temp.win-amd64-cpython-311\Release\cynes
      cl.exe /c /nologo /O2 /W3 /GL /DNDEBUG /MD -Icynes -IC:\Users\ManPython\AppData\Local\Temp\pip-build-env-81gpb_12\overlay\Lib\site-packages\numpy\core\include -IE:\Python311-venv\include -IE:\Python311\include -IE:\Python311\Include /EHsc /Tpcynes/emulator.cpp /Fobuild\temp.win-amd64-cpython-311\Release\cynes/emulator.obj -std=c++11
      error: command 'cl.exe' failed: None
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for cynes
  Building wheel for pysdl2 (setup.py) ... done
  Created wheel for pysdl2: filename=PySDL2-0.9.16-py3-none-any.whl size=580378 sha256=3ae0697425158f4fa9ffca06ec4dbec986aeda951386be9bc7e73f2bf8277216
  Stored in directory: c:\users\ManPython\appdata\local\pip\cache\wheels\92\fa\85\909d0304f9a316386c7980e02b19925f55b980ff838fb6a2b5
Successfully built pysdl2
Failed to build cynes
ERROR: Could not build wheels for cynes, which is required to install pyproject.toml-based projects
@Youlixx
Copy link
Owner

Youlixx commented Mar 17, 2024

This issue does not seem to be related to cynes, wrong repo?

@ManPython ManPython changed the title Could not build wheels for nes-py, which is required to install pyproject.toml-based projects ERROR: Could not build wheels for cynes, which is required to install pyproject.toml-based projects Mar 17, 2024
@ManPython
Copy link
Author

Yes, my mistake. Looks like many projects not working with python311 around building wheel

@Youlixx
Copy link
Owner

Youlixx commented Mar 17, 2024

I just tried with a fresh install of python 3.11.8 and it worked fine, I don't think this issue is related to python itself. Looks like you don't have a C/C++ compiler installed on your system, which is necessary to build the Python wheel (this is probably why you're seeing an error message about cl.exe). On Windows, I believe you need to install Microsoft's C++ build tools to resolve this.

@Youlixx
Copy link
Owner

Youlixx commented Mar 19, 2024

@ManPython I've updated the CI, pre-built wheels for python 3.11 (and 3.12) should be available via pip install cynes.

@ManPython
Copy link
Author

ManPython commented Mar 19, 2024

Thx. Its working now (both x86, x64), but very fast.. it's normal case?
Exist some parameters to set as correct speed?

@Youlixx
Copy link
Owner

Youlixx commented Mar 19, 2024

Yes, it was designed to run as fast as possible, the best you can do is to artificially pause the emulator between each frame, here is a simple example using python's sleep:

from time import sleep

...

while not nes.should_close():
    frame = nes.step()
    sleep(0.01)  # waits for 10ms

By adopting this straightforward method, you'll need to fine-tune the sleep duration based on the speed at which your computer executes an emulator step. Additionally, you could verify that precisely 16 milliseconds (so you'll get ~60FPS) have passed between two steps by comparing the timestamp between each step and modifying the sleep duration accordingly.

@ManPython
Copy link
Author

I see. Thx! sleep(0.016) working ok.

@ManPython
Copy link
Author

Once case around.. sound not working in default.. also need configure this? Or this is normal due even though it does not produce any sound?

@Youlixx
Copy link
Owner

Youlixx commented Mar 19, 2024

Yes this is normal, I wanted to keep things simple and AFAIK outputting sound can be quite complex as it requires a separate audio thread and a good synchronization. I still emulate some part of the NES's audio chip as

  • some game use the APU frame counter to do some mid-frame CPU/PPU synchronization.
  • it contains a unit to perform direct memory access used by (almost) every games to copy the frame sprite data from the RAM to the OAM.

@ManPython
Copy link
Author

But is possible to add/activate sound in some simple way?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants