imagecodecs python library won't install - python

I was trying to install the python scikit-image library using pip on a Jetson Xavier, and I got an extremely long error message indicating that it had failed to build the wheel for the "imagecodecs" library. I tried to install imagecodecs by itself and received a similar error message.
After some looking around, I found this question, and the error is identical to my own. However, the solution of updating pip did not fix the issue.
Error Message:
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-iu5szk39/imagecodecs/setup.py'"'"'; __file__='"'"'/tmp/pip-install-iu5szk39/imagecodecs/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-5h3fo15u
cwd: /tmp/pip-install-iu5szk39/imagecodecs/
...
At top level:
imagecodecs/_tiff.c:10261:47: warning: ‘__pyx_f_11imagecodecs_5_tiff_memtif_new’ defined but not used [-Wunused-function]
static __pyx_t_11imagecodecs_5_tiff_memtif_t *__pyx_f_11imagecodecs_5_tiff_memtif_new(toff_t __pyx_v_size, toff_t __pyx_v_inc) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: command 'aarch64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for imagecodecs
Running setup.py clean for imagecodecs
Failed to build imagecodecs
Installing collected packages: imagecodecs
Running setup.py install for imagecodecs ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-iu5szk39/imagecodecs/setup.py'"'"'; __file__='"'"'/tmp/pip-install-iu5szk39/imagecodecs/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-ttclns6b/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.6/imagecodecs
cwd: /tmp/pip-install-iu5szk39/imagecodecs/
...
At top level:
imagecodecs/_tiff.c:10261:47: warning: ‘__pyx_f_11imagecodecs_5_tiff_memtif_new’ defined but not used [-Wunused-function]
static __pyx_t_11imagecodecs_5_tiff_memtif_t *__pyx_f_11imagecodecs_5_tiff_memtif_new(toff_t __pyx_v_size, toff_t __pyx_v_inc) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: command 'aarch64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-iu5szk39/imagecodecs/setup.py'"'"'; __file__='"'"'/tmp/pip-install-iu5szk39/imagecodecs/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-ttclns6b/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.6/imagecodecs Check the logs for full command output.

Try upgrading pip using this command.
sudo -H pip3 install --upgrade pip
sudo -H pip2 install --upgrade pip
pip should now be on the latest version.
$ pip3 --version
pip 20.1.1 from ...
Then install using pip3
pip3 install scikit-image

Related

"ERROR: CMake must be installed to build dlib" when installing face_recognition

I'm facing this error while installing face_recognition in a virtualenv with Python 3.8.10 on Ubuntu 20.04.
ERROR: Failed building wheel for face-recognition-models
Running setup.py clean for face-recognition-models
Failed to build dlib face-recognition-models
Installing collected packages: Click, numpy, dlib, face-recognition-models, face-recognition
Running setup.py install for dlib ... error
ERROR: Command errored out with exit status 1:
command: '/home/badrelden/Desktop/test python sound/venv/bin/python3' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-tai2snq9/dlib/setup.py'"'"'; __file__='"'"'/tmp/pip-install-tai2snq9/dlib/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-bhy0sde6/install-record.txt --single-version-externally-managed --compile --install-headers '/home/badrelden/Desktop/test python sound/venv/include/site/python3.8/dlib'
cwd: /tmp/pip-install-tai2snq9/dlib/
Complete output (8 lines):
running install
running build
running build_py
package init file 'tools/python/dlib/__init__.py' not found (or not a regular file)
running build_ext
ERROR: CMake must be installed to build dlib
----------------------------------------
ERROR: Command errored out with exit status 1: '/home/badrelden/Desktop/test python sound/venv/bin/python3' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-tai2snq9/dlib/setup.py'"'"'; __file__='"'"'/tmp/pip-install-tai2snq9/dlib/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-bhy0sde6/install-record.txt --single-version-externally-managed --compile --install-headers '/home/badrelden/Desktop/test python sound/venv/include/site/python3.8/dlib' Check the logs for full command output.
ERROR: CMake must be installed to build dlib
This is the key part of the error message. You need to install cmake, which can be done by running sudo apt install cmake on Debian-based systems, including Ubuntu. After cmake is installed, you can rerun the pip install command.

When i try to build wheel for dlib it says that i need cmake in order to do so. But i already have Cmake installed

When i try and install dlib using pip (pip install dlib) it says this:
ERROR: Command errored out with exit status 1:
command: 'C:\Users\curry\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\curry\\AppData\\Local\\Temp\\pip-install-qhiyfkci\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\curry\\AppData\\Local\\Temp\\pip-install-qhiyfkci\\dlib\\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\curry\AppData\Local\Temp\pip-record-ckv17yp4\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\curry\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\Include\dlib'
cwd: C:\Users\curry\AppData\Local\Temp\pip-install-qhiyfkci\dlib\
Complete output (8 lines):
running install
running build
running build_py
package init file 'tools\python\dlib\__init__.py' not found (or not a regular file)
running build_ext
ERROR: CMake must be installed to build dlib
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\curry\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\curry\\AppData\\Local\\Temp\\pip-install-qhiyfkci\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\curry\\AppData\\Local\\Temp\\pip-install-qhiyfkci\\dlib\\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\curry\AppData\Local\Temp\pip-record-ckv17yp4\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\curry\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\Include\dlib' Check the logs for full command output.
I have tried to do pip install cmake and then pip install dlib but it did not work
Also for clarification i have installed Visual Studio community and use python 1.9. I use Windows 10
Thank you for Helping

Python Dbus Error while installing through pip

python -m pip install dbus-python
Collecting dbus-python
Using cached dbus-python-1.2.16.tar.gz (576 kB)
Using legacy 'setup.py install' for dbus-python, since package 'wheel' is not installed.
Installing collected packages: dbus-python
Running setup.py install for dbus-python ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\pure8\AppData\Local\Programs\Python\Python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\pure8\\AppData\\Local\\Temp\\pip-install-zphzgd3p\\dbus-python\\setup.py'"'"'; __file__='"'"'C:\\Users\\pure8\\AppData\\Local\\Temp\\pip-install-zphzgd3p\\dbus-python\\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\pure8\AppData\Local\Temp\pip-record-l_6vpx3k\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\pure8\AppData\Local\Programs\Python\Python38\Include\dbus-python'
cwd: C:\Users\pure8\AppData\Local\Temp\pip-install-zphzgd3p\dbus-python\
Complete output (5 lines):
running install
running build
creating C:\Users\pure8\AppData\Local\Temp\pip-install-zphzgd3p\dbus-python\build
creating C:\Users\pure8\AppData\Local\Temp\pip-install-zphzgd3p\dbus-python\build\temp.win-amd64-3.8
error: [WinError 193] %1 is not a valid Win32 application
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\pure8\AppData\Local\Programs\Python\Python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\pure8\\AppData\\Local\\Temp\\pip-install-zphzgd3p\\dbus-python\\setup.py'"'"'; __file__='"'"'C:\\Users\\pure8\\AppData\\Local\\Temp\\pip-install-zphzgd3p\\dbus-python\\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\pure8\AppData\Local\Temp\pip-record-l_6vpx3k\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\pure8\AppData\Local\Programs\Python\Python38\Include\dbus-python' Check the logs for full command output.
every time I try to install dbus it gives me an error, I tried installing 32 bit and 64 bit of new python updates, and they are added to PATH, but that didn't help to install dbus. Dbus is required for notify2.
I had met the same problem.
Perhaps it's not recommended to use dbus-python on the Windows.
I just move the folder /usr/local/lib/python2.7/dist-packages/dbus (Linux) to the Python2.7 folder (Windows).
And I can see the dbus in the VScode by Ctrl + mouse(left).

Pip3 can't install face_recognition on macOS

On macOS I ran this command in Terminal:
sudo pip3 install face_recognition
It started installing and then threw this error:
ERROR: Command errored out with exit status 1:
/Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 -u -c
'import sys, setuptools, tokenize; sys.argv[0] =
'"'"'/private/tmp/pip-install-75ks5d9l/dlib/setup.py'"'"';
file='"'"'/private/tmp/pip-install-75ks5d9l/dlib/setup.py'"'"';f=getattr(tokenize,
'"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"',
'"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))'
install --record /private/tmp/pip-record-bze0mci9/install-record.txt
--single-version-externally-managed --compile --install-headers /Library/Frameworks/Python.framework/Versions/3.8/include/python3.8/dlib
Check the logs for full command output.
I read a suggestion about installing dlib first which also threw an error. How can I fix this?
First install cmake using following command:
pip3 install cmake

Command error when downloading 'main' module

When encountering this problem, I had tried to download the 'main' module from both the command prompt and the PowerShell. However, the same error result was shown. How can I solve this problem? This is the error message:
Collecting main
Using cached https://files.pythonhosted.org/packages/1c/f4/445fbd86d9ebd133a03a263482f72dd539ccc90a0c29693222903e5e145e/main-0.1.tar.gz
Installing collected packages: main
Running setup.py install for main ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Python 3.8.1\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\asuit\\AppData\\Local\\Temp\\pip-install-9tqrshss\\main\\setup.py'"'"'; __file__='"'"'C:\\Users\\asuit\\AppData\\Local\\Temp\\pip-install-9tqrshss\\main\\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\asuit\AppData\Local\Temp\pip-record-oc5gc9jc\install-record.txt' --single-version-externally-managed --compile --user --prefix=
cwd: C:\Users\asuit\AppData\Local\Temp\pip-install-9tqrshss\main\
Complete output (6 lines):
running install
running build
running build_scripts
creating build
creating build\scripts-3.8
error: file 'C:\Users\asuit\AppData\Local\Temp\pip-install-9tqrshss\main\main' does not exist
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Python 3.8.1\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\asuit\\AppData\\Local\\Temp\\pip-install-9tqrshss\\main\\setup.py'"'"'; __file__='"'"'C:\\Users\\asuit\\AppData\\Local\\Temp\\pip-install-9tqrshss\\main\\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\asuit\AppData\Local\Temp\pip-record-oc5gc9jc\install-record.txt' --single-version-externally-managed --compile --user --prefix= Check the logs for full command output.
The pip commands that I used are python -m pip install --user main for Command Prompt and pip install main for Windows PowerShell

Categories

Resources