Openage: No suitable Python interpreter found. Windows 10 Command Prompt

Created on 19 Dec 2017  路  26Comments  路  Source: SFTtech/openage

Help! I get this error!!!

| |  \____ \|  ___)    | |    | |   / _ \|  _ \| ___ |  _ \(____ |/ _  | ___ |
| |_ _____) ) |        | |   _| |  | |_| | |_| | ____| | | / ___ ( (_| | ____|
|___|______/|_|        |_|  (___|   \___/|  __/|_____)_| |_\_____|\___ |_____)
                                         |_|                     (_____|

Welcome to the SFT technologies computer-aided openage build system!

You have chosen, or been chosen, to attempt the daring task of building openage.
If you have installed all the dependencies that are conveniently listed in
[doc/building.md], this _might_ just work!

If it doesn't, consider reporting the issue/asking for help in #sfttech on freenode.net.

CMake Warning at buildsystem/HandleCXXOptions.cmake:82 (message):
  Using untested compiler, at least I hope it's free software.  Continue on
  your own, warrior.
Call Stack (most recent call first):
  CMakeLists.txt:111 (include)


No suitable Python interpreter found.
We need an interpreter that is shipped with libpython and header files.
Specify your own with -DPYTHON=/path/to/executable



CMake Error at cmake-3.10.0-win32-x86/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find Python (missing: PYTHON PYTHON_INCLUDE_DIRS
  PYTHON_LIBRARIES) (Required is at least version "3.4")
Call Stack (most recent call first):
  cmake-3.10.0-win32-x86/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  buildsystem/modules/FindPython.cmake:231 (find_package_handle_standard_args)
  C:/Users/Ryan/Desktop/VCPKG/vcpkg-master/scripts/buildsystems/vcpkg.cmake:211 (_find_package)
  buildsystem/HandlePythonOptions.cmake:6 (find_package)
  CMakeLists.txt:113 (include)


-- Configuring incomplete, errors occurred!
See also "C:/Users/Ryan/Desktop/SFTtech-openage-fb4a9eb/build/CMakeFiles/CMakeOutput.log".

C:\Users\Ryan\Desktop\SFTtech-openage-fb4a9eb\build>

How do I fix it??!!

buildsystem question windows

Most helpful comment

First of all, please don't make so many posts and use the edit function :D Second, please surround terminal output with ``` . Example:
```
Terminal output
```

Looks like this:

Terminal output

Now for your problem, please do the following steps:

  1. Open the command prompt and just type python into the console. There should be an interpreter showing the version number. If the interpreter doesn't appear or shows a version number smaller than 3.4, something is wrong with PATH.
  2. If everything from step 1 is okay, try the solution from the error message: Specify the python path yourself by using -DPYTHON=/path/to/executable.
  3. If you still get the same error, something is likely wrong with python. Reinstall it and make sure, you have selected all the checkboxes needed.

edit by @TheJJ: I enclosed all your codeblocks with ``` now.

All 26 comments

It looks like python is either not installed or not in %PATH%. A few more infos would be helpful:

  • Have you followed the official build procedure?
  • Which python version do you have installed? Is python added to %PATH%?

I have 3.6.3 installed, I do have it in the path (I think so). I am using windows 10. I have also followed the build procedure.... I cannot get past a few bumps... I cannot get past building openage with cmake. I always get this error. Everything else before that, however, is fine.

I have spent like 2 days on this...

I do have it in the path (I think so)

Can you check (run where python in a cmd)?

Ok

Python is at

C:\Users\Ryan\AppData\Local\Programs\Python\Python36\python.exe

Also, when using vcpkg, I get Error: Building package qt5:x86-windows failed with: BUILD_FAILED

Now, on the thing I had first, I get

LINK : fatal error LNK1104: cannot open file 'python36_d.lib' [C:\Users\Ryan\Desktop\SFTtech-openage-fb4a9eb\build\CMakeFiles\CMakeTmp\cmTC_54716.vcxproj

And I still get

"C:\Users\Ryan\Desktop\SFTtech-openage-fb4a9eb\build\CMakeFiles\CMakeTmp\cmTC_54716.vcxproj" (default target) (1) ->
(Link target) ->
  LINK : fatal error LNK1104: cannot open file 'python36_d.lib' [C:\Users\Ryan\Desktop\SFTtech-openage-fb4a9eb\build\CMakeFiles\CMakeTmp\cmTC_54716.vcxproj]

    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:03.17



No suitable Python interpreter found.
We need an interpreter that is shipped with libpython and header files.
Specify your own with -DPYTHON=/path/to/executable



CMake Error at cmake-3.10.0-win32-x86/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find Python (missing: PYTHON PYTHON_INCLUDE_DIRS
  PYTHON_LIBRARIES) (Required is at least version "3.4")
Call Stack (most recent call first):
  cmake-3.10.0-win32-x86/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  buildsystem/modules/FindPython.cmake:231 (find_package_handle_standard_args)
  C:/Users/Ryan/Desktop/VCPKG/vcpkg-master/scripts/buildsystems/vcpkg.cmake:211 (_find_package)
  buildsystem/HandlePythonOptions.cmake:6 (find_package)
  CMakeLists.txt:113 (include)


-- Configuring incomplete, errors occurred!
See also "C:/Users/Ryan/Desktop/SFTtech-openage-fb4a9eb/build/CMakeFiles/CMakeOutput.log".

From the looks of things, it can find every file but python36_d.lib

Even all the other .lib files... Why?

First of all, please don't make so many posts and use the edit function :D Second, please surround terminal output with ``` . Example:
```
Terminal output
```

Looks like this:

Terminal output

Now for your problem, please do the following steps:

  1. Open the command prompt and just type python into the console. There should be an interpreter showing the version number. If the interpreter doesn't appear or shows a version number smaller than 3.4, something is wrong with PATH.
  2. If everything from step 1 is okay, try the solution from the error message: Specify the python path yourself by using -DPYTHON=/path/to/executable.
  3. If you still get the same error, something is likely wrong with python. Reinstall it and make sure, you have selected all the checkboxes needed.

edit by @TheJJ: I enclosed all your codeblocks with ``` now.

wait

I have everything working now

EXCEPT THIS ERROR::::

  FindPython_test.obj : error LNK2019: unresolved external symbol __imp__Py_Initialize referenced in function _main [C:\SFTtech-openage-fb4a9eb\build\CMakeFiles\CMakeTmp\cmTC_15a81.vcxproj]
  FindPython_test.obj : error LNK2019: unresolved external symbol __imp__Py_Finalize referenced in function _main [C:\SFTtech-openage-fb4a9eb\build\CMakeFiles\CMakeTmp\cmTC_15a81.vcxproj]
  C:\SFTtech-openage-fb4a9eb\build\CMakeFiles\CMakeTmp\Debug\cmTC_15a81.exe : fatal error LNK1120: 2 unresolved externals [C:\SFTtech-openage-fb4a9eb\build\CMakeFiles\CMakeTmp\cmTC_15a81.vcxproj]

The rest is basically the same.
I will, by the way, almost automatically reply...

All programs are working, but the error::

  FindPython_test.obj : error LNK2019: unresolved external symbol __imp__Py_Initialize referenced in function _main [C:\SFTtech-openage-fb4a9eb\build\CMakeFiles\CMakeTmp\cmTC_15a81.vcxproj]
  FindPython_test.obj : error LNK2019: unresolved external symbol __imp__Py_Finalize referenced in function _main [C:\SFTtech-openage-fb4a9eb\build\CMakeFiles\CMakeTmp\cmTC_15a81.vcxproj]
  C:\SFTtech-openage-fb4a9eb\build\CMakeFiles\CMakeTmp\Debug\cmTC_15a81.exe : fatal error LNK1120: 2 unresolved externals [C:\SFTtech-openage-fb4a9eb\build\CMakeFiles\CMakeTmp\cmTC_15a81.vcxproj]

Sorry, I did not see the beginning of your last comment...

  FindPython_test.obj : error LNK2019: unresolved external symbol __imp__Py_Initialize referenced in function _main [C:\SFTtech-openage-fb4a9eb\build\CMakeFiles\CMakeTmp\cmTC_15a81.vcxproj]
  FindPython_test.obj : error LNK2019: unresolved external symbol __imp__Py_Finalize referenced in function _main [C:\SFTtech-openage-fb4a9eb\build\CMakeFiles\CMakeTmp\cmTC_15a81.vcxproj]
  C:\SFTtech-openage-fb4a9eb\build\CMakeFiles\CMakeTmp\Debug\cmTC_15a81.exe : fatal error LNK1120: 2 unresolved externals [C:\SFTtech-openage-fb4a9eb\build\CMakeFiles\CMakeTmp\cmTC_15a81.vcxproj]

Please, I beg you, use the Edit function. Github is not a chat. You're making it harder for all of us to spot your problem. Also, use ``` (accent grave) not ''' (apostrophe) for surrounding code/output.

Looks like there's still a problem with finding python. This time, it can't find some of the libraries for some reason. I guess something faulty happened during the Python installation..

Sorry for the late reply, I have Advanced Geometry Exams tomorrow...,

No, Command Prompt Knows Where Python is!!

Proof:

C:\SFTtech-openage-fb4a9eb\build>where python
C:\Program Files\Python36\python.exe

C:\SFTtech-openage-fb4a9eb\build>where cmake
C:\Program Files\CMake\bin\cmake.exe

@ryandakid, looks like you're missing the debug library python36_d.lib and possibly its dll.
Please run the python installer (again) and check the debug binaries option.

Also, all-the-best for your Advanced Geometry exams. 馃憤

Sorry, but reinstalling it did not work. I still get the same error!

Can you tell me where the computer expects the files for python are supposed to be?

Thanks for the good luck, though!

Please Help!!!!

The library should be in <python_install_dir>/libs.

Did you clear the CMake cache after reinstalling? If not, please delete CMakeCache.txt and CMakeFiles/ from the build directory.

If you still face the issue, please share the regenerated CMakeCache.txt.

Ok. Got everything working but one thing. How do I get opusenc working with my computer? Where do I put the tools files?

Where do I put it and which file from https://archive.mozilla.org/pub/opus/win32/ do I download, I mean?

You should get the latest opus-tools zip. As of this writing, it is opus-tools-0.1.10-win32.zip.

From that, you need opusenc.exe available in your PATH.
To see the directories in your PATH, use echo %PATH% on a command prompt. You can choose any one that you deem safe to write in.
Alternatively you can add the original location to the environment variable.

Ok, I am getting a new error:

-- Using python interpreter: C:/Program Files (x86)/Python36-32/python.exe
Traceback (most recent call last):
  File "C:\Program Files (x86)\Python36-32\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Program Files (x86)\Python36-32\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\SFTtech-openage-fb4a9eb\openage\__main__.py", line 133, in <module>
    sys.exit(main())
  File "C:\SFTtech-openage-fb4a9eb\openage\__main__.py", line 83, in main
    from .convert.main import init_subparser
  File "C:\SFTtech-openage-fb4a9eb\openage\convert\main.py", line 7, in <module>
    import readline  # pylint: disable=unused-import
ModuleNotFoundError: No module named 'readline'
CMake Error at buildsystem/codegen.cmake:25 (message):
  failed to get target list from codegen invocation
Call Stack (most recent call first):
  libopenage/CMakeLists.txt:54 (codegen_run)


-- Configuring incomplete, errors occurred!
See also "C:/SFTtech-openage-fb4a9eb/build/CMakeFiles/CMakeOutput.log".

We can continue the conversation for the last update in #946.

Please keep this issue open until the MSVC build instructions are updated to reflect the learning here.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ShadowCreator picture ShadowCreator  路  3Comments

samuelgrigolato picture samuelgrigolato  路  4Comments

TheJJ picture TheJJ  路  6Comments

Vtec234 picture Vtec234  路  8Comments

ghost picture ghost  路  6Comments