cmake 获取bash:python命令找不到错误,即使我在我的macOS中使用zsh shell

hsvhsicv  于 9个月前  发布在  Python
关注(0)|答案(1)|浏览(83)

我正在尝试构建和安装此software所以,我做了这些步骤

# recursive repo cloning
git clone --recursive https://github.com/AcademySoftwareFoundation/OpenRV.git
# sourcing there scripts
source rvcmds.sh
# configure
cmake -B_build -H. -DCMAKE_BUILD_TYPE=Release -DRV_DEPS_QT5_LOCATION=/Users/macos/Qt/5.15.2/clang_64
# building
cmake --build _build --config Release -v --target main_executable

现在在构建过程中,我得到这个错误

OpenGL descriptors
--------------------------------------------------------------------
rm -rf extensions/gl
cp -r glfixes/gl/specs/ANGLE OpenGL-Registry/extensions
cp -r glfixes/gl/specs/REGAL OpenGL-Registry/extensions
bin/update_ext.sh extensions/gl OpenGL-Registry/extensions blacklist
--------------------------------------------------------------------
WGL descriptors
--------------------------------------------------------------------
rm -f extensions/gl/WGL_*
python bin/parse_xml.py OpenGL-Registry/xml/wgl.xml --api wgl --extensions extensions/gl
bash: python: command not found
make[4]: *** [extensions/gl/.dummy] Error 127
make[3]: *** [cmake/dependencies/RV_DEPS_GLEW-prefix/src/RV_DEPS_GLEW-stamp/RV_DEPS_GLEW-configure] Error 2
make[2]: *** [cmake/dependencies/CMakeFiles/RV_DEPS_GLEW.dir/all] Error 2
make[1]: *** [CMakeFiles/main_executable.dir/rule] Error 2
make: *** [main_executable] Error 2

因此,根据错误,我没有python,因为它说python命令未找到,所以我在我的.zprofile中做了什么,我设置了这样的别名alias python="python3",当我做python --version时,我得到了与python3 --version相同的结果,但由于cmake在bash shell中运行(出于某种未知原因),我得到了错误。
我甚至尝试将我的默认shell改为bash,并在那里添加别名,但cmake仍然出错。
我不知道如何解决这个问题,如果有人有任何关于这一点的想法,真的很感激。

4urapxun

4urapxun1#

我能想到的最简单的修复方法是在同一个文件夹中创建一个python3可执行文件的符号链接,并将其命名为python。
您可以通过运行以下命令来执行此操作:

ln -s $(which python3) $(dirname $(which python3))/python

相关问题