Cannot install python package due to cmake error - python

I am trying to install the disptools package by doing pip install disptools in my terminal.
The disptools package is linked here https://github.com/m-pilia/disptools.
It gives me a long error message during the installation with the main error displayed below.
Building wheel for disptools (setup.py) ... error
ERROR: Command errored out with exit status 1:
...
CMake Error:
Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS OpenMP_C_LIB_NAMES)`
It also includes this in the error:
File "/Users/name/anaconda3/lib/python3.6/subprocess.py", line 311, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '/private/var/folders/6p/16591qb93vs76dysmldcz8140000gn/T/pip-install-vn5twf6v/disptools', '-DDISPTOOLS_DEBUG=OFF', '-DDISPTOOLS_OPT=OFF', '-DDISPTOOLS_VERBOSE=ON', '-DDISPTOOLS_LOW_ORDER_PD=OFF', '-DDISPTOOLS_DOUBLE=OFF', '-DDISPTOOLS_CUDA_SUPPORT=OFF', '-DDISPTOOLS_CUDA_ERROR_CHECK=ON', '-DDISPTOOLS_CUDA_ERROR_CHECK_SYNC=ON', '-DDISPTOOLS_PYTHON_SUPPORT=ON', '-DDISPTOOLS_PYTHON_C_MODULE_NAME=_disptools', '-DCMAKE_BUILD_TYPE=Release', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=/private/var/folders/6p/16591qb93vs76dysmldcz8140000gn/T/pip-install-vn5twf6v/disptools/build/lib.macosx-10.9-x86_64-3.6', '-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE=build/temp.macosx-10.9-x86_64-3.6', '-DPYTHON_EXECUTABLE=/Users/name/anaconda3/bin/python3']'
returned non-zero exit status 1.
I have looked everywhere online but I couldn't really find any helpful resources for solving this problem.
Would really appreciate it if someone can help.

With commands, python -m pip install disptools you try to download, compile and install the disptools.
Compilation step fails with a CMake error that tell that it failed to find library OpenMP. You can install it on a Ubuntu/Debian distribution with
sudo apt install libomp-dev
After this, you can launch again the pip command.
I hope you will meet all compilation requirements.

If you are using Anaconda Prompt (recommended),
conda install -c conda-forge dlib

Related

Python - Installation build wheel error when installing from local directory

I want to install a package from GitHub that uses Cython (https://github.com/mlysy/kalmantv). I cloned the package locally, and after trying to install it with pip install ., I'm getting the following error:
DEPRECATION: A future pip version will change local packages to be built in-place without first copying to a temporary directory. We recommend you use --use-feature=in-tree-build to test your packages with this new behavior before it becomes the default.
pip 21.3 will remove support for this functionality. You can find discussion regarding this at https://github.com/pypa/pip/issues/7555.
Processing /Users/me/Downloads/kalmantv
Installing build dependencies ... done
Getting requirements to build wheel ... error
ERROR: Command errored out with exit status 1:
command: /Users/me/.pyenv/versions/3.8.3/bin/python3.8 /Users/me/.pyenv/versions/3.8.3/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py get_requires_for_build_wheel /var/folders/g1/0pjsd_bs24jgccrd6g0lzfvc0000gn/T/tmpxmrdlgnk
cwd: /Users/me/Downloads/kalmantv
Complete output (6 lines):
running egg_info
writing kalmantv.egg-info/PKG-INFO
writing dependency_links to kalmantv.egg-info/dependency_links.txt
writing requirements to kalmantv.egg-info/requires.txt
writing top-level names to kalmantv.egg-info/top_level.txt
error: package directory 'eigen-3.3.7' does not exist
----------------------------------------
WARNING: Discarding file:///Users/me/Downloads/kalmantv. Command errored out with exit status 1: /Users/me/.pyenv/versions/3.8.3/bin/python3.8 /Users/me/.pyenv/versions/3.8.3/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py get_requires_for_build_wheel /var/folders/g1/0pjsd_bs24jgccrd6g0lzfvc0000gn/T/tmpxmrdlgnk Check the logs for full command output.
ERROR: Command errored out with exit status 1: /Users/me/.pyenv/versions/3.8.3/bin/python3.8 /Users/me/.pyenv/versions/3.8.3/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py get_requires_for_build_wheel /var/folders/g1/0pjsd_bs24jgccrd6g0lzfvc0000gn/T/tmpxmrdlgnk Check the logs for full command output.
I tried adding --use-feature=in-tree-build from the deprecation warning but still got the error (without the initial warning).
I saw a number of suggestions such as using pip install --upgrade pip setuptools wheel, but nothing is doing the trick. I would guess that this has a simple fix but this stuff is a little over my head and I don't want to break anything else.
What do I need to do to safely correct this issue without causing other problems?
The setup.py file has the following lines:
# path to eigen library
EIGEN_PATH = r"eigen-3.3.7"
Strangely, it seems to expect the Eigen header library to be present at that location. You can install the library with brew install eigen, or sudo apt install libeigen3-dev. Note that this may not install version 3.3.7 of the library, which the project expects. I don't know if using a newer version would cause any issues.
If you want to install version 3.3.7, you can build and install it from source with the following link by following these instructions:
https://gitlab.com/libeigen/eigen/-/releases/3.3.7
Once that's done, change to the project directory, and create a symlink to the Eigen library:
If installed with brew: ln -s /usr/local/Cellar/eigen/*/include/eigen3 eigen-3.3.7
If installed with apt: ln -s /usr/include/eigen3 eigen-3.3.7
If installed from source: /usr/local/include/eigen3 eigen-3.3.7
Once the Eigen library has been installed and made available at ./eigen-3.3.7, pip install . should work, but for good measures you should run the following command first:
pip install -U pip setuptools wheel; pip install -U cython
Refer to Catalina C++: Using <cmath> headers yield error: no member named 'signbit' in the global namespace if you run into an error like: error: no member named 'signbit' in the global namespace.

How do I resolve error installing manim using poetry?

I want to setup manim community repo using poetry. I ran the command "poetry install". I am getting the following error.
Python 3.8.5, Pip 20.2.4
EnvCommandError
Command D:\manim\venv\Scripts\pip.exe install --no-deps file:///C:/Users/abc/AppData/Local/pypoetry/Cache/artifacts/03/ee/1a/ee5da5d7b449da38c4e593ecc6a57342de04222cd7fbe5b126a4e3f
df0/pangocairocffi-0.3.2.tar.gz errored with the following return code 1, and output:
Processing c:\users\abc\appdata\local\pypoetry\cache\artifacts\03\ee\1a\ee5da5d7b449da38c4e593ecc6a57342de04222cd7fbe5b126a4e3fdf0\pangocairocffi-0.3.2.tar.gz
ERROR: Command errored out with exit status 1:
...
...
...
OSError: dlopen() failed to load a library: pango / pango-1 / pango-1.0 / pango-1.0-0
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Use poetry only when you want to contribute to Manim Community itself, or else don't use it.
Now let's, come to the error. What the error, say's is it can't find some shared libraries. According to the docs, it says, you have to install Pango for it to work.
Possibly, you may have missed this step.
https://docs.manim.community/en/latest/installation/win.html#pango-installation

Python - pip install - ERROR: A GDAL API version must be specified

I try to install the module contextily to use it on Python.
I went on Anaconda Prompt as admin, and wrote : pip install contextily
I get this error and I have still not found what I have to do :
Getting requirements to build wheel ... error
ERROR: Command errored out with exit status 1:
command:'C:\Users\elise\AppData\Local\Continuum\anaconda3\python.exe'
'C:\Users\elise\AppData\Local\Continuum\anaconda3\lib\site-packages\pip_vendor\pep517_in_process.py'
get_requires_for_build_wheel
'C:\Users\elise\AppData\Local\Temp\tmpwkajt8gq'
cwd: C:\Users\elise\AppData\Local\Temp\pip-install-ysq517b2\rasterio
Complete output (2 lines):
INFO:root:Building on Windows requires extra options to setup.py to locate needed GDAL files. More
information is available in the README.
ERROR: A GDAL API version must be specified. Provide a path to gdal-config using a GDAL_CONFIG
environment variable or use a GDAL_VERSION environment variable.
ERROR: Command errored out with exit status 1:
'C:\Users\elise\AppData\Local\Continuum\anaconda3\python.exe'
'C:\Users\elise\AppData\Local\Continuum\anaconda3\lib\site-packages\pip_vendor\pep517_in_process.py'
get_requires_for_build_wheel
'C:\Users\elise\AppData\Local\Temp\tmpwkajt8gq' Check the logs for full command output.
(I tried to deal with environment variable like there : No module named ogr but it doesn't help. Neither these solutions : Error installing geopandas:" A GDAL API version must be specified " in Anaconda)
Try running the following command using anaconda prompt:
conda install -c conda-forge contextily
You can find the documentation here.
I achieved to install packages that I couldn't before, by creating a virtual environment and working on it (it's simple on Anaconda Navigator : Environments/Create, and then using the right part of the navigator to install new packages)

Error while trying to build a .whl file using python setup.py install --static-link with cygwin

I was trying to build a .whl file using python setup.py install --static-link using cygwin but this error appears: error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\bin\HostX86\x64\link.exe' failed with exit status 1120
The files i was trying to build were from here : https://github.com/intxcc/pyaudio_portaudio
I followed the same exact commands using cygwin but i wasn't able to do python setup.py install --static-link.Also the same thing occured weirdly enough when i tried to pip install pyaudio.So i did pipwin install pyaudio and it solved my problems in that moment.But now the error remains with a different command.
Anyone know what could be the issue?Thanks

ValueError ['path'] failed building wheel for python-crfsuite

I am trying to install python-CRFSuite using this command:
pip install python-crfsuite
Before this I use
SET VS90COMNTOOLS=%VS140COMNTOOLS%
since I am using Visual studio 2015. After running the installation command i get the following error:
File "C:\Python34\lib\distutils\msvc9compiler.py", line 287, in query_vcvarsall
raise ValueError(str(list(result.keys())))
ValueError: ['path']
----------------------------------------
Failed building wheel for python-crfsuite
If someone has faced same problem or has installed crfsuite on windows has knowledge about this then please help me solve this error
I tried another workaround. Installed Mingw from this link http://sourceforge.net/projects/mingw/files and then used this link http://versioneye.com/python/python-crfsuite/0.8.1 to install pycrfsuite using the command : pip install https://pypi.python.org/packages/source/p/python-crfsuite/python-crfsuite-0.8.1.‌​tar.gz
and it worked!! I don't understand exactly why though

Categories