当前位置:网站首页>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
边栏推荐
- vim 常用快捷键
- 1-14 express managed static resources
- 1-19 using CORS to solve interface cross domain problems
- ca i啊几次哦啊句iu家哦11111
- Auto-created primary key used when not defining a primary key
- What happens when word encounters an error while trying to open a file?
- Side sleep ha ha ha
- 1-15 nodemon
- ceshi deces
- 1-12 初步认识Express
猜你喜欢

Double solid histogram / double y-axis

ArcGIS construction and release of simple road network data service and rest call test

Deployment and use of Nacos

Usbcan analyzer's supporting can and canfd comprehensive test software lkmaster software solves engineers' can bus test problems

AKK菌——下一代有益菌

Nacos部署及使用

漫谈Clickhouse Join

PyTorch量化实践(1)

clickhouse原生监控项,系统表描述

介绍一款|用于多组学整合和网络可视化分析的在线平台
随机推荐
1-13 express监听GET和POST请求&处理请求
asp.net core JWT传递
银行集体下架的智能投顾产品,为何成了“鸡肋”?
Arcmap|assign values to different categories of IDS with the field calculator
A small step in code change and a big leap in thinking
Clickhouse Native Monitoring item, System table Description
jupyter notebook/lab 切换conda环境
1-7 path module
1-19 利用CORS解决接口跨域问题
对多态的理解
Export El table as is to excel table
Can flinksql two Kafka streams join?
PyTorch量化感知训练(QAT)步骤
Electronic scheme development - Intelligent rope skipping scheme
1-20 pre inspection request
漫谈Clickhouse Join
Clickhouse distributed table engine
Phoenix architecture: an architect's perspective
Testing media cache
用yml文件进行conda迁移环境时的报错小结