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

Can't build for Windows #282

Open
TheFatBastid opened this issue Dec 22, 2022 · 5 comments
Open

Can't build for Windows #282

TheFatBastid opened this issue Dec 22, 2022 · 5 comments

Comments

@TheFatBastid
Copy link

I tried following the docs to make the build for windows and nothing works. Missing packages, scripts failing, sadness increasing.
Not sure where else to ask this, sorry.
Is there a more up to date version of the docs?

@Linkid Linkid added the Windows label Dec 22, 2022
@Linkid
Copy link
Member

Linkid commented Dec 22, 2022

Hello. Thanks for this issue.
Which version of fofix did you try ? About dependencies, which packages are missing ? What errors did you have ?
Thanks again.

@TheFatBastid
Copy link
Author

TheFatBastid commented Dec 22, 2022

Thank for the reply! Let's start from the top!
Following: https://fofix.readthedocs.io/en/latest/quickstart/installation.html with a Windows 10 computer with no python currently on it.

  1. go to https://www.python.org/downloads/windows/ and get the 32-bit installer. During the installer click add to path, custom install, check everything, next, check install for all users, install.
  2. python -m pip install --upgrade pywin32 to install pyWin32. (exe bundles are deprecated).
  3. Grab the source from https://github.com/fofix/fofix/archive/refs/heads/master.zip , unzip it.
  4. Download the fofix-win32-deppack-20130304-updated.zip from https://www.dropbox.com/s/p8xv4pktq670q9i/fofix-win32-deppack-20130304-updated.zip?dl=0 . Unzip it and put deps folder in fofix-master\win32
  5. Inside the fofix-master dir run pip install -r requirements.txt. First Error:
Collecting Cerealizer==0.8.3
  Using cached Cerealizer-0.8.3.tar.gz (12 kB)
  Preparing metadata (setup.py) ... done
Collecting numpy==1.16.6
  Using cached numpy-1.16.6.zip (5.1 MB)
  Preparing metadata (setup.py) ... done
Collecting olefile==0.46
  Using cached olefile-0.46.zip (112 kB)
  Preparing metadata (setup.py) ... done
Collecting Pillow==6.2.2
  Using cached Pillow-6.2.2.tar.gz (37.8 MB)
  Preparing metadata (setup.py) ... done
Collecting PyAudio==0.2.11
  Using cached PyAudio-0.2.11.tar.gz (37 kB)
  Preparing metadata (setup.py) ... done
Collecting pygame==1.9.6
  Using cached pygame-1.9.6.tar.gz (3.2 MB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [21 lines of output]


      WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
      Using WINDOWS configuration...


      Download prebuilts to "prebuilt_downloads" and copy to "./prebuilt-x86"? [Y/n]Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\<my username>\AppData\Local\Temp\pip-install-hgh7_enl\pygame_ae1f9026d2544baba0680df9ae3760e8\setup.py", line 194, in <module>
          buildconfig.config.main(AUTO_CONFIG)
        File "C:\Users\<my username>\AppData\Local\Temp\pip-install-hgh7_enl\pygame_ae1f9026d2544baba0680df9ae3760e8\buildconfig\config.py", line 210, in main
          deps = CFG.main(**kwds)
                 ^^^^^^^^^^^^^^^^
        File "C:\Users\<my username>\AppData\Local\Temp\pip-install-hgh7_enl\pygame_ae1f9026d2544baba0680df9ae3760e8\buildconfig\config_win.py", line 576, in main
          and download_win_prebuilt.ask(**download_kwargs):
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\<my username>\AppData\Local\Temp\pip-install-hgh7_enl\pygame_ae1f9026d2544baba0680df9ae3760e8\buildconfig\download_win_prebuilt.py", line 302, in ask
          reply = raw_input(
                  ^^^^^^^^^^
      EOFError: EOF when reading a line
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
  1. Try to install optional dependencies, first pip install pyopengl-accelerate.

fails with error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/. I install that choosing Desktop development with c++, default options.

Now fails with:

Collecting pyopengl-accelerate
  Using cached PyOpenGL-accelerate-3.1.5.tar.gz (538 kB)
  Preparing metadata (setup.py) ... done
Installing collected packages: pyopengl-accelerate
  DEPRECATION: pyopengl-accelerate is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
  Running setup.py install for pyopengl-accelerate ... error
  error: subprocess-exited-with-error

  × Running setup.py install for pyopengl-accelerate did not run successfully.
  │ exit code: 1
  ╰─> [18 lines of output]
      running install
      C:\Program Files (x86)\Python311-32\Lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      creating build
      creating build\lib.win32-cpython-311
      creating build\lib.win32-cpython-311\OpenGL_accelerate
      copying OpenGL_accelerate\__init__.py -> build\lib.win32-cpython-311\OpenGL_accelerate
      running build_ext
      building 'OpenGL_accelerate.wrapper' extension
      creating build\temp.win32-cpython-311
      creating build\temp.win32-cpython-311\Release
      creating build\temp.win32-cpython-311\Release\src
      "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\bin\HostX86\x86\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD "-IC:\Users\<my username>\AppData\Local\Temp\pip-install-f4vnvoyv\pyopengl-accelerate_04cd8bce53164f6db785ef8b8cf55af4\.." "-IC:\Users\<my username>\AppData\Local\Temp\pip-install-f4vnvoyv\pyopengl-accelerate_04cd8bce53164f6db785ef8b8cf55af4\src" "-IC:\Users\<my username>\AppData\Local\Temp\pip-install-f4vnvoyv\pyopengl-accelerate_04cd8bce53164f6db785ef8b8cf55af4" "-IC:\Program Files (x86)\Python311-32\include" "-IC:\Program Files (x86)\Python311-32\Include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /Tcsrc\wrapper.c /Fobuild\temp.win32-cpython-311\Release\src\wrapper.obj
      wrapper.c
      src\wrapper.c(196): fatal error C1083: Cannot open include file: 'longintrepr.h': No such file or directory
      error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.34.31933\\bin\\HostX86\\x86\\cl.exe' failed with exit code 2
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> pyopengl-accelerate

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
  1. pip install pyaudio works fine.

  2. pip install gettext
    ERROR: Could not find a version that satisfies the requirement gettext (from versions: none)
    ERROR: No matching distribution found for gettext

  3. python setup.py build_ext --inplace --force
    error: Multiple top-level packages discovered in a flat-layout: ['pkg', 'svg', 'data', 'fofix', 'win32'].

To avoid accidental inclusion of unwanted files or directories,
setuptools will not proceed with this build.

If you are trying to create a single distribution with multiple packages
on purpose, you should not rely on automatic discovery.
Instead, consider the following options:

  1. set up custom discovery (find directive with include or exclude)
  2. use a src-layout
  3. explicitly set py_modules or packages with a list of names

To find more information, look for "package discovery" on setuptools docs.

  1. python FoFiX.py
    Traceback (most recent call last):
    File "C:\Users<my username>\Desktop\fofix-master\FoFiX.py", line 47, in
    import PIL.Image
    ModuleNotFoundError: No module named 'PIL'

  2. and just to see I tried pip install PIL
    ERROR: Could not find a version that satisfies the requirement PIL (from versions: none)
    ERROR: No matching distribution found for PIL

So that is as far as I got.
Thank you.

@HoM3r17
Copy link

HoM3r17 commented Jan 31, 2023

Hi, Same issue here, Windows 11 fresh install on a new PC, latest Python 3.11, dependencies installed, but i'm getting this :

PS D:\fofix-3.123\fofix-master> pip3 install -r requirements.txt
Collecting Cerealizer==0.8.3
  Using cached Cerealizer-0.8.3.tar.gz (12 kB)
  Preparing metadata (setup.py) ... done
Collecting numpy==1.16.6
  Using cached numpy-1.16.6.zip (5.1 MB)
  Preparing metadata (setup.py) ... done
Collecting olefile==0.46
  Using cached olefile-0.46.zip (112 kB)
  Preparing metadata (setup.py) ... done
Collecting Pillow==6.2.2
  Using cached Pillow-6.2.2.tar.gz (37.8 MB)
  Preparing metadata (setup.py) ... done
Collecting PyAudio==0.2.11
  Using cached PyAudio-0.2.11.tar.gz (37 kB)
  Preparing metadata (setup.py) ... done
Collecting pygame==1.9.6
  Using cached pygame-1.9.6.tar.gz (3.2 MB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [18 lines of output]


      WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
      Using WINDOWS configuration...


      Download prebuilts to "prebuilt_downloads" and copy to "./prebuilt-x64"? [Y/n]Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\fercv\AppData\Local\Temp\pip-install-howv3qq2\pygame_aee1a32f5531493faa3eb48c531fa776\setup.py", line 194, in <module>
          buildconfig.config.main(AUTO_CONFIG)
        File "C:\Users\fercv\AppData\Local\Temp\pip-install-howv3qq2\pygame_aee1a32f5531493faa3eb48c531fa776\buildconfig\config.py", line 210, in main
          deps = CFG.main(**kwds)
        File "C:\Users\fercv\AppData\Local\Temp\pip-install-howv3qq2\pygame_aee1a32f5531493faa3eb48c531fa776\buildconfig\config_win.py", line 576, in main
          and download_win_prebuilt.ask(**download_kwargs):
        File "C:\Users\fercv\AppData\Local\Temp\pip-install-howv3qq2\pygame_aee1a32f5531493faa3eb48c531fa776\buildconfig\download_win_prebuilt.py", line 302, in ask
          reply = raw_input(
      EOFError: EOF when reading a line
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

@Linkid
Copy link
Member

Linkid commented Feb 1, 2023

Hello.
@TheFatBastid @HoM3r17 : you are both using python 3. The game is not python 3 ready yet.
@HoM3r17 : you're trying to use python 3 to run fofix v3. This version is not python 3 compatible.
To run the v3, you need to use python2. The migration to python 3 is not ready yet for Windows due to some bugs with build.

@TheFatBastid
Copy link
Author

Thanks. Getting closer. I had to use pipwin to get pyaudio but videoplayer complains about not having pkg-config installed, which I couldn't figure out. Looks like a glib/gtk thing but couldn't get that to work.

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

No branches or pull requests

3 participants