Encountered error while trying to install package. numpy error - python

I am trying to deploy a flask app into google cloud platform appengine and
i encountered the following error:
ERROR: (gcloud.app.deploy) Error Response: [9] Cloud build f504b76c-44b0-4d63-acf0-e896beb69d87 status: FAILURE
...ct *, double);
| ^~~~~~~~~~~~~~
numpy/core/src/multiarray/scalartypes.c.src: In function ‘longdouble_arrtype_hash’:
numpy/core/src/multiarray/scalartypes.c.src:3229:1: warning: control reaches end of non- void function [-Wreturn-type]
3229 | }
| ^
numpy/core/src/multiarray/scalartypes.c.src: In function ‘float_arrtype_hash’:
numpy/core/src/multiarray/scalartypes.c.src:3229:1: warning: control reaches end of non- void function [-Wreturn-type]
3229 | }
| ^
numpy/core/src/multiarray/scalartypes.c.src: In function ‘half_arrtype_hash’:
numpy/core/src/multiarray/scalartypes.c.src:3259:1: warning: control reaches end of non- void function [-Wreturn-type]
3259 | }
| ^
error: Command "x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g - fwrapv -O3 -Wall -fstack-protector-strong -g -Wformat -Werror=format-security -fPIC - DNPY_INTERNAL_BUILD=1 -DHAVE_NPY_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 - D_LARGEFILE64_SOURCE=1 -DNO_ATLAS_INFO=1 -DHAVE_CBLAS -I/usr/local/include -I/usr/include - I/layers/google.python.runtime/python/include -Ibuild/src.linux-x86_64-3.1/numpy/core/src/private - Inumpy/core/include -Ibuild/src.linux-x86_64-3.1/numpy/core/include/numpy -Inumpy/core/src/private - Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray - Inumpy/core/src/umath -Inumpy/core/src/npysort -I/layers/google.python.runtime/python/include/python3.10 -Ibuild/src.linux-x86_64-3.1/numpy/core/src/private -Ibuild/src.linux-x86_64-3.1/numpy/core/src/npymath -Ibuild/src.linux-x86_64-3.1/numpy/core/src/private -Ibuild/src.linux-x86_64-3.1/numpy/core/src/npymath -Ibuild/src.linux-x86_64-3.1/numpy/core/src/private -Ibuild/src.linux-x86_64-3.1/numpy/core/src/npymath -c build/src.linux-x86_64-3.1/numpy/core/src/multiarray/scalartypes.c -o build/temp.linux-x86_64-cpython-310/build/src.linux-x86_64-3.1/numpy/core/src/multiarray/scalartypes.o -MMD -MF build/temp.linux-x86_64-cpython-310/build/src.linux-x86_64-3.1/numpy/core/src/multiarray/scalartypes.o.d" failed with exit status 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> numpy
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
this is the requirements.txt content:
altf1be-helpers==2.1.4
attrs==19.3.0
azure-core==1.26.2
azure-storage-blob==12.5.0
Babel==2.8.0
bleach==3.1.5
Brotli==1.0.9
cachelib==0.1.1
certifi==2020.4.5.2
cffi==1.15.1
chardet==3.0.4
click==7.1.2
cryptography==38.0.4
cssselect2==0.7.0
dash==1.13.3
dash-core-components==1.10.1
dash-html-components==1.0.3
dash-renderer==1.5.0
dash-table==4.8.1
dnspython==2.3.0
docopt==0.6.2
docutils==0.16
email-validator==1.1.1
Flask==1.1.2
Flask-Babel==1.0.0
Flask-Compress==1.5.0
Flask-Login==0.5.0
Flask-Migrate==2.5.3
Flask-Session==0.3.2
Flask-SQLAlchemy==2.4.4
Flask-WeasyPrint==0.6
fonttools==4.38.0
future==0.18.3
gunicorn==20.0.4
html5lib==1.1
idna==2.9
importlib-metadata==1.6.1
importlib-resources==5.10.2
is-safe-url==1.0
isodate==0.6.1
itsdangerous==1.1.0
jeepney==0.4.3
Jinja2==2.11.2
keyring==21.2.1
Mako==1.2.4
MarkupSafe==1.1.1
more-itertools==8.4.0
msrest==0.7.1
numpy~=1.18.1
oauthlib==3.1.0
packaging==20.4
pandas==1.0.3
Pillow==9.4.0
pipreqs==0.4.10
pkginfo==1.5.0.1
plotly==5.13.0
pluggy==0.13.1
py==1.8.2
pycparser==2.21
pydyf==0.5.0
Pygments==2.6.1
pyodbc==4.0.35
pyOpenSSL==22.1.0
pyparsing==2.4.7
pyphen==0.13.2
pytest==5.4.2
python-dateutil==2.8.1
python-dotenv==0.14.0
python-http-client==3.3.7
pytz==2020.1
readme-renderer==26.0
requests==2.23.0
requests-oauthlib==1.3.0
requests-toolbelt==0.9.1
SecretStorage==3.1.2
sendgrid==6.4.6
six==1.15.0
SQLAlchemy==1.3.19
starkbank-ecdsa==2.2.0
tenacity==8.1.0
tinycss2==1.2.1
tqdm==4.46.1
twine==3.1.1
typing_extensions==4.4.0
Unidecode==1.1.1
urllib3==1.25.9
wcwidth==0.2.4
weasyprint==57.2
webencodings==0.5.1
Werkzeug==1.0.1
WTForms==2.3.3
xlrd==1.2.0
XlsxWriter==1.3.7
yarg==0.1.9
zipp==3.1.0
zopfli==0.2.2```
and this app.yaml content:
runtime: python310
instance_class: F1
automatic_scaling:
max_instances: 1
env_variables:
**********
entrypoint: gunicorn -b :$PORT -w 2 --log-level debug "srcflaskr:app"
the app works perfectly in local machine. I suspect the problem to be versions incompatibly,

Related

How to solve /usr/bin/ld: skipping incompatible and /usr/bin/ld: cannot find -lcoppeliaSim: No such file or directory

I am working on this project:https://github.com/stepjam/PyRep
but I couldn't run the code because of usr/bin/ld issues. I lost too much time trying to find a solution but nothing worked for me. I am using ubuntu 22.04, Mac & UTM, Python 3.10
I followed all the requirements and here what I added at the end of bash
export COPPELIASIM_ROOT=/home/user1/CoppeliaSim_Edu_V4_1_0_Ubuntu20_04
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$COPPELIASIM_ROOT
export QT_QPA_PLATFORM_PLUGIN_PATH=$COPPELIASIM_ROOT
A friend did the same exact steps and it worked for him on Windows & VM
Here is the output
user1#user1:~$ cd PyRep/
user1#user1:~/PyRep$ source ~/.bashrc
user1#user1:~/PyRep$ pip3 install -r requirements.txt
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: numpy in /home/user1/.local/lib/python3.10/site-packages (from -r requirements.txt (line 1)) (1.24.1)
Requirement already satisfied: cffi==1.14.2 in /home/user1/.local/lib/python3.10/site-packages (from -r requirements.txt (line 2)) (1.14.2)
Requirement already satisfied: pycparser in /home/user1/.local/lib/python3.10/site-packages (from cffi==1.14.2->-r requirements.txt (line 2)) (2.21)
user1#user1:~/PyRep$ pip3 install .
Defaulting to user installation because normal site-packages is not writeable
Processing /home/user1/PyRep
Preparing metadata (setup.py) ... done
Building wheels for collected packages: PyRep
Building wheel for PyRep (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [16 lines of output]
copying lua file: pyrep/backend -> /home/user1/CoppeliaSim_Edu_V4_1_0_Ubuntu20_04
generating build/pyrep/backend/pyrep/backend/_sim_cffi.c
(already up-to-date)
not modified: 'build/pyrep/backend/pyrep/backend/_sim_cffi.c'
running bdist_wheel
running build
running build_py
running build_ext
building 'pyrep.backend._sim_cffi' extension
aarch64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/home/user1/PyRep/cffi_build -I/usr/include/python3.10 -c build/pyrep/backend/pyrep/backend/_sim_cffi.c -o build/temp.linux-aarch64-cpython-310/build/pyrep/backend/pyrep/backend/_sim_cffi.o
aarch64-linux-gnu-gcc -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -g -fwrapv -O2 build/temp.linux-aarch64-cpython-310/build/pyrep/backend/pyrep/backend/_sim_cffi.o -L/home/user1/CoppeliaSim_Edu_V4_1_0_Ubuntu20_04 -L/usr/lib/aarch64-linux-gnu -lcoppeliaSim -o build/lib.linux-aarch64-cpython-310/pyrep/backend/_sim_cffi.cpython-310-aarch64-linux-gnu.so
/usr/bin/ld: skipping incompatible /home/user1/CoppeliaSim_Edu_V4_1_0_Ubuntu20_04/libcoppeliaSim.so when searching for -lcoppeliaSim
/usr/bin/ld: cannot find -lcoppeliaSim: No such file or directory
/usr/bin/ld: skipping incompatible /home/user1/CoppeliaSim_Edu_V4_1_0_Ubuntu20_04/libcoppeliaSim.so when searching for -lcoppeliaSim
collect2: error: ld returned 1 exit status
error: command '/usr/bin/aarch64-linux-gnu-gcc' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for PyRep
Running setup.py clean for PyRep
Failed to build PyRep
I tried some solutions related to usr/bin/ld: cannot find -lcoppeliaSim: No such file or directory but nothing worked.

Python3.10 ImageAI installation error likely not a problem with pip

I'm trying to install imageAI (pip install 3.10 ) on my python3.10 virtualenv, unfortunatelly I get the following error (which is unusually uge!!!):
PS I tried to follow many procedures I could find online, like updating distutils, libpython and gcc...but still I can't install imageAI.
Also following is just the end of the stacktrace which is to big to be posted here!
| ^~~~~~~~~~~~~~
In file included from /usr/include/python3.10/Python.h:77,
from numpy/core/src/multiarray/scalartypes.c.src:3:
/usr/include/python3.10/pyhash.h:10:23: note: declared here
10 | PyAPI_FUNC(Py_hash_t) _Py_HashDouble(PyObject *, double);
| ^~~~~~~~~~~~~~
numpy/core/src/multiarray/scalartypes.c.src: In function ‘longdouble_arrtype_hash’:
numpy/core/src/multiarray/scalartypes.c.src:3312:1: warning: control reaches end of non-void function [-Wreturn-type]
3312 | }
| ^
numpy/core/src/multiarray/scalartypes.c.src: In function ‘float_arrtype_hash’:
numpy/core/src/multiarray/scalartypes.c.src:3312:1: warning: control reaches end of non-void function [-Wreturn-type]
3312 | }
| ^
numpy/core/src/multiarray/scalartypes.c.src: In function ‘half_arrtype_hash’:
numpy/core/src/multiarray/scalartypes.c.src:3342:1: warning: control reaches end of non-void function [-Wreturn-type]
3342 | }
| ^
error: Command "x86_64-linux-gnu-gcc -pthread -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 -DNPY_INTERNAL_BUILD=1 -DHAVE_NPY_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -DHAVE_CBLAS -Ibuild/src.linux-x86_64-3.1/numpy/core/src/umath -Ibuild/src.linux-x86_64-3.1/numpy/core/src/npymath -Ibuild/src.linux-x86_64-3.1/numpy/core/src/common -Inumpy/core/include -Ibuild/src.linux-x86_64-3.1/numpy/core/include/numpy -Inumpy/core/src/common -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/home/carloc/Projects/0_small_projects/image-detection/venv/include -I/usr/include/python3.10 -Ibuild/src.linux-x86_64-3.1/numpy/core/src/common -Ibuild/src.linux-x86_64-3.1/numpy/core/src/npymath -Ibuild/src.linux-x86_64-3.1/numpy/core/src/common -Ibuild/src.linux-x86_64-3.1/numpy/core/src/npymath -c build/src.linux-x86_64-3.1/numpy/core/src/multiarray/scalartypes.c -o build/temp.linux-x86_64-3.10/build/src.linux-x86_64-3.1/numpy/core/src/multiarray/scalartypes.o -MMD -MF build/temp.linux-x86_64-3.10/build/src.linux-x86_64-3.1/numpy/core/src/multiarray/scalartypes.o.d" failed with exit status 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> numpy
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
Any suggestions?
thank you

Is it because mutiple Numpy so as to failed building wheel for numpy on Mac OS Monterey ver 12 M1 Pro

Could anyone comment whether multiple numpy installation is the reason for the error? If it is yes, what can I do?
Please let me explain the error here. When installing a package (argoverse https://github.com/argoai/argoverse-api ), I run into the following error on Mac while I didn't run into such problem while installing it on PC (x86). Error msg as shown below.
clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
error: Command "clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -DNPY_INTERNAL_BUILD=1 -DHAVE_NPY_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -DNO_ATLAS_INFO=3 -DHAVE_CBLAS -Ibuild/src.macosx-10.9-universal2-3.10/numpy/core/src/umath -Ibuild/src.macosx-10.9-universal2-3.10/numpy/core/src/npymath -Ibuild/src.macosx-10.9-universal2-3.10/numpy/core/src/common -Inumpy/core/include -Ibuild/src.macosx-10.9-universal2-3.10/numpy/core/include/numpy -Inumpy/core/src/common -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10
-Ibuild/src.macosx-10.9-universal2-3.10/numpy/core/src/common -Ibuild/src.macosx-10.9-universal2-3.10/numpy/core/src/npymath -c numpy/core/src/multiarray/alloc.c -o
build/temp.macosx-10.9-universal2-3.10/numpy/core/src/multiarray/alloc.o
-MMD -MF build/temp.macosx-10.9-universal2-3.10/numpy/core/src/multiarray/alloc.o.d
-faltivec -I/System/Library/Frameworks/vecLib.framework/Headers" failed with exit status 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for numpy
Failed to build numpy
ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run
successfully. │ exit code: 1 ╰─> See above for output.
note: This error originates from a subprocess, and is likely not a
problem with pip.
After some research, I did
% brew doctor
and get the feedback like:
/Library/Frameworks/Python.framework/Versions/3.10/bin/python3.10-config
/Library/Frameworks/Python.framework/Versions/3.10/bin/python3-config
Other info
% python --version Python 3.8.9 % pip install numpy Requirement
already satisfied: numpy in
/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages
(1.23.1)
And checking on python's version
% python --version Python 3.8.9
% python3 --version Python 3.10.4

Problem installing statsmodels on Apple M1

I have trouble installing statsmodels on Apple M1. I have tried installing with a rosetta enabled terminal, and conda-forge, but still not able to get it installed.
I get a long error ending with the following:
clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
error: Command "clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -DNPY_INTERNAL_BUILD=1 -DHAVE_NPY_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -DNO_ATLAS_INFO=3 -DHAVE_CBLAS -Ibuild/src.macosx-12.3-arm64-3.7/numpy/core/src/umath -Ibuild/src.macosx-12.3-arm64-3.7/numpy/core/src/npymath -Ibuild/src.macosx-12.3-arm64-3.7/numpy/core/src/common -Inumpy/core/include -Ibuild/src.macosx-12.3-arm64-3.7/numpy/core/include/numpy -Inumpy/core/src/common -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/Users/amin-asdzdh/Developer/padfoot/.venv_padfoot/include -I/Users/amin-asdzdh/.pyenv/versions/3.7.13/include/python3.7m -Ibuild/src.macosx-12.3-arm64-3.7/numpy/core/src/common -Ibuild/src.macosx-12.3-arm64-3.7/numpy/core/src/npymath -Ibuild/src.macosx-12.3-arm64-3.7/numpy/core/src/common -Ibuild/src.macosx-12.3-arm64-3.7/numpy/core/src/npymath -c numpy/core/src/multiarray/alloc.c -o build/temp.macosx-12.3-arm64-3.7/numpy/core/src/multiarray/alloc.o -MMD -MF build/temp.macosx-12.3-arm64-3.7/numpy/core/src/multiarray/alloc.o.d -faltivec -I/System/Library/Frameworks/vecLib.framework/Headers" failed with exit status 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> numpy
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

Can't find `lz4` header when installing `roslz4` with pip on a Mac

I'm trying to install roslz4 on my Mac, and I get the following error.
In file included from ros_comm/utilities/roslz4/src/_roslz4module.c:37:
include/roslz4/lz4s.h:38:10: fatal error: 'lz4.h' file not found
#include <lz4.h>
^~~~~~~
1 error generated.
error: command 'clang' failed with exit status 1
[end of output]
To counter this, I installed lz4 with brew which ran successfully
> brew install lz4
==> Downloading https://ghcr.io/v2/homebrew/core/lz4/manifests/1.9.3
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/lz4/blobs/sha256:d222923849a6fefd391ab6705f1468c10d287c08ab9c4b5053a18a552139e262
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:d222923849a6fefd391ab6705f1468c10d287c08ab9c4b5053a18a552139e262?se=2022-06-14T22%3A20%3A00Z&s
######################################################################## 100.0%
==> Pouring lz4--1.9.3.arm64_monterey.bottle.tar.gz
🍺 /opt/homebrew/Cellar/lz4/1.9.3: 22 files, 620.6KB
==> Running `brew cleanup lz4`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
However, it does not appear to have resolved the problem.
Full pip output:
> pip install --extra-index-url https://rospypi.github.io/simple/ roslz4
Looking in indexes: https://pypi.org/simple, https://rospypi.github.io/simple/
Collecting roslz4
Using cached https://github.com/rospypi/simple/raw/any/roslz4/roslz4-1.14.3.post2.tar.gz (18 kB)
Preparing metadata (setup.py) ... done
Building wheels for collected packages: roslz4
Building wheel for roslz4 (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [21 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.14-arm64-3.8
creating build/lib.macosx-10.14-arm64-3.8/roslz4
copying ros_comm/utilities/roslz4/src/roslz4/__init__.py -> build/lib.macosx-10.14-arm64-3.8/roslz4
running build_ext
building '_roslz4' extension
creating build/temp.macosx-10.14-arm64-3.8
creating build/temp.macosx-10.14-arm64-3.8/ros_comm
creating build/temp.macosx-10.14-arm64-3.8/ros_comm/utilities
creating build/temp.macosx-10.14-arm64-3.8/ros_comm/utilities/roslz4
creating build/temp.macosx-10.14-arm64-3.8/ros_comm/utilities/roslz4/src
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -DXXH_NAMESPACE=ROSLZ4_ -Iinclude -Iroscpp_core/cpp_common/include -I/Users/cmauceri/Workspace/run-mgmt/jupyter_venv/include -I/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8 -c ros_comm/utilities/roslz4/src/_roslz4module.c -o build/temp.macosx-10.14-arm64-3.8/ros_comm/utilities/roslz4/src/_roslz4module.o -Wno-strict-prototypes -Wno-missing-field-initializers -Wno-unused-variable -Wno-strict-aliasing
In file included from ros_comm/utilities/roslz4/src/_roslz4module.c:37:
include/roslz4/lz4s.h:38:10: fatal error: 'lz4.h' file not found
#include <lz4.h>
^~~~~~~
1 error generated.
error: command 'clang' failed with exit status 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for roslz4
Running setup.py clean for roslz4
Failed to build roslz4
Installing collected packages: roslz4
Running setup.py install for roslz4 ... error
error: subprocess-exited-with-error
× Running setup.py install for roslz4 did not run successfully.
│ exit code: 1
╰─> [21 lines of output]
running install
running build
running build_py
creating build
creating build/lib.macosx-10.14-arm64-3.8
creating build/lib.macosx-10.14-arm64-3.8/roslz4
copying ros_comm/utilities/roslz4/src/roslz4/__init__.py -> build/lib.macosx-10.14-arm64-3.8/roslz4
running build_ext
building '_roslz4' extension
creating build/temp.macosx-10.14-arm64-3.8
creating build/temp.macosx-10.14-arm64-3.8/ros_comm
creating build/temp.macosx-10.14-arm64-3.8/ros_comm/utilities
creating build/temp.macosx-10.14-arm64-3.8/ros_comm/utilities/roslz4
creating build/temp.macosx-10.14-arm64-3.8/ros_comm/utilities/roslz4/src
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -DXXH_NAMESPACE=ROSLZ4_ -Iinclude -Iroscpp_core/cpp_common/include -I/Users/cmauceri/Workspace/run-mgmt/jupyter_venv/include -I/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8 -c ros_comm/utilities/roslz4/src/_roslz4module.c -o build/temp.macosx-10.14-arm64-3.8/ros_comm/utilities/roslz4/src/_roslz4module.o -Wno-strict-prototypes -Wno-missing-field-initializers -Wno-unused-variable -Wno-strict-aliasing
In file included from ros_comm/utilities/roslz4/src/_roslz4module.c:37:
include/roslz4/lz4s.h:38:10: fatal error: 'lz4.h' file not found
#include <lz4.h>
^~~~~~~
1 error generated.
error: command 'clang' failed with exit status 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> roslz4
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
Do I need to add the location of lz4 headers to an environment variable? How can I get pip to find the header?
After doing brew install lz4 the following (from this SO post by rgov) worked for me without the need of any source code changes:
CFLAGS="-I$(brew --prefix lz4)/include" \
LDFLAGS="-L$(brew --prefix lz4)/lib" \
pip install roslz4 --extra-index-url https://rospypi.github.io/simple/
Answer from a coworker:
My solution was to download the roslz4 tarball and manually add the include folders and library symbols into the setup config, then run python setup.py install
Here are the first few lines of my setup.py file (which includes my addition to include and lib)
import platform
from setuptools import setup, Extension
extra_compile_args = []
include_dirs = [
"include",
"roscpp_core/cpp_common/include",
"/usr/local/Cellar/lz4/1.9.3/include",
]
libraries = ["lz4"]
library_dirs = ["/usr/local/Cellar/lz4/1.9.3/lib"]
define_macros = [
("XXH_NAMESPACE", "ROSLZ4_"),
]
My changes are the lines with "Cellar" and "library_dirs"

Categories

Resources