I have been trying to get detectron2 installed on my ubuntu WSL instance for 3 weeks. i have followed countless posts and documentations from the official websites.
I have gone through my error messages line by line and looked for missing packages.
I am out of ideas, here is my my list of packages that have been installed in linux and pip: If anyone has any ideas please help me out. i am at the point where trying to learn a new skill is becoming way way too much effort.
After installing all required packages i still get the following errors:
nstalling collected packages: detectron2
Running setup.py develop for detectron2 error: subprocess-exited-with-error
python setup.py develop did not run successfully.
exit code: 1
98 lines of output]
running develop
/home/goat/ocr/lib/python3.10/site-packages/setuptools/command/easy_install.py:158: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
/home/goat/ocr/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running egg_info
writing detectron2.egg-info/PKG-INFO
writing dependency_links to detectron2.egg-info/dependency_links.txt
writing requirements to detectron2.egg-info/requires.txt
writing top-level names to detectron2.egg-info/top_level.txt
reading manifest file 'detectron2.egg-info/SOURCES.txt'
adding license file 'LICENSE'
writing manifest file 'detectron2.egg-info/SOURCES.txt'
running build_ext
/home/goat/ocr/lib/python3.10/site-packages/torch/utils/cpp_extension.py:424: UserWarning: There are no x86_64-linux-gnu-g++ version bounds defined for CUDA version 11.8
warnings.warn(f'There are no {compiler_name} version bounds defined for CUDA version {cuda_str_version}')
building 'detectron2._C' extension
Emitting ninja build file /home/goat/ocr/detectron2/build/temp.linux-x86_64-3.10/build.ninja...
Compiling objects...
Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
[1/2] c++ -MMD -MF /home/goat/ocr/detectron2/build/temp.linux-x86_64-3.10/home/goat/ocr/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.o.d -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DWITH_CUDA -I/home/goat/ocr/detectron2/detectron2/layers/csrc -I/home/goat/ocr/lib/python3.10/site-packages/torch/include -I/home/goat/ocr/lib/python3.10/site-packages/torch/include/torch/csrc/api/include -I/home/goat/ocr/lib/python3.10/site-packages/torch/include/TH -I/home/goat/ocr/lib/python3.10/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/goat/ocr/include -I/usr/include/python3.10 -c -c /home/goat/ocr/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.cpp -o /home/goat/ocr/detectron2/build/temp.linux-x86_64-3.10/home/goat/ocr/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.o -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++17
FAILED: /home/goat/ocr/detectron2/build/temp.linux-x86_64-3.10/home/goat/ocr/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.o
c++ -MMD -MF /home/goat/ocr/detectron2/build/temp.linux-x86_64-3.10/home/goat/ocr/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.o.d -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DWITH_CUDA -I/home/goat/ocr/detectron2/detectron2/layers/csrc -I/home/goat/ocr/lib/python3.10/site-packages/torch/include -I/home/goat/ocr/lib/python3.10/site-packages/torch/include/torch/csrc/api/include -I/home/goat/ocr/lib/python3.10/site-packages/torch/include/TH -I/home/goat/ocr/lib/python3.10/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/goat/ocr/include -I/usr/include/python3.10 -c -c /home/goat/ocr/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.cpp -o /home/goat/ocr/detectron2/build/temp.linux-x86_64-3.10/home/goat/ocr/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.o -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++17
In file included from /home/goat/ocr/lib/python3.10/site-packages/torch/include/pybind11/detail/../attr.h:13,
from /home/goat/ocr/lib/python3.10/site-packages/torch/include/pybind11/detail/class.h:12,
from /home/goat/ocr/lib/python3.10/site-packages/torch/include/pybind11/pybind11.h:13,
from /home/goat/ocr/lib/python3.10/site-packages/torch/include/pybind11/numpy.h:12,
from /home/goat/ocr/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.h:4,
from /home/goat/ocr/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.cpp:2:
/home/goat/ocr/lib/python3.10/site-packages/torch/include/pybind11/detail/../detail/common.h:266:10: fatal error: Python.h: No such file or directory
266 | #include <Python.h>
| ^~~~~~~~~~
compilation terminated.
[2/2] c++ -MMD -MF /home/goat/ocr/detectron2/build/temp.linux-x86_64-3.10/home/goat/ocr/detectron2/detectron2/layers/csrc/vision.o.d -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DWITH_CUDA -I/home/goat/ocr/detectron2/detectron2/layers/csrc -I/home/goat/ocr/lib/python3.10/site-packages/torch/include -I/home/goat/ocr/lib/python3.10/site-packages/torch/include/torch/csrc/api/include -I/home/goat/ocr/lib/python3.10/site-packages/torch/include/TH -I/home/goat/ocr/lib/python3.10/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/goat/ocr/include -I/usr/include/python3.10 -c -c /home/goat/ocr/detectron2/detectron2/layers/csrc/vision.cpp -o /home/goat/ocr/detectron2/build/temp.linux-x86_64-3.10/home/goat/ocr/detectron2/detectron2/layers/csrc/vision.o -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++17
FAILED: /home/goat/ocr/detectron2/build/temp.linux-x86_64-3.10/home/goat/ocr/detectron2/detectron2/layers/csrc/vision.o
c++ -MMD -MF /home/goat/ocr/detectron2/build/temp.linux-x86_64-3.10/home/goat/ocr/detectron2/detectron2/layers/csrc/vision.o.d -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DWITH_CUDA -I/home/goat/ocr/detectron2/detectron2/layers/csrc -I/home/goat/ocr/lib/python3.10/site-packages/torch/include -I/home/goat/ocr/lib/python3.10/site-packages/torch/include/torch/csrc/api/include -I/home/goat/ocr/lib/python3.10/site-packages/torch/include/TH -I/home/goat/ocr/lib/python3.10/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/goat/ocr/include -I/usr/include/python3.10 -c -c /home/goat/ocr/detectron2/detectron2/layers/csrc/vision.cpp -o /home/goat/ocr/detectron2/build/temp.linux-x86_64-3.10/home/goat/ocr/detectron2/detectron2/layers/csrc/vision.o -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++17
In file included from /home/goat/ocr/lib/python3.10/site-packages/torch/include/torch/csrc/Device.h:4,
from /home/goat/ocr/lib/python3.10/site-packages/torch/include/torch/csrc/api/include/torch/python.h:8,
from /home/goat/ocr/lib/python3.10/site-packages/torch/include/torch/extension.h:9,
from /home/goat/ocr/detectron2/detectron2/layers/csrc/vision.cpp:3:
/home/goat/ocr/lib/python3.10/site-packages/torch/include/torch/csrc/python_headers.h:12:10: fatal error: Python.h: No such file or directory
12 | #include <Python.h>
| ^~~~~~~~~~
compilation terminated.
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
File "/home/goat/ocr/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 2100, in _run_ninja_build
subprocess.run(
File "/usr/lib/python3.10/subprocess.py", line 526, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/home/goat/ocr/detectron2/setup.py", line 151, in <module>
setup(
File "/home/goat/ocr/lib/python3.10/site-packages/setuptools/__init__.py", line 153, in setup
return distutils.core.setup(**attrs)
File "/usr/lib/python3.10/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.10/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.10/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/home/goat/ocr/lib/python3.10/site-packages/setuptools/command/develop.py", line 34, in run
self.install_for_development()
File "/home/goat/ocr/lib/python3.10/site-packages/setuptools/command/develop.py", line 114, in install_for_development
self.run_command('build_ext')
File "/usr/lib/python3.10/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.10/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/home/goat/ocr/lib/python3.10/site-packages/setuptools/command/build_ext.py", line 79, in run
_build_ext.run(self)
File "/usr/lib/python3.10/distutils/command/build_ext.py", line 340, in run
self.build_extensions()
File "/home/goat/ocr/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 873, in build_extensions
build_ext.build_extensions(self)
File "/usr/lib/python3.10/distutils/command/build_ext.py", line 449, in build_extensions
self._build_extensions_serial()
File "/usr/lib/python3.10/distutils/command/build_ext.py", line 474, in _build_extensions_serial
self.build_extension(ext)
File "/home/goat/ocr/lib/python3.10/site-packages/setuptools/command/build_ext.py", line 202, in build_extension
_build_ext.build_extension(self, ext)
File "/home/goat/ocr/lib/python3.10/site-packages/Cython/Distutils/build_ext.py", line 135, in build_extension
super(build_ext, self).build_extension(ext)
File "/usr/lib/python3.10/distutils/command/build_ext.py", line 529, in build_extension
objects = self.compiler.compile(sources,
File "/home/goat/ocr/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 686, in unix_wrap_ninja_compile
_write_ninja_file_and_compile_objects(
File "/home/goat/ocr/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 1774, in _write_ninja_file_and_compile_objects
_run_ninja_build(
File "/home/goat/ocr/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 2116, in _run_ninja_build
raise RuntimeError(message) from e
RuntimeError: Error compiling objects for extension
[end of output]
python setup.py develop did not run successfully.
exit code: 1
running develop
/home/goat/ocr/lib/python3.10/site-packages/setuptools/command/easy_install.py:158: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
/home/goat/ocr/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running egg_info
writing detectron2.egg-info/PKG-INFO
writing dependency_links to detectron2.egg-info/dependency_links.txt
writing requirements to detectron2.egg-info/requires.txt
writing top-level names to detectron2.egg-info/top_level.txt
reading manifest file 'detectron2.egg-info/SOURCES.txt'
adding license file 'LICENSE'
writing manifest file 'detectron2.egg-info/SOURCES.txt'
running build_ext
/home/goat/ocr/lib/python3.10/site-packages/torch/utils/cpp_extension.py:424: UserWarning: There are no x86_64-linux-gnu-g++ version bounds defined for CUDA version 11.8
warnings.warn(f'There are no {compiler_name} version bounds defined for CUDA version {cuda_str_version}')
building 'detectron2._C' extension
Emitting ninja build file /home/goat/ocr/detectron2/build/temp.linux-x86_64-3.10/build.ninja...
Compiling objects...
Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
[1/2] c++ -MMD -MF /home/goat/ocr/detectron2/build/temp.linux-x86_64-3.10/home/goat/ocr/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.o.d -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DWITH_CUDA -I/home/goat/ocr/detectron2/detectron2/layers/csrc -I/home/goat/ocr/lib/python3.10/site-packages/torch/include -I/home/goat/ocr/lib/python3.10/site-packages/torch/include/torch/csrc/api/include -I/home/goat/ocr/lib/python3.10/site-packages/torch/include/TH -I/home/goat/ocr/lib/python3.10/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/goat/ocr/include -I/usr/include/python3.10 -c -c /home/goat/ocr/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.cpp -o /home/goat/ocr/detectron2/build/temp.linux-x86_64-3.10/home/goat/ocr/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.o -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++17
FAILED: /home/goat/ocr/detectron2/build/temp.linux-x86_64-3.10/home/goat/ocr/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.o
c++ -MMD -MF /home/goat/ocr/detectron2/build/temp.linux-x86_64-3.10/home/goat/ocr/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.o.d -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DWITH_CUDA -I/home/goat/ocr/detectron2/detectron2/layers/csrc -I/home/goat/ocr/lib/python3.10/site-packages/torch/include -I/home/goat/ocr/lib/python3.10/site-packages/torch/include/torch/csrc/api/include -I/home/goat/ocr/lib/python3.10/site-packages/torch/include/TH -I/home/goat/ocr/lib/python3.10/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/goat/ocr/include -I/usr/include/python3.10 -c -c /home/goat/ocr/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.cpp -o /home/goat/ocr/detectron2/build/temp.linux-x86_64-3.10/home/goat/ocr/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.o -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++17
In file included from /home/goat/ocr/lib/python3.10/site-packages/torch/include/pybind11/detail/../attr.h:13,
from /home/goat/ocr/lib/python3.10/site-packages/torch/include/pybind11/detail/class.h:12,
from /home/goat/ocr/lib/python3.10/site-packages/torch/include/pybind11/pybind11.h:13,
from /home/goat/ocr/lib/python3.10/site-packages/torch/include/pybind11/numpy.h:12,
from /home/goat/ocr/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.h:4,
from /home/goat/ocr/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.cpp:2:
/home/goat/ocr/lib/python3.10/site-packages/torch/include/pybind11/detail/../detail/common.h:266:10: fatal error: Python.h: No such file or directory
266 | #include <Python.h>
| ^~~~~~~~~~
compilation terminated.
[2/2] c++ -MMD -MF /home/goat/ocr/detectron2/build/temp.linux-x86_64-3.10/home/goat/ocr/detectron2/detectron2/layers/csrc/vision.o.d -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DWITH_CUDA -I/home/goat/ocr/detectron2/detectron2/layers/csrc -I/home/goat/ocr/lib/python3.10/site-packages/torch/include -I/home/goat/ocr/lib/python3.10/site-packages/torch/include/torch/csrc/api/include -I/home/goat/ocr/lib/python3.10/site-packages/torch/include/TH -I/home/goat/ocr/lib/python3.10/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/goat/ocr/include -I/usr/include/python3.10 -c -c /home/goat/ocr/detectron2/detectron2/layers/csrc/vision.cpp -o /home/goat/ocr/detectron2/build/temp.linux-x86_64-3.10/home/goat/ocr/detectron2/detectron2/layers/csrc/vision.o -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++17
FAILED: /home/goat/ocr/detectron2/build/temp.linux-x86_64-3.10/home/goat/ocr/detectron2/detectron2/layers/csrc/vision.o
c++ -MMD -MF /home/goat/ocr/detectron2/build/temp.linux-x86_64-3.10/home/goat/ocr/detectron2/detectron2/layers/csrc/vision.o.d -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DWITH_CUDA -I/home/goat/ocr/detectron2/detectron2/layers/csrc -I/home/goat/ocr/lib/python3.10/site-packages/torch/include -I/home/goat/ocr/lib/python3.10/site-packages/torch/include/torch/csrc/api/include -I/home/goat/ocr/lib/python3.10/site-packages/torch/include/TH -I/home/goat/ocr/lib/python3.10/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/goat/ocr/include -I/usr/include/python3.10 -c -c /home/goat/ocr/detectron2/detectron2/layers/csrc/vision.cpp -o /home/goat/ocr/detectron2/build/temp.linux-x86_64-3.10/home/goat/ocr/detectron2/detectron2/layers/csrc/vision.o -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++17
In file included from /home/goat/ocr/lib/python3.10/site-packages/torch/include/torch/csrc/Device.h:4,
from /home/goat/ocr/lib/python3.10/site-packages/torch/include/torch/csrc/api/include/torch/python.h:8,
from /home/goat/ocr/lib/python3.10/site-packages/torch/include/torch/extension.h:9,
from /home/goat/ocr/detectron2/detectron2/layers/csrc/vision.cpp:3:
/home/goat/ocr/lib/python3.10/site-packages/torch/include/torch/csrc/python_headers.h:12:10: fatal error: Python.h: No such file or directory
12 | #include <Python.h>
| ^~~~~~~~~~
compilation terminated.
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
File "/home/goat/ocr/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 2100, in _run_ninja_build
subprocess.run(
File "/usr/lib/python3.10/subprocess.py", line 526, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/home/goat/ocr/detectron2/setup.py", line 151, in <module>
setup(
File "/home/goat/ocr/lib/python3.10/site-packages/setuptools/__init__.py", line 153, in setup
return distutils.core.setup(**attrs)
File "/usr/lib/python3.10/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.10/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.10/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/home/goat/ocr/lib/python3.10/site-packages/setuptools/command/develop.py", line 34, in run
self.install_for_development()
File "/home/goat/ocr/lib/python3.10/site-packages/setuptools/command/develop.py", line 114, in install_for_development
self.run_command('build_ext')
File "/usr/lib/python3.10/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.10/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/home/goat/ocr/lib/python3.10/site-packages/setuptools/command/build_ext.py", line 79, in run
_build_ext.run(self)
File "/usr/lib/python3.10/distutils/command/build_ext.py", line 340, in run
self.build_extensions()
File "/home/goat/ocr/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 873, in build_extensions
build_ext.build_extensions(self)
File "/usr/lib/python3.10/distutils/command/build_ext.py", line 449, in build_extensions
self._build_extensions_serial()
File "/usr/lib/python3.10/distutils/command/build_ext.py", line 474, in _build_extensions_serial
self.build_extension(ext)
File "/home/goat/ocr/lib/python3.10/site-packages/setuptools/command/build_ext.py", line 202, in build_extension
_build_ext.build_extension(self, ext)
File "/home/goat/ocr/lib/python3.10/site-packages/Cython/Distutils/build_ext.py", line 135, in build_extension
super(build_ext, self).build_extension(ext)
File "/usr/lib/python3.10/distutils/command/build_ext.py", line 529, in build_extension
objects = self.compiler.compile(sources,
File "/home/goat/ocr/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 686, in unix_wrap_ninja_compile
_write_ninja_file_and_compile_objects(
File "/home/goat/ocr/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 1774, in _write_ninja_file_and_compile_objects
_run_ninja_build(
File "/home/goat/ocr/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 2116, in _run_ninja_build
raise RuntimeError(message) from e
RuntimeError: Error compiling objects for extension
[end of output]
Install python headers using the following:
$sudo apt-get install python3.8-dev