当前位置:网站首页>Troubleshooting the problem of pytorch geometric torch scatter and torch spark installation errors
Troubleshooting the problem of pytorch geometric torch scatter and torch spark installation errors
2022-06-30 21:37:00 【A big cat who wants to lie flat every day】
problem
In the installation torch-scatter、torch-sparse Waiting for a wrong report
Report errors subprocess.CalledProcessError: Command ‘[‘which‘, ‘g++‘]‘ returned non-zero exit status 1.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-56zzyn27/torch-sparse/setup.py", line 46, in <module>
packages=find_packages(),
File "/home/aha/anaconda3/envs/geo/lib/python3.6/site-packages/setuptools/__init__.py", line 153, in setup
return distutils.core.setup(**attrs)
File "/home/aha/anaconda3/envs/geo/lib/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/home/aha/anaconda3/envs/geo/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/home/aha/anaconda3/envs/geo/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/aha/anaconda3/envs/geo/lib/python3.6/site-packages/wheel/bdist_wheel.py", line 290, in run
self.run_command('build')
File "/home/aha/anaconda3/envs/geo/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/home/aha/anaconda3/envs/geo/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/aha/anaconda3/envs/geo/lib/python3.6/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/home/aha/anaconda3/envs/geo/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/home/aha/anaconda3/envs/geo/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/aha/anaconda3/envs/geo/lib/python3.6/site-packages/setuptools/command/build_ext.py", line 79, in run
_build_ext.run(self)
File "/home/aha/anaconda3/envs/geo/lib/python3.6/distutils/command/build_ext.py", line 339, in run
self.build_extensions()
File "/home/aha/anaconda3/envs/geo/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 232, in build_extensions
self._check_abi()
File "/home/aha/anaconda3/envs/geo/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 370, in _check_abi
check_compiler_abi_compatibility(compiler)
File "/home/aha/anaconda3/envs/geo/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 162, in check_compiler_abi_compatibility
if not check_compiler_ok_for_platform(compiler):
File "/home/aha/anaconda3/envs/geo/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 138, in check_compiler_ok_for_platform
which = subprocess.check_output(['which', compiler], stderr=subprocess.STDOUT)
File "/home/aha/anaconda3/envs/geo/lib/python3.6/subprocess.py", line 356, in check_output
**kwargs).stdout
File "/home/aha/anaconda3/envs/geo/lib/python3.6/subprocess.py", line 438, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['which', 'g++']' returned non-zero exit status 1.
----------------------------------------
ERROR: Failed building wheel for torch-sparse
Solution
step 1: install gcc and g++
This is because gcc and g++ No installation , You can install it with the following command
sudo apt-get install build-essential
Ubuntu By default , It didn't provide C/C++ Compiler environment for , Therefore, manual installation is also required . If installed separately gcc as well as g++ More trouble , Fortunately, , To be able to compile Ubuntu The kernel of ,Ubuntu Provides a build-essential software package .
Installation completed , Some users re execute pip Command to install scatter and sparse That's all right. , But I have a problem again .
step 2: solve torch_scatter Installation version problem
Let's start with the solution , Is to specify in the installation command torch_scatter Version of pip install torch-scatter==2.0.6 -f https://data.pyg.org/whl/torch-1.6.0+cu101.html
You can use only pip install torch-scatter==2.0.6
Let's talk about the process of solving the problem :
First, I run the following commands under the guidance of the official website :pip install -f https://data.pyg.org/whl/torch-1.6.0+cu101.html
An error has occurred , Some error reports are as follows :
csrc/scatter.cpp:135:30: error: no matching function for call to ‘at::Tensor::div_(at::Tensor&, const char [6])’
out.div_(count, "floor");
^
In file included from /opt/conda/lib/python3.7/site-packages/torch/include/ATen/Tensor.h:3:0,
from /opt/conda/lib/python3.7/site-packages/torch/include/ATen/Context.h:4,
from /opt/conda/lib/python3.7/site-packages/torch/include/ATen/ATen.h:5,
from /opt/conda/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/types.h:3,
from /opt/conda/lib/python3.7/site-packages/torch/include/torch/script.h:3,
from csrc/scatter.cpp:2:
/opt/conda/lib/python3.7/site-packages/torch/include/ATen/core/TensorBody.h:649:12: note: candidate: at::Tensor& at::Tensor::div_(const at::Tensor&) const
Tensor & div_(const Tensor & other) const;
^~~~
/opt/conda/lib/python3.7/site-packages/torch/include/ATen/core/TensorBody.h:649:12: note: candidate expects 1 argument, 2 provided
/opt/conda/lib/python3.7/site-packages/torch/include/ATen/core/TensorBody.h:651:12: note: candidate: at::Tensor& at::Tensor::div_(c10::Scalar) const
Tensor & div_(Scalar other) const;
^~~~
/opt/conda/lib/python3.7/site-packages/torch/include/ATen/core/TensorBody.h:651:12: note: candidate expects 1 argument, 2 provided
error: command 'gcc' failed with exit status 1
Take a closer look at this command. At the beginning, the execution is :
That is, trying to install torch_scatter 2.0.9 edition .
however , When I go to the combination given on the official website , I found that my system should not use 2.0.9 edition
https://data.pyg.org/whl/
Click... In the above link torch-1.6.0+cu101
List the following torch_scatter edition 
The highest is 2.0.6 edition , according to 2.0.9 The version does not match my system , Therefore, an error is reported . As for why this happens , I don't know . But we can specify torch_scatter To solve the problem .pip install torch-scatter==2.0.6 -f https://data.pyg.org/whl/torch-1.6.0+cu101.html
Refer to the post :
https://blog.csdn.net/klarclm/article/details/8550931
https://blog.csdn.net/Iv_zzy/article/details/109310965
边栏推荐
- 1-3 使用SQL管理数据库
- mysql-批量更新
- Ten security measures against unauthorized access attacks
- jenkins下载插件下载不了,解决办法
- Multi table operation - foreign key constraint
- jupyterbook 清空控制台输出
- 根据肠道微生物组重新思考健康饮食
- ArcGIS construction and release of simple road network data service and rest call test
- Can flinksql two Kafka streams join?
- Zaah Sultan looks at the old driver
猜你喜欢

Adobe Photoshop (PS) - script development - remove file bloated script
![[untitled]](/img/42/47a8c8faaed33a1d9e864cb2ef7b72.png)
[untitled]

Introduction of 3D Max fine model obj model into ArcGIS pro (II) key points supplement

根据肠道微生物组重新思考健康饮食

PyTorch量化实践(1)

興奮神經遞質——穀氨酸與大腦健康
Testing media cache

AKK菌——下一代有益菌

It is urgent for enterprises to protect API security

Why have the intelligent investment advisory products collectively taken off the shelves of banks become "chicken ribs"?
随机推荐
1-3 using SQL to manage databases
你我他是谁
申请Vector 总线协议彩图壁纸挂画,非常棒哦!
PyTorch量化感知训练(QAT)步骤
AKK菌——下一代有益菌
Analysis and proposal on the "sour Fox" vulnerability attack weapon platform of the US National Security Agency
1-3 使用SQL管理数据库
1-12 preliminary understanding of Express
興奮神經遞質——穀氨酸與大腦健康
A small step in code change and a big leap in thinking
本地浏览器打开远程服务器上的Jupyter Notebook/Lab以及常见问题&设置
Text recognition svtr paper interpretation
“信任机器”为发展赋能
SQL server extracts pure numbers from strings
FreeRTOS record (IX. an example of a bare metal project transferring to FreeRTOS)
Why have the intelligent investment advisory products collectively taken off the shelves of banks become "chicken ribs"?
1-10 根据不同的url响应客户端的内容
Two skylines
mysql-批量更新
asp. Net core JWT delivery