pycharm subprocess.CalledProcessError:命令“['which','c++']”返回非零退出状态1

f0brbegy  于 2023-08-05  发布在  PyCharm
关注(0)|答案(1)|浏览(321)

请帮帮我,我已经困惑了两天了。

File "/data/ywj/Anaconda3/envs/torch/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 252, in check_compiler_abi_compatibility
if not check_compiler_ok_for_platform(compiler):
File "/data/ywj/Anaconda3/envs/torch/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 212, in check_compiler_ok_for_platform
which = subprocess.check_output(['which', compiler], stderr=subprocess.STDOUT)
File "/data/ywj/Anaconda3/envs/torch/lib/python3.6/subprocess.py", line 356, in check_output
**kwargs).stdout
File "/data/ywj/Anaconda3/envs/torch/lib/python3.6/subprocess.py", line 438, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['which', 'c++']' returned non-zero exit status 1.
Process finished with exit code 0

字符串
我已经在/data/ywj/gcc 73/gcc 73安装了gcc/g++7.3.0(非root)
我在服务器上运行这个程序时没有这个错误,但是当我远程连接到服务器并在Pycharm中运行这个程序时,我得到了这个错误。

lg40wkob

lg40wkob1#

我猜你正在构建或安装一些软件包。
首先,尝试通过以下方式获取g++的版本:g++ --version的。

Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

字符串
然后,在构建命令中添加前缀CXX=g++-9 CC=gcc-9 LD=g++-9,例如:

CXX=g++-9 CC=gcc-9 LD=g++-9 pip install xxxx


请注意,9表示您的g++版本。

相关问题