Error in installing face recognition module in python - python

I want to use the face recognition module of python in a project but when I am trying to install it using the command "pip install face_recognition" or "pip install face-recognition", it is showing an error and is not installing. This is the screenshot of the error:
How to fix this error and install the module?
Thanks in advance!

You should install a C++ compiler. I would suggest Visual Studio C++.
This is because the face_recognition package does not have prebuilt wheels for your platform and therefore you need to build them yourself when you install.
Anyhow just installing C++ build tolls will be sufficient.
Verify your installation
cl
And then re-run
pip install face_recognition

Face-recognition python module uses C++, so your computer needs somehow to compile the library it is using. Install any of the C++ compilers (for example minGW) & be sure is that compiler executable is added to your global PATH. After that try to install face-recognition library.
If the step above does not work - try using python 32-bit build (once I have encountered this error because my python build was 64-bit). It may help in some of the cases.
Use python version == 3.7 (any other versions does not compatible with face-recognition module)
Install dlib dependency and try to use conda for installing & manipulating environments.
P.S. you need to install C++ compiler, not Visual Studio itself. Visual studio is an IDE, while compiler is not.

Related

How to install face-recognition without having to install Visual Studio C++

I need to install face-recognition on windows without having to install Visual Studio C++, is there any way to do this? The problem is that it depends on the dlib library and this depends on having Visual C++ installed.
Unfortunately, it seems that dlib is only distributed as source code. As a result, you will need to compile it on your own. This means that you will need Visual Studio C++ installed, but you can uninstall it afterwords unless you need to update dlib frequently. If you need instructions, you can find them here.

Spacy Update msvc not found

I'trying to update spacy from version 2.0.18 to version 2.1.1.
But every time I try to run the command
pip install spacy-nightly
or
pip install -U spacy==2.1.1
I just get
error: [WinError 2] System cannot find file specified
msvc
py_compiler msvc
with a lot of unreadable output.
Now I figured it has something to do with the C++ compiler spacy uses and I installed like every package I found at the Microsoft Visual Website but my problem didnt solve itself.
I really would appreciate some help!
Most probably, you are on a 64-bit machine using a 32-bit python executable.
Remove the 32-bit version of python and Install the 64 bit version of python it will work.
If you where working within a virtualenv, then delete the virtualenv and recreate it again after installing the 64-bit of python.

Microsoft Visual C++ 14.0 is required trying to install packages written in c

Hi I am trying to install the package 'pyfolio' but I get the error indicating:
Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools"
but I have already installed visual c++ redist packages but it still does not work.
I found out that the error occurs while installing package bottleneckso I thought to read the documentation on installing bottleneck, it was written in c and so I installed MinGW but could not be able to set ming as the compiler
I also installed cython. I am on a windows machine.
is there any other alternative to applying here?
Many people suggest going to the Microsoft link and downloading the entire package to build and compile things. But I like using choco for things because it's more straightforward. Basically this is an option if you are Linux user and stuck on windows.
I recommend making a virtual environment incase of mistakes and other fun issues.
python -m venv .venv
source .venv/Script/Activate # works with git bash
pip install --upgrade setuptools
choco install visualcppbuildtools
You don't have any Visual C++, you only have Redistributable packages. They install run-time libraries that are used to run applications written with VC. But you need Visual C++ compiler! Install Build Tools.
See https://stackoverflow.com/search?q=%5Bpip%5D+Microsoft+Visual+C%2B%2B+14.0+is+required

Installing enaml in Anaconda

I am trying to install enaml for the latest Anaconda distribution(4.3.1). The installation guide on http://nucleic.github.io/enaml/docs/get_started/installation.html says:
The sections below describe how to install Enaml and all of its dependencies from scratch, starting with the installation of a Python runtime. The instructions assume that the user’s system has a C++ compiler and the Git command line tools installed and available on the system path.
The Easy Way
If installing and building Enaml and its dependencies from scratch is not appealing, the free (and unaffiliated) Anaconda Python distribution provides a complete Python environment which comes with a reasonably recent version of Enaml and a host of other useful packages.
If you have a working C++ compiler, you can install using pip:
$ pip install enaml
Can you please tell me the easiest way to install a C++ compiler and Git command line tools and make them available on system path?
What I tried:
I tried installing Visual Studio however it turns out to be 32 bit so when pip installing enaml or atom I get the following error:
Failed building wheel for atom
fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'
Install the Microsoft Visual C++ Compiler for Python 2.7 and run pip install enaml again. There's also a tutorial here Python GUI's with enaml that shows how to get started from scratch.
conda install enaml is the more idiomatic way to install packages in anaconda than pip install, at least for packages it knows about. Enaml and Atom are among this list.
This bypasses C++ compilation so it may not be what you want, but it is the easiest way to install Enaml. (I have a black thumb when it comes to building from source, so Anaconda works very well for me.)

How to install the fitsio package in python

I am trying to install the fitsio package to python. I have tried so using pip, but that resulted in the following error: "ValueError: could not configure cfitsio 3370". I have also tried to install it without pip, but it gave me the same error. Any advise on how to install it properly? I don't have a lot of python experience, so please keep it simple. Thanks!
According to the setup.py source code of the python fitsio package, the package is configured and compiled using os.system('sh ./configure') (line 40) and os.system('make') (line 47) respectively. This is expected since the python fitsio package is basically a python wrapper of the C version of the fitsio library.
These are Linux commands, which you are trying to run natively at the Windows Command Prompt. This can't work and that's why you get the errors you're getting.
To get the python fitsio package installed on Windows you need to use something like Cygwin. Be sure to include the make and gcc in the packages you install in Cygwin (they are usually installed by default), as the fitsio package you want requires a GNU Toolchain for compiling the cfitsio. Another option would be to switch to Linux or use a Linux virtual machine but that's going a long way just to get a library to work :)
After installing the package you can find some examples for the fitsio module in python at the github repository landing page of the package.

Categories