SFTtech / SFTtech/openage

Files are missing in win packages after reorganization of Python.cmake

Open
#1,225 13 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area: buildsystem bug os: windows packaging
Dominant language
Python
Stars
14.4k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

I am not properly sure if this is the correct place to put this as it says to open an issue on the numpy page, yet I assume it is something to do with the way openage is being packaged on the windows nightly builds. When I downloaded the latest build, the Zip wouldn't open in Windows File Explorer:
Windows File Explorer Error
So I unzipped it with 7zip and ran openage.bat and got the following error:

>openage.bat
Traceback (most recent call last):
  File "C:\Users\black\Downloads\openage\python\numpy\core\__init__.py", line 24, in <module>
    from . import multiarray
  File "C:\Users\black\Downloads\openage\python\numpy\core\multiarray.py", line 14, in <module>
    from . import overrides
  File "C:\Users\black\Downloads\openage\python\numpy\core\overrides.py", line 7, in <module>
    from numpy.core._multiarray_umath import (
ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "runpy.py", line 192, in _run_module_as_main
  File "runpy.py", line 85, in _run_code
  File "C:\Users\black\Downloads\openage\python\openage\__main__.py", line 136, in <module>
    sys.exit(main())
  File "C:\Users\black\Downloads\openage\python\openage\__main__.py", line 88, in main
    from .convert.singlefile import init_subparser
  File "C:\Users\black\Downloads\openage\python\openage\convert\singlefile.py", line 11, in <module>
    from .texture import Texture
  File "C:\Users\black\Downloads\openage\python\openage\convert\texture.py", line 8, in <module>
    import numpy
  File "C:\Users\black\Downloads\openage\python\numpy\__init__.py", line 142, in <module>
    from . import core
  File "C:\Users\black\Downloads\openage\python\numpy\core\__init__.py", line 54, in <module>
    raise ImportError(msg)
ImportError:

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy c-extensions failed.
- Try uninstalling and reinstalling numpy.
- If you have already done that, then:
  1. Check that you expected to use Python3.8 from "C:\Users\black\Downloads\openage\python\python.exe",
     and that you have no directories in your PATH or PYTHONPATH that can
     interfere with the Python and numpy version "1.18.2" you're trying to use.
  2. If (1) looks fine, you can open a new issue at
     https://github.com/numpy/numpy/issues.  Please include details on:
     - how you installed Python
     - how you installed numpy
     - your operating system
     - whether or not you have multiple versions of Python installed
     - if you built from source, your compiler versions and ideally a build log

- If you're working with a numpy git repository, try `git clean -xdf`
  (removes all files not under version control) and rebuild numpy.

Note: this error has many possible causes, so please don't comment on
an existing issue about this - open a new one instead.

Original error was: No module named 'numpy.core._multiarray_umath'

I thought maybe it was just the Zipped version of the AMD64 build so I tried the 7z version and got the same error and then as a last resort I tried out the x86 build and got the error, but I assume this is just because I don't have a 32 bit system:

>openage.bat
Traceback (most recent call last):
  File "runpy.py", line 192, in _run_module_as_main
  File "runpy.py", line 85, in _run_code
  File "C:\Users\black\Downloads\openage-v0.4.0-98-geb8b8e9e-x86-portable_NIGHTLY\python\openage\__main__.py", line 136, in <module>
    sys.exit(main())
  File "C:\Users\black\Downloads\openage-v0.4.0-98-geb8b8e9e-x86-portable_NIGHTLY\python\openage\__main__.py", line 129, in main
    return args.entrypoint(args, cli.error)
  File "C:\Users\black\Downloads\openage-v0.4.0-98-geb8b8e9e-x86-portable_NIGHTLY\python\openage\game\main.py", line 32, in main
    from .main_cpp import run_game
ImportError: DLL load failed while importing main_cpp: The specified module could not be found.

Then, to try and remedy the fact numpy wasn't working, I downloaded get-pip.py and ran > python\python.exe get-pip.py, it said it installed so I then ran > python\Scripts\pip.exe install numpy and it gave me the error: ModuleNotFoundError: No module named 'pip'.
So I installed numpy on my computer and copied all the files in C:\Program Files\Python38\Lib\site-packages\numpy into openage\python\numpy. This resulted in me getting the error:

Traceback (most recent call last):
  File "runpy.py", line 192, in _run_module_as_main
  File "runpy.py", line 85, in _run_code
  File "C:\Users\black\Downloads\openage\python\openage\__main__.py", line 136, in <module>
    sys.exit(main())
  File "C:\Users\black\Downloads\openage\python\openage\__main__.py", line 88, in main
    from .convert.singlefile import init_subparser
  File "C:\Users\black\Downloads\openage\python\openage\convert\singlefile.py", line 11, in <module>
    from .texture import Texture
  File "C:\Users\black\Downloads\openage\python\openage\convert\texture.py", line 10, in <module>
    from PIL import Image
  File "C:\Users\black\Downloads\openage\python\PIL\Image.py", line 69, in <module>
    from . import _imaging as core
ImportError: cannot import name '_imaging' from 'PIL' (C:\Users\black\Downloads\openage\python\PIL\__init__.py)

And on using the same approach with PIL, I got the error:

Traceback (most recent call last):
  File "runpy.py", line 192, in _run_module_as_main
  File "runpy.py", line 85, in _run_code
  File "C:\Users\black\Downloads\openage\python\openage\__main__.py", line 136, in <module>
    sys.exit(main())
  File "C:\Users\black\Downloads\openage\python\openage\__main__.py", line 129, in main
    return args.entrypoint(args, cli.error)
  File "C:\Users\black\Downloads\openage\python\openage\game\main.py", line 32, in main
    from .main_cpp import run_game
ModuleNotFoundError: No module named 'openage.game.main_cpp'

At this point I was stumped, hope one of you can fix this.

Thanks a lot in advance,
James

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with Python.cmake and the Windows nightly packaging configuration, then trace the files included in the generated ZIP and 7z packages. Use openage.bat and the reported NumPy, PIL, and openage.game.main_cpp import failures as checks; done means the Windows packages open and launch without these missing-file or module errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, python
Domain
build-system, release
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.