fatal error: openjpeg.h: No such file or directory - linux

I'm trying to install OpenCV4 on Debian 10 server. I followed the official docs , but compiling I get
In file included from /root/opencv/modules/imgcodecs/src/grfmt_jpeg2000_openjpeg.cpp:10:
/root/opencv/modules/imgcodecs/src/grfmt_jpeg2000_openjpeg.hpp:13:10: fatal error: openjpeg.h: No such file or directory
#include <openjpeg.h>
^~~~~~~~~~~~
compilation terminated.
I installed openjpeg separately from source (this guide)
But it did not help.
I also tried to install opencv4 using pip3 install opencv-python but again, I failed:
An error occurred while building with CMake.
Command:
cmake --build . --target install --config Release --
Install target:
install
Source directory:
/tmp/pip-install-58cut84q/cmake
Working directory:
/tmp/pip-install-58cut84q/cmake/_skbuild/linux-x86_64-3.7/cmake-build
Please check the install target is valid and see CMake's output for more information.
---------------------------------------- Command "/usr/bin/python3 -u -c "import setuptools,
tokenize;file='/tmp/pip-install-58cut84q/cmake/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-wvupk349/install-record.txt --single-version-externally-managed --prefix /tmp/pip-build-env-uyj03w3k --compile" failed with error code 1 in
/tmp/pip-install-58cut84q/cmake/
So I'm left clueless and appreciate your help.

Related

Unable to execute 'gcc' : No such file or directory when installing apache superset on IBM i 7.3

I am trying to install apache superset from scratch and following recommendation to use virtual environment (venv) and then ran command python3 -m pip install apache-superset. Getting the following error:
Complete output from command /home/XXX/venv/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-z7
by2m2a/cffi/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-fqli9xso/install-record.txt --single-version-externally-managed --prefix /
tmp/pip-build-env-u0f6md7n --compile --install-headers /home/SHAWNW/venv/include/site/python3.6/cffi:
unable to execute 'gcc': No such file or directory
unable to execute 'gcc': No such file or directory
No working compiler found, or bogus compiler options passed to
the compiler from Python's standard "distutils" module. See
the error messages above. Likely, the problem is not related
to CFFI but generic to the setup.py of any Python package that
tries to compile C code. (Hints: on OS/X 10.8, for errors about
-mno-fused-madd see http://stackoverflow.com/questions/22313407/
Otherwise, see https://wiki.python.org/moin/CompLangPython or
the IRC channel #python on irc.freenode.net.)

Failed building wheel for GoogleAppEngineCloudStorageClient

I get this error when trying to install google cloud:
Failed building wheel for GoogleAppEngineCloudStorageClient
Running setup.py clean for GoogleAppEngineCloudStorageClient
Failed to build GoogleAppEngineCloudStorageClient
Installing collected packages: GoogleAppEngineCloudStorageClient
Running setup.py install for GoogleAppEngineCloudStorageClient ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-jZCvYX/GoogleAppEngineCloudStorageClient/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-LgTihN-record/install-record.txt --single-version-externally-managed --compile --user --prefix= --home=/tmp/tmprq5a80:
running install
error: can't combine user with prefix, exec_prefix/home, or install_(plat)base
this is installed on the /lib folder, I also made a requirements.txt
as well as the appengine_config.py.
Also I am using python 2.7, on linux
use:
pip install --user --install-option="--prefix=" <package_name>
However, better to install the whole Google Cloud SDK as it includes: command line tools (gcloud, gsutil, bq) in addition to client libraries.

How to fix a pip install error of osqp for python3.4?

The error looks like the following:
Installing collected packages: osqp
Running setup.py install for osqp ... error
...
...
...
copying module/codegen/sources/src/qdldl_interface.c -> build/lib.linux-x86_64-3.4/osqp/codegen/sources/src
copying module/codegen/sources/src/scaling.c -> build/lib.linux-x86_64-3.4/osqp/codegen/sources/src
copying module/codegen/sources/src/util.c -> build/lib.linux-x86_64-3.4/osqp/codegen/sources/src
running build_ext
CMake Error at CMakeLists.txt:2 (cmake_minimum_required):
CMake 3.2 or higher is required. You are running version 2.8.12.2
-- Configuring incomplete, errors occurred!
Error: could find generator in Cache
error: [Errno 2] No such file or directory: 'osqp_sources/build/out/libosqp.a'
----------------------------------------
Command "/home/zhongzi/code/.virtualenvs/ml3.4/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-tzdyeutc/osqp/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-f76ehs0l/install-record.txt --single-version-externally-managed --compile --install-headers /home/zhongzi/code/.virtualenvs/ml3.4/include/site/python3.4/osqp" failed with error code 1 in /tmp/pip-install-tzdyeutc/osqp/
The system is 14.04.1-Ubuntu. Any help will be appreciated!
Adding the answer here so that the question can be resolved. Update the "cmake" package, for example, in Ubuntu:
sudo apt-get install cmake
This was indicated by the error output: "CMake 3.2 or higher is required. You are running version 2.8.12.2".

How to install ChainerCV

I am using Win 10. I tried installing ChainerCV through pip. I want to know what can be done to solve this problem. Also what is behind this issue: not having VisualStudio, dependency issues or any other thing. Is having CUDA necessary to run ChainerCV?
P.S I have chainer and other dependencies running properly.
Stack Trace:
copying chainercv\utils\bbox_nms_gpu_post.c -> build\lib.win-amd64-3.5\chainercv\utils\bbox
running build_ext
building 'chainercv.utils.bbox._nms_gpu_post' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
Failed building wheel for chainercv
Running setup.py clean for chainercv
Failed to build chainercv
Installing collected packages: chainercv
Running setup.py install for chainercv ... error
Complete output from command c:\users\dell\appdata\local\programs\python\python35\python.exe -u -c "import setuptools, tokenize;file='C:\Users\Dell\AppData\Local\Temp\pip-install-qjghd97d\chainercv\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record C:\Users\Dell\AppData\Local\Temp\pip-record-cl7d0zn_\install-record.txt --single-version-externally-managed --compile:
building 'chainercv.utils.bbox._nms_gpu_post' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
----------------------------------------
Command "c:\users\dell\appdata\local\programs\python\python35\python.exe -u -c "import setuptools, tokenize;file='C:\Users\Dell\AppData\Local\Temp\pip-install-qjghd97d\chainercv\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record C:\Users\Dell\AppData\Local\Temp\pip-record-cl7d0zn_\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Dell\AppData\Local\Temp\pip-install-qjghd97d\chainercv\
are you trying on admin ? else please follow below steps
open cmd using Ctrl + r then type cmd and try to install from there
pip install ChainerCV

pypy3 install Cryptography failed

I tried to install Cryptography through:
lsn#lsn-Super-Server:~/pypy/pypy3-v6.0.0-linux64/bin$ ./pypy3 -m pip install PyMySQL
But, it failed with the comments:
running egg_info
writing src/cryptography.egg-info/PKG-INFO
writing dependency_links to src/cryptography.egg-info/dependency_links.txt
writing requirements to src/cryptography.egg-info/requires.txt
writing top-level names to src/cryptography.egg-info/top_level.txt
reading manifest file 'src/cryptography.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
no previously-included directories found matching 'docs/_build'
warning: no previously-included files matching '*' found under directory 'vectors'
writing manifest file 'src/cryptography.egg-info/SOURCES.txt'
running build_ext
generating cffi module 'build/temp.linux-x86_64-3.5/_padding.c'
creating build/temp.linux-x86_64-3.5
generating cffi module 'build/temp.linux-x86_64-3.5/_constant_time.c'
generating cffi module 'build/temp.linux-x86_64-3.5/_openssl.c'
building '_openssl' extension
creating build/temp.linux-x86_64-3.5/build
creating build/temp.linux-x86_64-3.5/build/temp.linux-x86_64-3.5
cc -pthread -DNDEBUG -O2 -Qunused-arguments -fPIC -I/home/lsn/pypy/pypy3-v6.0.0-linux64/include -c build/temp.linux-x86_64-3.5/_openssl.c -o build/temp.linux-x86_64-3.5/build/temp.linux-x86_64-3.5/_openssl.o -Wconversion -Wno-error=sign-conversion
cc: error: unrecognized command line option ‘-Qunused-arguments’; did you mean ‘-Wunused-parameter’?
error: command 'cc' failed with exit status 1
----------------------------------------
Command "/home/lsn/pypy/pypy3-v6.0.0-linux64/bin/pypy3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-87db0m7x/Cryptography/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-9zd03ixf/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-87db0m7x/Cryptography/
I faced the same error while installing paypalrestsdk for python3 and I found the solution that needs to install or update python-openssl for that.
Try below commands, it's working for me.
For python2
sudo apt-get install python-openssl
For python3
sudo apt-get install python3-openssl
Hope it works for you too.

Resources