当前位置:网站首页>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
边栏推荐
- Usbcan analyzer's supporting can and canfd comprehensive test software lkmaster software solves engineers' can bus test problems
- ArcGIS construction and release of simple road network data service and rest call test
- Apply for vector bus protocol color picture wallpaper hanging picture, very good!
- pytorch geometric torch-scatter和torch-sparse安装报错问题解决
- vim 常用快捷键
- 测试媒资缓存问题
- Side sleep ha ha ha
- 你我他是谁
- Double solid histogram / double y-axis
- 《Dynamic Routing Between Capsules》论文学习总结
猜你喜欢

Ten security measures against unauthorized access attacks

PyTorch量化实践(2)

申请Vector 总线协议彩图壁纸挂画,非常棒哦!

Text recognition svtr paper interpretation

Icml2022 | utility theory of sequential decision making

介绍一款|用于多组学整合和网络可视化分析的在线平台

Reading notes of Clickhouse principle analysis and Application Practice (3)

What about degradation of text generation model? Simctg tells you the answer

How to move forward when facing confusion in scientific research? How to give full play to women's advantages in scientific research?

网络营销之四大误解
随机推荐
Dm8: generate DM AWR Report
1-12 preliminary understanding of Express
Sqlserver string type converted to decimal or integer type
1-1 basic concepts of database
1-14 express托管静态资源
. NETCORE redis geo type
Is it safe to open an account for stock trading on mobile phones?
Text recognition svtr paper interpretation
模板方法模式介绍与示例
【回溯】全排列 leetcode46
Encryption and decryption and the application of OpenSSL
Icml2022 | utility theory of sequential decision making
1-16 路由的概念
Two skylines
Internet of things botnet gafgyt family and backdoor vulnerability exploitation of Internet of things devices
clickhouse原生監控項,系統錶描述
What about degradation of text generation model? Simctg tells you the answer
How to run jenkins build, in multiple servers with ssh-key
网络营销之四大误解
Auto-created primary key used when not defining a primary key