Path of python contains space
MiaoSonglin opened this issue · 3 comments
Hi Ian, I encountered an error when generating the header files. Below is what I got:
... [100%] About to build the REFPROP.h header file w/ E:/Program Files/Scoop/apps/python311/current/python.exe;-u;E:/Workspace/cpp/projects/refprop/REFPROP-cmake/externals/REFPROP-headers/generate_header.py;--FORTRAN-path;E:/Workspace/cpp/projects/refprop/REFPROP-cmake/FORTRAN;--python-exe;E:/Program Files/Scoop/apps/python311/current/python.exe Writing the .pyf file with numpy.f2py, please be patient... About to run: E:/Program Files/Scoop/apps/python311/current/python.exe -m numpy.f2py --quiet --no-lower -h REFPROP.pyf E:/Workspace/cpp/projects/refprop/REFPROP-cmake/FORTRAN\PASS_FTN.FOR 'E:/Program' is not recognized as an internal or external command, operable program or batch file. Traceback (most recent call last): File "E:\Workspace\cpp\projects\refprop\REFPROP-cmake\externals\REFPROP-headers\generate_header.py", line 183, in <module> generate_interface_file(valid_paths[0], 'REFPROP.pyf', python_exe = args.python_exe[0]) File "E:\Workspace\cpp\projects\refprop\REFPROP-cmake\externals\REFPROP-headers\generate_header.py", line 14, in generate_interface_file print('numpy version:', subprocess.check_output(' '.join([python_exe,'-c','"import numpy; print(numpy.__version__)"']), shell=True).strip().decode('ascii')) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\Program Files\Scoop\apps\python311\current\Lib\subprocess.py", line 466, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\Program Files\Scoop\apps\python311\current\Lib\subprocess.py", line 571, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command 'E:/Program Files/Scoop/apps/python311/current/python.exe -c "import numpy; print(numpy.__version__)"' returned non-zero exit status 1. mingw32-make[2]: *** [CMakeFiles\REFPROP_H.dir\build.make:72: REFPROP.h.stamp] Error 1 mingw32-make[1]: *** [CMakeFiles\Makefile2:110: CMakeFiles/REFPROP_H.dir/all] Error 2 mingw32-make: *** [Makefile:90: all] Error 2
This error seems to be because my path of python contains spaces. Could you fix it?
Best solution is to have your python somewhere without spaces. Alternatively, you can change the call to enclose the command in " "
That works! Thank you so much! :)