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

Boost.Python can not find python on windows if path contains spaces #729

Open
Grantim opened this issue Jul 7, 2021 · 1 comment
Open
Labels

Comments

@Grantim
Copy link

Grantim commented Jul 7, 2021

This issue was mentioned here, when building boost.python with numpy.
Everything is ok if python is installed in path without spaces, and it does not find system python (and thereafter numpy) if spaces are present in the path. So attached file can be applied as patch (mb it is not the best fix, but still works, please have a look).

I faced this issue on boost version 1.75.0

@pavel-machyniak
Copy link

I have the same issue with current boost 1.80.
I just need to build the boost libraries on Windows (using vc143) and choose correct python interpreter.
I have 32-bit python installed in standard location:
C:\Program Files (x86)\Python310-32
There is no python configured on system path nor in system variables.
I bootstrap the boost and enter python configuration either to project-config.jam or to tools\build\src\user-config.jam or tools\build\src\site-config.jam:

using python : : "C:/Program Files (x86)/Python310-32/python.exe" ;

or:

using python : : "C:\\Program Files (x86)\\Python310-32\\python.exe" ;

Result:

notice: [python-cfg] Configuring python...
notice: [python-cfg]   user-specified cmd-or-prefix: "C:/Program Files (x86)/Python310-32/python.exe"
notice: [python-cfg] Checking interpreter command "C:/Program Files (x86)/Python310-32/python.exe"...
notice: [python-cfg] running command 'DIR /-C /A:S "C:\Program Files (x86)\Python310-32\python.exe" 2>&1'
notice: [python-cfg] running command 'C:/Program Files (x86)/Python310-32/python.exe -c "from sys import *; print('version=%d.%d\nplatform=%s\nprefix=%s\nexec_prefix=%s\nexecutable=%s' % (version_info[0],version_info[1],platform,prefix,exec_prefix,executable))" 2>&1'
notice: [python-cfg] ...does not invoke a working interpreter

Note that:

  • configuration and path is picked up correctly
  • interpreter command is checked correctly
  • but when running python script via command line parameter, interpreter is run incorrectly without "", so it is probably trying to run C:/Program

That being said, there is definitely problem with spaces in the path. When I change the setting to ancient 8.3 compatibility format:

using python : : c:/PROGRA~2/PYTHON~1/python.exe ;

Then it runs correctly:

notice: [python-cfg] Configuring python...
notice: [python-cfg]   user-specified cmd-or-prefix: "c:/PROGRA~2/PYTHON~1/python.exe"
notice: [python-cfg] Checking interpreter command "c:/PROGRA~2/PYTHON~1/python.exe"...
notice: [python-cfg] running command 'DIR /-C /A:S "C:\Program Files (x86)\Python310-32\python.exe" 2>&1'
notice: [python-cfg] running command 'c:/PROGRA~2/PYTHON~1/python.exe -c "from sys import *; print('version=%d.%d\nplatform=%s\nprefix=%s\nexec_prefix=%s\nexecutable=%s' % (version_info[0],version_info[1],platform,prefix,exec_prefix,executable))" 2>&1'
notice: [python-cfg] ...requested configuration matched!
notice: [python-cfg] Details of this Python configuration:
notice: [python-cfg]   interpreter command: "c:/PROGRA~2/PYTHON~1/python.exe"
notice: [python-cfg]   include path: "c:\PROGRA~2\PYTHON~1\Include"
notice: [python-cfg]   library path: "c:\PROGRA~2\PYTHON~1\libs"
notice: [python-cfg]   DLL search path: "c:\PROGRA~2\PYTHON~1"

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

No branches or pull requests

2 participants