fatal error: jpeglib.h: No such file or directory
junhuanchen opened this issue · 2 comments
junhuanchen commented
fatal error: jpeglib.h: No such file or directory
#include <jpeglib.h>
^
compilation terminated.
解决:安装 jpeg库
sudo apt-get install libjpeg-dev
thepian commented
This seems similar
pip install maixpy3
Collecting maixpy3
Using cached MaixPy3-0.3.0.tar.gz (10.0 MB)
Requirement already satisfied: numpy in /opt/conda/lib/python3.7/site-packages (from maixpy3) (1.20.3)
Collecting opencv-python==4.1.2.30
Using cached opencv_python-4.1.2.30-cp37-cp37m-manylinux1_x86_64.whl (28.3 MB)
Collecting opencv-contrib-python==4.1.2.30
Using cached opencv_contrib_python-4.1.2.30-cp37-cp37m-manylinux1_x86_64.whl (34.3 MB)
Collecting Pillow
Using cached Pillow-8.2.0-cp37-cp37m-manylinux1_x86_64.whl (3.0 MB)
Collecting rpyc
Using cached rpyc-5.0.1-py3-none-any.whl (68 kB)
Collecting gpiod
Using cached gpiod-1.5.0-py3-none-any.whl
Requirement already satisfied: evdev in /opt/conda/lib/python3.7/site-packages (from maixpy3) (1.4.0)
Requirement already satisfied: spidev in /opt/conda/lib/python3.7/site-packages (from maixpy3) (3.5)
Collecting pyserial
Using cached pyserial-3.5-py2.py3-none-any.whl (90 kB)
Requirement already satisfied: plumbum in /opt/conda/lib/python3.7/site-packages (from rpyc->maixpy3) (1.7.0)
Building wheels for collected packages: maixpy3
Building wheel for maixpy3 (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /opt/conda/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-egb7rmm0/maixpy3_ec596bb36973466b856a2e844aba7ee5/setup.py'"'"'; __file__='"'"'/tmp/pip-install-egb7rmm0/maixpy3_ec596bb36973466b856a2e844aba7ee5/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-klp_vr0l
cwd: /tmp/pip-install-egb7rmm0/maixpy3_ec596bb36973466b856a2e844aba7ee5/
Complete output (63 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.7
creating build/lib.linux-x86_64-3.7/maix
copying maix/nn.py -> build/lib.linux-x86_64-3.7/maix
copying maix/pwm.py -> build/lib.linux-x86_64-3.7/maix
copying maix/camera.py -> build/lib.linux-x86_64-3.7/maix
copying maix/display.py -> build/lib.linux-x86_64-3.7/maix
copying maix/__init__.py -> build/lib.linux-x86_64-3.7/maix
copying maix/rpycs.py -> build/lib.linux-x86_64-3.7/maix
copying maix/video.py -> build/lib.linux-x86_64-3.7/maix
creating build/lib.linux-x86_64-3.7/maix/utils
copying maix/utils/rtp_packet.py -> build/lib.linux-x86_64-3.7/maix/utils
copying maix/utils/rtsp_packet.py -> build/lib.linux-x86_64-3.7/maix/utils
copying maix/utils/video_stream.py -> build/lib.linux-x86_64-3.7/maix/utils
copying maix/utils/__init__.py -> build/lib.linux-x86_64-3.7/maix/utils
running egg_info
writing MaixPy3.egg-info/PKG-INFO
writing dependency_links to MaixPy3.egg-info/dependency_links.txt
writing entry points to MaixPy3.egg-info/entry_points.txt
writing requirements to MaixPy3.egg-info/requires.txt
writing top-level names to MaixPy3.egg-info/top_level.txt
reading manifest file 'MaixPy3.egg-info/SOURCES.txt'
writing manifest file 'MaixPy3.egg-info/SOURCES.txt'
warning: build_py: byte-compiling is disabled, skipping.
running build_ext
building 'pylibi2c' extension
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/ext_modules
creating build/temp.linux-x86_64-3.7/ext_modules/libi2c
creating build/temp.linux-x86_64-3.7/ext_modules/libi2c/src
gcc -pthread -B /opt/conda/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Iext_modules/libi2c/src -I/opt/conda/include/python3.7m -c ext_modules/libi2c/src/pyi2c.c -o build/temp.linux-x86_64-3.7/ext_modules/libi2c/src/pyi2c.o
ext_modules/libi2c/src/pyi2c.c: In function 'i2c_read_device':
ext_modules/libi2c/src/pyi2c.c:165:16: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare]
165 | if (result != len) {
| ^~
In function 'check_user_input',
inlined from 'I2CDevice_set_page_bytes' at ext_modules/libi2c/src/pyi2c.c:372:9:
ext_modules/libi2c/src/pyi2c.c:255:9: warning: '__builtin_memcmp_eq' reading 10 bytes from a region of size 7 [-Wstringop-overflow=]
255 | if (memcmp(name, "tenbit", strlen(name)) == 0) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In function 'check_user_input',
inlined from 'I2CDevice_set_iaddr_bytes' at ext_modules/libi2c/src/pyi2c.c:405:9:
ext_modules/libi2c/src/pyi2c.c:255:9: warning: '__builtin_memcmp_eq' reading 11 bytes from a region of size 7 [-Wstringop-overflow=]
255 | if (memcmp(name, "tenbit", strlen(name)) == 0) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gcc -pthread -B /opt/conda/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Iext_modules/libi2c/src -I/opt/conda/include/python3.7m -c ext_modules/libi2c/src/i2c.c -o build/temp.linux-x86_64-3.7/ext_modules/libi2c/src/i2c.o
ext_modules/libi2c/src/i2c.c: In function 'i2c_write':
ext_modules/libi2c/src/i2c.c:288:69: warning: comparison of integer expressions of different signedness: 'ssize_t' {aka 'long int'} and 'size_t' {aka 'long unsigned int'} [-Wsign-compare]
288 | if (write(device->bus, tmp_buf, device->iaddr_bytes + size) != device->iaddr_bytes + size) {
| ^~
gcc -pthread -shared -B /opt/conda/compiler_compat -L/opt/conda/lib -Wl,-rpath=/opt/conda/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.7/ext_modules/libi2c/src/pyi2c.o build/temp.linux-x86_64-3.7/ext_modules/libi2c/src/i2c.o -o build/lib.linux-x86_64-3.7/pylibi2c.cpython-37m-x86_64-linux-gnu.so
building '_maix' extension
creating build/temp.linux-x86_64-3.7/ext_modules/_maix
gcc -pthread -B /opt/conda/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Iext_modules/_maix/include -I/opt/conda/include/python3.7m -c ext_modules/_maix/_maix.c -o build/temp.linux-x86_64-3.7/ext_modules/_maix/_maix.o
ext_modules/_maix/_maix.c:7:10: fatal error: jpeglib.h: No such file or directory
7 | #include "jpeglib.h"
| ^~~~~~~~~~~
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for maixpy3
Running setup.py clean for maixpy3
Failed to build maixpy3
Installing collected packages: rpyc, pyserial, Pillow, opencv-python, opencv-contrib-python, gpiod, maixpy3
Running setup.py install for maixpy3 ... error
ERROR: Command errored out with exit status 1:
command: /opt/conda/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-egb7rmm0/maixpy3_ec596bb36973466b856a2e844aba7ee5/setup.py'"'"'; __file__='"'"'/tmp/pip-install-egb7rmm0/maixpy3_ec596bb36973466b856a2e844aba7ee5/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-nk66supv/install-record.txt --single-version-externally-managed --compile --install-headers /opt/conda/include/python3.7m/maixpy3
cwd: /tmp/pip-install-egb7rmm0/maixpy3_ec596bb36973466b856a2e844aba7ee5/
Complete output (63 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.7
creating build/lib.linux-x86_64-3.7/maix
copying maix/nn.py -> build/lib.linux-x86_64-3.7/maix
copying maix/pwm.py -> build/lib.linux-x86_64-3.7/maix
copying maix/camera.py -> build/lib.linux-x86_64-3.7/maix
copying maix/display.py -> build/lib.linux-x86_64-3.7/maix
copying maix/__init__.py -> build/lib.linux-x86_64-3.7/maix
copying maix/rpycs.py -> build/lib.linux-x86_64-3.7/maix
copying maix/video.py -> build/lib.linux-x86_64-3.7/maix
creating build/lib.linux-x86_64-3.7/maix/utils
copying maix/utils/rtp_packet.py -> build/lib.linux-x86_64-3.7/maix/utils
copying maix/utils/rtsp_packet.py -> build/lib.linux-x86_64-3.7/maix/utils
copying maix/utils/video_stream.py -> build/lib.linux-x86_64-3.7/maix/utils
copying maix/utils/__init__.py -> build/lib.linux-x86_64-3.7/maix/utils
running egg_info
writing MaixPy3.egg-info/PKG-INFO
writing dependency_links to MaixPy3.egg-info/dependency_links.txt
writing entry points to MaixPy3.egg-info/entry_points.txt
writing requirements to MaixPy3.egg-info/requires.txt
writing top-level names to MaixPy3.egg-info/top_level.txt
reading manifest file 'MaixPy3.egg-info/SOURCES.txt'
writing manifest file 'MaixPy3.egg-info/SOURCES.txt'
warning: build_py: byte-compiling is disabled, skipping.
running build_ext
building 'pylibi2c' extension
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/ext_modules
creating build/temp.linux-x86_64-3.7/ext_modules/libi2c
creating build/temp.linux-x86_64-3.7/ext_modules/libi2c/src
gcc -pthread -B /opt/conda/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Iext_modules/libi2c/src -I/opt/conda/include/python3.7m -c ext_modules/libi2c/src/pyi2c.c -o build/temp.linux-x86_64-3.7/ext_modules/libi2c/src/pyi2c.o
ext_modules/libi2c/src/pyi2c.c: In function 'i2c_read_device':
ext_modules/libi2c/src/pyi2c.c:165:16: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare]
165 | if (result != len) {
| ^~
In function 'check_user_input',
inlined from 'I2CDevice_set_page_bytes' at ext_modules/libi2c/src/pyi2c.c:372:9:
ext_modules/libi2c/src/pyi2c.c:255:9: warning: '__builtin_memcmp_eq' reading 10 bytes from a region of size 7 [-Wstringop-overflow=]
255 | if (memcmp(name, "tenbit", strlen(name)) == 0) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In function 'check_user_input',
inlined from 'I2CDevice_set_iaddr_bytes' at ext_modules/libi2c/src/pyi2c.c:405:9:
ext_modules/libi2c/src/pyi2c.c:255:9: warning: '__builtin_memcmp_eq' reading 11 bytes from a region of size 7 [-Wstringop-overflow=]
255 | if (memcmp(name, "tenbit", strlen(name)) == 0) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gcc -pthread -B /opt/conda/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Iext_modules/libi2c/src -I/opt/conda/include/python3.7m -c ext_modules/libi2c/src/i2c.c -o build/temp.linux-x86_64-3.7/ext_modules/libi2c/src/i2c.o
ext_modules/libi2c/src/i2c.c: In function 'i2c_write':
ext_modules/libi2c/src/i2c.c:288:69: warning: comparison of integer expressions of different signedness: 'ssize_t' {aka 'long int'} and 'size_t' {aka 'long unsigned int'} [-Wsign-compare]
288 | if (write(device->bus, tmp_buf, device->iaddr_bytes + size) != device->iaddr_bytes + size) {
| ^~
gcc -pthread -shared -B /opt/conda/compiler_compat -L/opt/conda/lib -Wl,-rpath=/opt/conda/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.7/ext_modules/libi2c/src/pyi2c.o build/temp.linux-x86_64-3.7/ext_modules/libi2c/src/i2c.o -o build/lib.linux-x86_64-3.7/pylibi2c.cpython-37m-x86_64-linux-gnu.so
building '_maix' extension
creating build/temp.linux-x86_64-3.7/ext_modules/_maix
gcc -pthread -B /opt/conda/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Iext_modules/_maix/include -I/opt/conda/include/python3.7m -c ext_modules/_maix/_maix.c -o build/temp.linux-x86_64-3.7/ext_modules/_maix/_maix.o
ext_modules/_maix/_maix.c:7:10: fatal error: jpeglib.h: No such file or directory
7 | #include "jpeglib.h"
| ^~~~~~~~~~~
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /opt/conda/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-egb7rmm0/maixpy3_ec596bb36973466b856a2e844aba7ee5/setup.py'"'"'; __file__='"'"'/tmp/pip-install-egb7rmm0/maixpy3_ec596bb36973466b856a2e844aba7ee5/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-nk66supv/install-record.txt --single-version-externally-managed --compile --install-headers /opt/conda/include/python3.7m/maixpy3 Check the logs for full command output.
thepian commented
On Alpine I fixed this by adding package "libjpeg-turbo-dev" on Ubuntu it might be called "libjpeg-dev".