Error in installing face_recognition library - python-3.x

How to solve the below mentioned cmake error while installing the face_recognition library?
Collecting face_recognition
Using cached face_recognition-1.2.1-py2.py3-none-any.whl
Requirement already satisfied: face-recognition-models>=0.3.0 in ./anaconda/lib/python3.6/site-packages (from face_recognition)
Requirement already satisfied: Pillow in ./anaconda/lib/python3.6/site-packages (from face_recognition)
Requirement already satisfied: Click>=6.0 in ./anaconda/lib/python3.6/site-packages (from face_recognition)
Requirement already satisfied: scipy>=0.17.0 in ./anaconda/lib/python3.6/site-packages (from face_recognition)
Collecting dlib>=19.7 (from face_recognition)
Using cached dlib-19.10.0.tar.gz
Requirement already satisfied: numpy in ./anaconda/lib/python3.6/site-packages (from face_recognition)
Requirement already satisfied: olefile in ./anaconda/lib/python3.6/site-packages (from Pillow->face_recognition)
Building wheels for collected packages: dlib
Running setup.py bdist_wheel for dlib ... error
Complete output from command /Users/muralidharan/anaconda/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/xz/rcv9f_6x41gcvhrqzsd6mrxw0000gn/T/pip-build-5zqyoigf/dlib/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 /var/folders/xz/rcv9f_6x41gcvhrqzsd6mrxw0000gn/T/tmpw6lzrrukpip-wheel- --python-tag cp36:
running bdist_wheel
running build
running build_py
package init file 'dlib/__init__.py' not found (or not a regular file)
running build_ext
Invoking CMake setup: 'cmake /private/var/folders/xz/rcv9f_6x41gcvhrqzsd6mrxw0000gn/T/pip-build-5zqyoigf/dlib/tools/python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/private/var/folders/xz/rcv9f_6x41gcvhrqzsd6mrxw0000gn/T/pip-build-5zqyoigf/dlib/build/lib.macosx-10.7-x86_64-3.6 -DPYTHON_EXECUTABLE=/Users/muralidharan/anaconda/bin/python -DCMAKE_BUILD_TYPE=Release'
error: [Errno 2] No such file or directory: 'cmake'
----------------------------------------
Failed building wheel for dlib
Running setup.py clean for dlib
Failed to build dlib
Installing collected packages: dlib, face-recognition
Running setup.py install for dlib ... error
Complete output from command /Users/muralidharan/anaconda/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/xz/rcv9f_6x41gcvhrqzsd6mrxw0000gn/T/pip-build-5zqyoigf/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 /var/folders/xz/rcv9f_6x41gcvhrqzsd6mrxw0000gn/T/pip-qhc3clwr-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
package init file 'dlib/__init__.py' not found (or not a regular file)
running build_ext
Invoking CMake setup: 'cmake /private/var/folders/xz/rcv9f_6x41gcvhrqzsd6mrxw0000gn/T/pip-build-5zqyoigf/dlib/tools/python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/private/var/folders/xz/rcv9f_6x41gcvhrqzsd6mrxw0000gn/T/pip-build-5zqyoigf/dlib/build/lib.macosx-10.7-x86_64-3.6 -DPYTHON_EXECUTABLE=/Users/muralidharan/anaconda/bin/python -DCMAKE_BUILD_TYPE=Release'
error: [Errno 2] No such file or directory: 'cmake'
----------------------------------------
Command "/Users/muralidharan/anaconda/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/xz/rcv9f_6x41gcvhrqzsd6mrxw0000gn/T/pip-build-5zqyoigf/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 /var/folders/xz/rcv9f_6x41gcvhrqzsd6mrxw0000gn/T/pip-qhc3clwr-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/xz/rcv9f_6x41gcvhrqzsd6mrxw0000gn/T/pip-build-5zqyoigf/dlib/

As to me, I install face_recognition in ubuntu16 python2.7, I write a shell to install it.
#!/bin/bash
# This shell script install face_recognition in ubuntu16 python2.7
apt-get -y install git
apt-get -y install cmake
# install dlib without cuda
git clone https://github.com/davisking/dlib.git
cd dlib
mkdir build; cd build; cmake .. ; cmake --build .
# install dlib python interface
cd -
apt-get -y install python-setuptools
apt-get -y install python-dev
python setup.py install
# install face_recognition
apt-get -y install python-pip
pip install face_recognition

error: [Errno 2] No such file or directory: 'cmake'
I ran into the same problem recently, I resolved it downloading CMAKE.
Here is the link to download it for each OS

Related

Unable to install fitsne in colab

I am trying to install fitsne in colab. Recommended way for installation is:
conda config --add channels conda-forge #if not already in your channels. Needed for fftw.
conda install cython numpy fftw
pip install fitsne
Yet, I get following error:
Requirement already satisfied: numpy in /usr/local/lib/python3.7/dist-packages (from fitsne) (1.19.5)
Requirement already satisfied: cython in /usr/local/lib/python3.7/dist-packages (from fitsne) (0.29.22)
Building wheels for collected packages: fitsne
Building wheel for fitsne (setup.py) ... error
ERROR: Failed building wheel for fitsne
Running setup.py clean for fitsne
Failed to build fitsne
Installing collected packages: fitsne
Running setup.py install for fitsne ... error
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ezkx1s2e/fitsne/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ezkx1s2e/fitsne/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-uzkyz06_/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.
Can someone please explain how to fix such an error in colab?
I solved it using this gist
!git clone https://github.com/KlugerLab/FIt-SNE.git
!wget http://www.fftw.org/fftw-3.3.8.tar.gz
!tar -xf fftw-3.3.8.tar.gz
!cd fftw-3.3.8
!./fftw-3.3.8/configure
!make
!make install
!g++ -std=c++11 -O3 FIt-SNE/src/sptree.cpp FIt-SNE/src/tsne.cpp FIt-SNE/src/nbodyfft.cpp -o FIt-SNE/bin/fast_tsne -pthread -lfftw3 -lm -Wno-address-of-packed-member
import sys; sys.path.append('FIt-SNE/')
from fast_tsne import fast_tsne

how to install pyearth in google colab?

This used to work for me, but since two days now i am getting this issue:
pip install sklearn-contrib-py-earth
Collecting sklearn-contrib-py-earth
Using cached https://files.pythonhosted.org/packages/f8/c4/53a24835bafac880036446cc13839471a025b41de1436543f30d15d846c1/sklearn-contrib-py-earth-0.1.0.tar.gz
Requirement already satisfied: scipy>=0.16 in /usr/local/lib/python3.7/dist-packages (from sklearn-contrib-py-earth) (1.4.1)
Requirement already satisfied: scikit-learn>=0.16 in /usr/local/lib/python3.7/dist-packages (from sklearn-contrib-py-earth) (0.22.2.post1)
Requirement already satisfied: six in /usr/local/lib/python3.7/dist-packages (from sklearn-contrib-py-earth) (1.15.0)
Requirement already satisfied: numpy>=1.13.3 in /usr/local/lib/python3.7/dist-packages (from scipy>=0.16->sklearn-contrib-py-earth) (1.19.5)
Requirement already satisfied: joblib>=0.11 in /usr/local/lib/python3.7/dist-packages (from scikit-learn>=0.16->sklearn-contrib-py-earth) (1.0.1)
Building wheels for collected packages: sklearn-contrib-py-earth
Building wheel for sklearn-contrib-py-earth (setup.py) ... error
ERROR: Failed building wheel for sklearn-contrib-py-earth
Running setup.py clean for sklearn-contrib-py-earth
Failed to build sklearn-contrib-py-earth
Installing collected packages: sklearn-contrib-py-earth
Running setup.py install for sklearn-contrib-py-earth ... error
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-s6vbb2vf/sklearn-contrib-py-earth/setup.py'"'"'; __file__='"'"'/tmp/pip-install-s6vbb2vf/sklearn-contrib-py-earth/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-j66r3m9x/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.
This worked for me:
pip install git+https://github.com/scikit-learn-contrib/py-earth#v0.2dev
Try this:
git clone git://github.com/scikit-learn-contrib/py-earth.git
cd py-earth
python setup.py install --cythonize

installing openbabel3 with pip

I tried pip install openbabel --log log_file and I got the following error:
Collecting openbabel
Using cached openbabel-2.4.1.tar.gz (74 kB)
Building wheels for collected packages: openbabel
Building wheel for openbabel (setup.py) ... error
ERROR: Failed building wheel for openbabel
Running setup.py clean for openbabel
Failed to build openbabel
Installing collected packages: openbabel
Running setup.py install for openbabel ... error
ERROR: Command errored out with exit status 1: /usr/local/opt/python/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/59/zn1rl7b13tqc7t2njskzp6th0000gn/T/pip-install-d2aqd_xf/openbabel/setup.py'"'"'; __file__='"'"'/private/var/folders/59/zn1rl7b13tqc7t2njskzp6th0000gn/T/pip-install-d2aqd_xf/openbabel/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/var/folders/59/zn1rl7b13tqc7t2njskzp6th0000gn/T/pip-record-i_0qytcj/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.7m/openbabel Check the logs for full command output.
Here pip is an alias for pip3.
The log file is here (I am not sure if you can read it, this is my first time sharing a file)
note: A few days ago I opened a second user on my computer, I don't know how it affects things but maybe that's the reason.
I am using Mac OS Catalina.
From a quick look at the log file it looks like it wont install as it cant find a version for Mac OS, only for Windows, however the following may be useful as a workaround to that: How to Install openbabel for Python 3.6 on macOS Sierra 10.12.3
So I found a much simpler way than building openbabel manually. brew install openbabel works for openbabel3
Check the link: http://openbabel.org/wiki/Category:Installation

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.

Pycharm failed to install package sawtooth-sdk

When I try to import the sawtooth SDK into Pycharm it failes with the following error
Collecting sawtooth-sdk==1.0.1
Using cached sawtooth-sdk-1.0.1.tar.gz
Requirement already satisfied: colorlog in /home/user/PycharmProjects/test/venv/lib/python3.6/site-packages (from sawtooth-sdk==1.0.1)
Collecting sawtooth-signing (from sawtooth-sdk==1.0.1)
Using cached sawtooth-signing-1.0.1.tar.gz
Collecting protobuf (from sawtooth-sdk==1.0.1)
Using cached protobuf-3.5.2.post1-cp36-cp36m-manylinux1_x86_64.whl
Collecting pyzmq (from sawtooth-sdk==1.0.1)
Using cached pyzmq-17.0.0-cp36-cp36m-manylinux1_x86_64.whl
Collecting toml (from sawtooth-sdk==1.0.1)
Using cached toml-0.9.4.tar.gz
Collecting PyYAML (from sawtooth-sdk==1.0.1)
Using cached PyYAML-3.12.tar.gz
Collecting secp256k1 (from sawtooth-signing->sawtooth-sdk==1.0.1)
Using cached secp256k1-0.13.2.tar.gz
Collecting six>=1.9 (from protobuf->sawtooth-sdk==1.0.1)
Using cached six-1.11.0-py2.py3-none-any.whl
Requirement already satisfied: setuptools in /home/user/PycharmProjects/test/venv/lib/python3.6/site-packages (from protobuf->sawtooth-sdk==1.0.1)
Requirement already satisfied: cffi>=1.3.0 in /home/user/PycharmProjects/test/venv/lib/python3.6/site-packages (from secp256k1->sawtooth-signing->sawtooth-sdk==1.0.1)
Requirement already satisfied: pycparser in /home/user/PycharmProjects/test/venv/lib/python3.6/site-packages (from cffi>=1.3.0->secp256k1->sawtooth-signing->sawtooth-sdk==1.0.1)
Installing collected packages: secp256k1, sawtooth-signing, six, protobuf, pyzmq, toml, PyYAML, sawtooth-sdk
Running setup.py install for secp256k1: started
Running setup.py install for secp256k1: finished with status 'error'
Complete output from command /home/user/PycharmProjects/test/venv/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pycharm-packaging/secp256k1/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-g3n5renb-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/user/PycharmProjects/test/venv/include/site/python3.6/secp256k1:
0.29.1
Installed libsecp256k1 is unusable falling back to bundled version.
Using bundled libsecp256k1
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/secp256k1
copying secp256k1/__init__.py -> build/lib.linux-x86_64-3.6/secp256k1
copying secp256k1/__main__.py -> build/lib.linux-x86_64-3.6/secp256k1
warning: build_py: byte-compiling is disabled, skipping.
running build_ext
generating cffi module 'build/temp.linux-x86_64-3.6/_libsecp256k1.c'
creating build/temp.linux-x86_64-3.6
building '_libsecp256k1' extension
creating build/temp.linux-x86_64-3.6/build
creating build/temp.linux-x86_64-3.6/build/temp.linux-x86_64-3.6
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/user/PycharmProjects/test/venv/include -I/usr/include/python3.6m -c build/temp.linux-x86_64-3.6/_libsecp256k1.c -o build/temp.linux-x86_64-3.6/build/temp.linux-x86_64-3.6/_libsecp256k1.o
build/temp.linux-x86_64-3.6/_libsecp256k1.c:22:24: fatal error: pyconfig.h: No such file or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/home/user/PycharmProjects/test/venv/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pycharm-packaging/secp256k1/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-g3n5renb-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/user/PycharmProjects/test/venv/include/site/python3.6/secp256k1" failed with error code 1 in /tmp/pycharm-packaging/secp256k1/
When I run the pip command pip install sawtooth-sdk==1.0.1 it succeeds but it installs the files to python 2.7 version and I need to install it for python 3.6 which it is the interpreter I have use for this project. Or is there anyway to import them directly into pycharm from the folder of the sdk the sawtooth project provides?? Any help??
Use pip3 which is available for Ubuntu-16.04
sudo apt-get install python3-pip
sudo pip3 install sawtooth-sdk==1.0.1
Another solution for cases where you cannot change Python version: install secp256k1 library in system. For example, to install it on python3.7 docker image:
RUN apt update && apt install -y libsecp256k1-dev libsecp256k1-0
I changed the python interpreter to version 3.5 and it installed correctly

Resources