ageitgey / face_recognition

The world's simplest facial recognition api for Python and the command line
MIT License
52.46k stars 13.37k forks source link

Error installing face_recognition in the window. #1010

Open garry191091 opened 4 years ago

garry191091 commented 4 years ago

I am installing the face_recognition in the window. this is the command. pip --no-cache-dir install face_recognition

I get an error while installing:-

`ERROR: Excepti
on:
Traceback (most recent call last):
  File "\appdata\local\programs\python\python36-32\lib\site
-packages\pip\_vendor\urllib3\response.py", line 425, in _error_catcher
    yield
  File "\appdata\local\programs\python\python36-32\lib\site
-packages\pip\_vendor\urllib3\response.py", line 507, in read
    data = self._fp.read(amt) if not fp_closed else b""
  File "\appdata\local\programs\python\python36-32\lib\http
\client.py", line 449, in read
    n = self.readinto(b)
  File "\appdata\local\programs\python\python36-32\lib\http
\client.py", line 493, in readinto
    n = self.fp.readinto(b)
  File "\appdata\local\programs\python\python36-32\lib\sock
et.py", line 586, in readinto
    return self._sock.recv_into(b)
  File "\appdata\local\programs\python\python36-32\lib\ssl.
py", line 1002, in recv_into
    return self.read(nbytes, buffer)
  File "\appdata\local\programs\python\python36-32\lib\ssl.
py", line 865, in read
    return self._sslobj.read(len, buffer)
  File "\appdata\local\programs\python\python36-32\lib\ssl.
py", line 625, in read
    v = self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "\appdata\local\programs\python\python36-32\lib\site
-packages\pip\_internal\cli\base_command.py", line 153, in _main
    status = self.run(options, args)
  File "\appdata\local\programs\python\python36-32\lib\site
-packages\pip\_internal\commands\install.py", line 382, in run
    resolver.resolve(requirement_set)
  File "\appdata\local\programs\python\python36-32\lib\site
-packages\pip\_internal\legacy_resolve.py", line 201, in resolve
    self._resolve_one(requirement_set, req)
  File "\appdata\local\programs\python\python36-32\lib\site
-packages\pip\_internal\legacy_resolve.py", line 365, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "\appdata\local\programs\python\python36-32\lib\site
-packages\pip\_internal\legacy_resolve.py", line 313, in _get_abstract_dist_for
    req, self.session, self.finder, self.require_hashes
  File "\appdata\local\programs\python\python36-32\lib\site
-packages\pip\_internal\operations\prepare.py", line 194, in prepare_linked_requ
irement
    progress_bar=self.progress_bar
  File "\appdata\local\programs\python\python36-32\lib\site
-packages\pip\_internal\download.py", line 465, in unpack_url
    progress_bar=progress_bar
  File "\appdata\local\programs\python\python36-32\lib\site
-packages\pip\_internal\download.py", line 316, in unpack_http_url
    progress_bar)
  File "\appdata\local\programs\python\python36-32\lib\site
-packages\pip\_internal\download.py", line 551, in _download_http_url
    _download_url(resp, link, content_file, hashes, progress_bar)
  File "\appdata\local\programs\python\python36-32\lib\site
-packages\pip\_internal\download.py", line 253, in _download_url
    hashes.check_against_chunks(downloaded_chunks)
  File "\appdata\local\programs\python\python36-32\lib\site
-packages\pip\_internal\utils\hashes.py", line 80, in check_against_chunks
    for chunk in chunks:
  File "\appdata\local\programs\python\python36-32\lib\site
-packages\pip\_internal\download.py", line 223, in written_chunks
    for chunk in chunks:
  File "\appdata\local\programs\python\python36-32\lib\site
-packages\pip\_internal\utils\ui.py", line 160, in iter
    for x in it:
  File "\appdata\local\programs\python\python36-32\lib\site
-packages\pip\_internal\download.py", line 212, in resp_read
    decode_content=False):
  File "\appdata\local\programs\python\python36-32\lib\site
-packages\pip\_vendor\urllib3\response.py", line 564, in stream
    data = self.read(amt=amt, decode_content=decode_content)
  File "\appdata\local\programs\python\python36-32\lib\site
-packages\pip\_vendor\urllib3\response.py", line 529, in read
    raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
  File "\appdata\local\programs\python\python36-32\lib\cont
extlib.py", line 100, in __exit__
    self.gen.throw(type, value, traceback)
  File "\appdata\local\programs\python\python36-32\lib\site
-packages\pip\_vendor\urllib3\response.py", line 430, in _error_catcher
    raise ReadTimeoutError(self._pool, None, "Read timed out.")
pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files
.pythonhosted.org', port=443): Read timed out.`

How can I install the face_recognition on the window?

leandrodiassis commented 4 years ago

It is happening the same with me. I'm using Debian Buster 10. I hope there is a good soul out there carrying the answer.

The problem occurs even after installing dlib. But while installing dlib a message was saying:

/usr/include/python3.7m/pythread.h:97:17: note: declared here
 PyAPI_FUNC(int) PyThread_set_key_value(int key, void *value) Py_DEPRECATED(3.7);

source: https://ourcodeworld.com/articles/read/841/how-to-install-and-use-the-python-face-recognition-and-detection-library-in-ubuntu-16-04


Update: if you're facing the same issue: try.... try... and try again. I read someone saying that was able to install after attempting 14th times. I don't know how to explain, but for me it was successfully installed after trying a lot of times,

root-Akshay commented 4 years ago
  1. pip install CMake.
  2. Install VS community and under individual components -choose Visual C++ tools for CMake. Click here to download VS installer

image

  1. pip install face_recognition.

I know this method install's cmake twice but it works.

ps: pip install face_recognition will take a lot of time so be patient