Tag Archives: anaconda

Tensorflow installation and uninstall (Anaconda version)

TensorFlow Installation and Uninstallation (Anaconda version)
Anaconda can easily configure and set up the virtual environment. Generally, we can choose PIP Install or Conda Install to download and install the package. Here are the steps of Anaconda installation:
1, anaconda search-t conda tensorflow
looks for the available tensorflow source. After this command is run, the terminal will output all available sources

2, anaconda show name
. Here the name is the name of the tensorflow column of the output source in 1, and the show command will output the specific information of the source and download the required instructions at the terminal.

such as:

conda install --channel https://conda.anacoda.org/HCC tensorflow-gpu=1.6

1.6 Is the version number, which can be set according to its own requirements.
In addition, you can choose the available channel channel without so much trouble to search package name, and you can directly use the conda command:

Conda install tensorflow – gpu = 1.6

Conda automatically selects the available channels.

1, conda list/ PIP list view package installation information in the environment
2, PIP uninstall ‘name’, name is the name of the specified package
for example:

pip uninstall tensorflow-gpu=1.6

Pychar configures Anaconda environment

Reprinted from: https://blog.csdn.net/baoxiao7872/article/details/80328224
the author: low m
PyCharm is a very useful and popular Python editor. Anaconda is a Python distribution focused on data analysis and contains more than 190 science packages and dependencies, including Conda, Python, and others. Anaconda makes your work flow a lot easier with the management toolkit, development environment, and Python versions. Not only can you easily install, update, and uninstall toolkits, but you can automatically install the corresponding dependent packages when you install them, and you can use different virtual environments to isolate projects with different requirements. Anaconda comes with its own integrated development environment Spyder. Some people don’t like the Spyder style. Personally, I feel that its prompt function is also inferior to PyCharm. Wouldn’t it be nice to configure the Anaconda environment with PyCharm?Here’s a personal lesson:
I won’t go through the process of installing Anaconda and Pycharm, which is relatively simple. There are also great tutorials online. The version of PyCharm That I installed was 2017.3.2 (community version).
After completing the installation of both:
The first step is to configure the Anaconda environment variable and add the installation Path of the Anacond and its subfolders script and library/bin to the system environment variable Path. I am installed on the G disk and my configuration is “G:\Anaconda3; G:\Anaconda3\Scripts; G: \ Anaconda3/Library/bin “.
The second step is to configure the Anaconda environment for PyCharm. Enter PyCharm and click File-&gt in turn. Default Setting-> Project Interpreter

Click gear to select Add Local

I chose the third one. I took it for granted that it was the second one, but I didn’t know what to do for a long time. Click on the third TAB, select python. Exe under the Anaconda installation path, and then successfully configure the Anaconda environment.

The project created in this environment can then use the existing library in Anaconda.

CONDA HTTP error is prompted when Anaconda prompt is installed and updated

When we use the Anaconda Prompt, we often use the conda command for environment management and third-party package management. But what if the following problems arise?Don’t panic. You’ll know after you read it.
Error code:
Could not fetch URL https://pypi.python.org/simple/tensorflow/: There was a problem confirming the ssl certificate: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:748) – skipping

(base) C:\Users\genec>conda create --name python36 python=3.6
Solving environment: failed

CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://repo.anaconda.com/pkgs/r/win-64/repodata.json.bz2>
Elapsed: -

An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.

If your current network has https://www.anaconda.com blocked, please file
a support request with your network engineering team.

SSLError(MaxRetryError('HTTPSConnectionPool(host=\'repo.anaconda.com\', port=443): Max retries exceeded with url: /pkgs/r/win-64/repodata.json.bz2 (Caused by SSLError(SSLError("bad handshake: Error([(\'SSL routines\', \'ssl3_get_server_certificate\', \'certificate verify failed\')])")))'))

Online tutorial prompts to replace the source installation, you can. Below is the result of trying to replace the source…

(base) C:\Users\genec>conda create --name python36 python=3.6
Solving environment: failed

CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/win-64/repodata.json>
Elapsed: -

An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.
SSLError(MaxRetryError('HTTPSConnectionPool(host=\'mirrors.tuna.tsinghua.edu.cn\', port=443): Max retries exceeded with url: /anaconda/pkgs/free/win-64/repodata.json (Caused by SSLError(SSLError("bad handshake: Error([(\'SSL routines\', \'ssl3_get_server_certificate\', \'certificate verify failed\')])")))'))

The problem remains unresolved. So what to do?
In fact, the main problem is your network SSL authentication, you can try this:
Use notepad or Notepad++ to open C:\Users\.condarc under your username. Change sSL_verify to false.

If you want to change back to the original conda source, enter the Anaconda Prompt:

conda config --remove-key channels

 
 

Anaconda opens Navigator to report an error and a web page appears Navigator Error An unexpected error occurred on Navigator start-up Report

Anaconda Navigator opens the following web page:

solution:
1. Run with the administrator: Anaconda Prompt
2. Conda update anaconda-navigator
this command may cause the following error:
InvalidTypeError: Parameter _channels = ‘- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/ – https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/ declared in C: \ Users \ 12270 condarc has type STR.
Valid types:- tuple

Solution: Find the.condarc file under C:\Users\username folder and change it to the following:

channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/win-64
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/noarch
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/noarch
show_channel_urls: true

3. Conda update anaconda-navigator

Solution to abnormal errors during startup of Python’s Anaconda

Anaconda
A very good Python distribution.
Question raising
One day, suddenly found that after starting Spyder, has been in Connecting to Kernel, Loading endless, in essence is not connected.
when IPython is started, the following error message is reported:

ERROR:tornado.general:Uncaught exception in ZMQStream callback
Traceback (most recent call last):
File "d:\ProgramData\Anaconda3\lib\site-packages\zmq\eventloop\zmqstream.py", line 432, in _run_callback
callback(*args, **kwargs)
File "d:\ProgramData\Anaconda3\lib\site-packages\tornado\stack_context.py", line 277, in null_wrapper
return fn(*args, **kwargs)
File "d:\ProgramData\Anaconda3\lib\site-packages\ipykernel\kernelbase.py", line 283, in dispatcher
return self.dispatch_shell(stream, msg)
File "d:\ProgramData\Anaconda3\lib\site-packages\ipykernel\kernelbase.py", line 233, in dispatch_shell
self.pre_handler_hook()
File "d:\ProgramData\Anaconda3\lib\site-packages\ipykernel\kernelbase.py", line 248, in pre_handler_hook
self.saved_sigint_handler = signal(SIGINT, default_int_handler)
File "d:\ProgramData\Anaconda3\lib\signal.py", line 47, in signal
handler = _signal.signal(_enum_to_int(signalnum), _enum_to_int(handler))
ValueError: signal only works in main thread
ERROR:tornado.general:Uncaught exception in zmqstream callback
Traceback (most recent call last):
File "d:\ProgramData\Anaconda3\lib\site-packages\zmq\eventloop\zmqstream.py", line 450, in _handle_events
self._handle_recv()
File "d:\ProgramData\Anaconda3\lib\site-packages\zmq\eventloop\zmqstream.py", line 480, in _handle_recv
self._run_callback(callback, msg)
File "d:\ProgramData\Anaconda3\lib\site-packages\zmq\eventloop\zmqstream.py", line 432, in _run_callback
callback(*args, **kwargs)
File "d:\ProgramData\Anaconda3\lib\site-packages\tornado\stack_context.py", line 277, in null_wrapper
return fn(*args, **kwargs)
File "d:\ProgramData\Anaconda3\lib\site-packages\ipykernel\kernelbase.py", line 283, in dispatcher
return self.dispatch_shell(stream, msg)
File "d:\ProgramData\Anaconda3\lib\site-packages\ipykernel\kernelbase.py", line 233, in dispatch_shell
self.pre_handler_hook()
File "d:\ProgramData\Anaconda3\lib\site-packages\ipykernel\kernelbase.py", line 248, in pre_handler_hook
self.saved_sigint_handler = signal(SIGINT, default_int_handler)
File "d:\ProgramData\Anaconda3\lib\signal.py", line 47, in signal
handler = _signal.signal(_enum_to_int(signalnum), _enum_to_int(handler))
ValueError: signal only works in main thread
ERROR:tornado.application:Exception in callback functools.partial(.null_wrapper at 0x0000000005B33488>)
Traceback (most recent call last):
File "d:\ProgramData\Anaconda3\lib\site-packages\tornado\ioloop.py", line 605, in _run_callback
ret = callback()
File "d:\ProgramData\Anaconda3\lib\site-packages\tornado\stack_context.py", line 277, in null_wrapper
return fn(*args, **kwargs)
File "d:\ProgramData\Anaconda3\lib\site-packages\zmq\eventloop\zmqstream.py", line 536, in 
self.io_loop.add_callback(lambda : self._handle_events(self.socket, 0))
File "d:\ProgramData\Anaconda3\lib\site-packages\zmq\eventloop\zmqstream.py", line 450, in _handle_events
self._handle_recv()
File "d:\ProgramData\Anaconda3\lib\site-packages\zmq\eventloop\zmqstream.py", line 480, in _handle_recv
self._run_callback(callback, msg)
File "d:\ProgramData\Anaconda3\lib\site-packages\zmq\eventloop\zmqstream.py", line 432, in _run_callback
callback(*args, **kwargs)
File "d:\ProgramData\Anaconda3\lib\site-packages\tornado\stack_context.py", line 277, in null_wrapper
return fn(*args, **kwargs)
File "d:\ProgramData\Anaconda3\lib\site-packages\ipykernel\kernelbase.py", line 283, in dispatcher
return self.dispatch_shell(stream, msg)
File "d:\ProgramData\Anaconda3\lib\site-packages\ipykernel\kernelbase.py", line 233, in dispatch_shell
self.pre_handler_hook()
File "d:\ProgramData\Anaconda3\lib\site-packages\ipykernel\kernelbase.py", line 248, in pre_handler_hook
self.saved_sigint_handler = signal(SIGINT, default_int_handler)
File "d:\ProgramData\Anaconda3\lib\signal.py", line 47, in signal
handler = _signal.signal(_enum_to_int(signalnum), _enum_to_int(handler))
ValueError: signal only works in main thread

Judging from the error message, it must be a version conflict for one of the packages.
Problem solving
After searching the Internet, I decided to try the following:

conda uninstall jupyter tornado

Solving environment: done


==> WARNING: A newer version of conda exists. <==
  current version: 4.4.6
  latest version: 4.5.9

Please update conda by running

    $ conda update -n base conda



## Package Plan ##

  environment location: D:\ProgramData\Anaconda3

  removed specs:
    - jupyter
    - tornado


The following packages will be REMOVED:

    anaconda-project: 0.8.0-py36h8b3bf89_0
    jupyter:          1.0.0-py36h422fd7e_2
    jupyter_console:  5.2.0-py36h6d89b47_1
    seaborn:          0.8.0-py36h62cb67c_0
    tornado:          4.5.3-py36_0

Proceed ([y]/n)?y

Preparing transaction: done
Verifying transaction: done
Executing transaction: done

After uninstalling, reinstall:

conda install jupyter tornado

The information output during installation is as follows:

Solving environment: done


==> WARNING: A newer version of conda exists. <==
  current version: 4.4.6
  latest version: 4.5.9

Please update conda by running

    $ conda update -n base conda



## Package Plan ##

  environment location: D:\ProgramData\Anaconda3

  added/updated specs:
    - jupyter
    - tornado


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    ipykernel-4.8.2            |           py36_0         146 KB
    ipywidgets-7.4.0           |           py36_0         150 KB
    jupyter_client-5.2.3       |           py36_0         188 KB
    nbconvert-5.3.1            |           py36_0         422 KB
    widgetsnbextension-3.4.0   |           py36_0         1.7 MB
    tornado-5.1                |   py36hfa6e2cd_0         669 KB
    jupyter-1.0.0              |           py36_5           6 KB
    jupyter_console-5.2.0      |           py36_1          53 KB
    ------------------------------------------------------------
                                           Total:         3.3 MB

The following NEW packages will be INSTALLED:

    jupyter:            1.0.0-py36_5
    jupyter_console:    5.2.0-py36_1
    tornado:            5.1-py36hfa6e2cd_0

The following packages will be UPDATED:

    ipykernel:          4.6.1-py36hbb77b34_0 --> 4.8.2-py36_0
    ipywidgets:         7.0.0-py36h2e74ada_0 --> 7.4.0-py36_0
    jupyter_client:     5.2.2-py36_0         --> 5.2.3-py36_0
    nbconvert:          5.3.1-py36h8dc0fde_0 --> 5.3.1-py36_0
    widgetsnbextension: 3.0.2-py36h364476f_1 --> 3.4.0-py36_0

Proceed ([y]/n)?y


Downloading and Extracting Packages
ipykernel 4.8.2: ################################################################
ipywidgets 7.4.0: ###############################################################
jupyter_client 5.2.3: ###########################################################
nbconvert 5.3.1: ################################################################
widgetsnbextension 3.4.0: #######################################################
tornado 5.1: ####################################################################
jupyter 1.0.0: ##################################################################
jupyter_console 5.2.0: ##########################################################
Preparing transaction: done
Verifying transaction: done
Executing transaction: done

conclusion
Often walk from the river, occasionally wet shoes, these tools will occasionally report errors, if there is a problem, just try to solve it.

cv2.imread() error: (-215:Assertion failed) size.width>0 && size.height>0 in function ‘cv::imshow’

error: (-215:Assertion failed) size.width> 0 & & size.height> 0 in function ‘CV ::imshow’

Solution:
change the name and path of the picture to English or number

window name should also be set to English or number, otherwise it will show the code
from the code of https://www.zhihu.com/question/67157462/answer/251754530
Chinese path can be read normal, but still have window name Chinese garbled.

update: fix window name mess
change system Settings, check the system default code under the CMD window to enter CHCP. If the system encoding is UTF-8, output 65001, modify the language setting to UTF-8, and operate as follows:

red envelope + discount, ali cloud on cloud gift package!
https://promotion.aliyun.com/ntms/yunparter/invite.html?UserCode = 5 wzgtzow
“universal cloud computing” cloud host as low as 4
https://promotion.aliyun.com/ntms/act/qwbk.html?UserCode = 5 wzgtzow
cloud communication exclusive ali cloud new users 】 【 8 fold the
https://www.aliyun.com/acts/alicomcloud/new-discount?UserCode =5wzgtzow
[trademark registration service] as low as 680
https://tm.aliyun.com/?userCode=5wzgtzow

About the solution of ERROR: Failed building wheel for dlib

Error reporting in some dependency libraries with dlib and Face_recognition installed

(face_recognition) C:\Users\FlynnLi>pip install dlib -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
Looking in indexes: http://pypi.douban.com/simple
Collecting dlib
  Downloading http://pypi.doubanio.com/packages/63/92/05c3b98636661cb80d190a5a777dd94effcc14c0f6893222e5ca81e74fbc/dlib-19.19.0.tar.gz (3.2 MB)
     |████████████████████████████████| 3.2 MB 2.2 MB/s
Building wheels for collected packages: dlib
  Building wheel for dlib (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'D:\Python\Virtual\face_recognition\Scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\FlynnLi\\AppData\\Local\\Temp\\pip-install-ywrf5o_o\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\FlynnLi\\AppData\\Local\\Temp\\pip-install-ywrf5o_o\\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 'C:\Users\FlynnLi\AppData\Local\Temp\pip-wheel-4oqer9mq'
       cwd: C:\Users\FlynnLi\AppData\Local\Temp\pip-install-ywrf5o_o\dlib\
  Complete output (55 lines):
  running bdist_wheel
  running build
  running build_py
  package init file 'dlib\__init__.py' not found (or not a regular file)
  running build_ext
  Building extension for Python 3.7.5 (tags/v3.7.5:5c02a39a0b, Oct 15 2019, 00:11:34) [MSC v.1916 64 bit (AMD64)]
  Invoking CMake setup: 'cmake C:\Users\FlynnLi\AppData\Local\Temp\pip-install-ywrf5o_o\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\FlynnLi\AppData\Local\Temp\pip-install-ywrf5o_o\dlib\build\lib.win-amd64-3.7 -DPYTHON_EXECUTABLE=D:\Python\Virtual\face_recognition\Scripts\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\FlynnLi\AppData\Local\Temp\pip-install-ywrf5o_o\dlib\build\lib.win-amd64-3.7 -A x64'
  -- Building for: NMake Makefiles
  CMake Error at CMakeLists.txt:3 (project):
    Generator

      NMake Makefiles

    does not support platform specification, but platform

      x64

    was specified.


  CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
  CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
  -- Configuring incomplete, errors occurred!
  See also "C:/Users/FlynnLi/AppData/Local/Temp/pip-install-ywrf5o_o/dlib/build/temp.win-amd64-3.7/Release/CMakeFiles/CMakeOutput.log".
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "C:\Users\FlynnLi\AppData\Local\Temp\pip-install-ywrf5o_o\dlib\setup.py", line 261, in <module>
      'Topic :: Software Development',
    File "D:\Python\Virtual\face_recognition\lib\site-packages\setuptools\__init__.py", line 144, in setup
      return distutils.core.setup(**attrs)
    File "d:\python\lib\distutils\core.py", line 148, in setup
      dist.run_commands()
    File "d:\python\lib\distutils\dist.py", line 966, in run_commands
      self.run_command(cmd)
    File "d:\python\lib\distutils\dist.py", line 985, in run_command
      cmd_obj.run()
    File "D:\Python\Virtual\face_recognition\lib\site-packages\wheel\bdist_wheel.py", line 223, in run
      self.run_command('build')
    File "d:\python\lib\distutils\cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "d:\python\lib\distutils\dist.py", line 985, in run_command
      cmd_obj.run()
    File "d:\python\lib\distutils\command\build.py", line 135, in run
      self.run_command(cmd_name)
    File "d:\python\lib\distutils\cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "d:\python\lib\distutils\dist.py", line 985, in run_command
      cmd_obj.run()
    File "C:\Users\FlynnLi\AppData\Local\Temp\pip-install-ywrf5o_o\dlib\setup.py", line 135, in run
      self.build_extension(ext)
    File "C:\Users\FlynnLi\AppData\Local\Temp\pip-install-ywrf5o_o\dlib\setup.py", line 172, in build_extension
      subprocess.check_call(cmake_setup, cwd=build_folder)
    File "d:\python\lib\subprocess.py", line 363, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\FlynnLi\\AppData\\Local\\Temp\\pip-install-ywrf5o_o\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\FlynnLi\\AppData\\Local\\Temp\\pip-install-ywrf5o_o\\dlib\\build\\lib.win-amd64-3.7', '-DPYTHON_EXECUTABLE=D:\\Python\\Virtual\\face_recognition\\Scripts\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\FlynnLi\\AppData\\Local\\Temp\\pip-install-ywrf5o_o\\dlib\\build\\lib.win-amd64-3.7', '-A', 'x64']' returned non-zero exit status 1.
  ----------------------------------------
  ERROR: Failed building wheel for dlib
  Running setup.py clean for dlib
Failed to build dlib
Installing collected packages: dlib
    Running setup.py install for dlib ... error
    ERROR: Command errored out with exit status 1:
     command: 'D:\Python\Virtual\face_recognition\Scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\FlynnLi\\AppData\\Local\\Temp\\pip-install-ywrf5o_o\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\FlynnLi\\AppData\\Local\\Temp\\pip-install-ywrf5o_o\\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\FlynnLi\AppData\Local\Temp\pip-record-vngiiz8h\install-record.txt' --single-version-externally-managed --compile --install-headers 'D:\Python\Virtual\face_recognition\include\site\python3.7\dlib'
         cwd: C:\Users\FlynnLi\AppData\Local\Temp\pip-install-ywrf5o_o\dlib\
    Complete output (57 lines):
    running install
    running build
    running build_py
    package init file 'dlib\__init__.py' not found (or not a regular file)
    running build_ext
    Building extension for Python 3.7.5 (tags/v3.7.5:5c02a39a0b, Oct 15 2019, 00:11:34) [MSC v.1916 64 bit (AMD64)]
    Invoking CMake setup: 'cmake C:\Users\FlynnLi\AppData\Local\Temp\pip-install-ywrf5o_o\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\FlynnLi\AppData\Local\Temp\pip-install-ywrf5o_o\dlib\build\lib.win-amd64-3.7 -DPYTHON_EXECUTABLE=D:\Python\Virtual\face_recognition\Scripts\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\FlynnLi\AppData\Local\Temp\pip-install-ywrf5o_o\dlib\build\lib.win-amd64-3.7 -A x64'
    -- Building for: NMake Makefiles
    CMake Error at CMakeLists.txt:3 (project):
      Generator

        NMake Makefiles

      does not support platform specification, but platform

        x64

      was specified.


    CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
    CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
    -- Configuring incomplete, errors occurred!
    See also "C:/Users/FlynnLi/AppData/Local/Temp/pip-install-ywrf5o_o/dlib/build/temp.win-amd64-3.7/Release/CMakeFiles/CMakeOutput.log".
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\FlynnLi\AppData\Local\Temp\pip-install-ywrf5o_o\dlib\setup.py", line 261, in <module>
        'Topic :: Software Development',
      File "D:\Python\Virtual\face_recognition\lib\site-packages\setuptools\__init__.py", line 144, in setup
        return distutils.core.setup(**attrs)
      File "d:\python\lib\distutils\core.py", line 148, in setup
        dist.run_commands()
      File "d:\python\lib\distutils\dist.py", line 966, in run_commands
        self.run_command(cmd)
      File "d:\python\lib\distutils\dist.py", line 985, in run_command
        cmd_obj.run()
      File "D:\Python\Virtual\face_recognition\lib\site-packages\setuptools\command\install.py", line 61, in run
        return orig.install.run(self)
      File "d:\python\lib\distutils\command\install.py", line 545, in run
        self.run_command('build')
      File "d:\python\lib\distutils\cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "d:\python\lib\distutils\dist.py", line 985, in run_command
        cmd_obj.run()
      File "d:\python\lib\distutils\command\build.py", line 135, in run
        self.run_command(cmd_name)
      File "d:\python\lib\distutils\cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "d:\python\lib\distutils\dist.py", line 985, in run_command
        cmd_obj.run()
      File "C:\Users\FlynnLi\AppData\Local\Temp\pip-install-ywrf5o_o\dlib\setup.py", line 135, in run
        self.build_extension(ext)
      File "C:\Users\FlynnLi\AppData\Local\Temp\pip-install-ywrf5o_o\dlib\setup.py", line 172, in build_extension
        subprocess.check_call(cmake_setup, cwd=build_folder)
      File "d:\python\lib\subprocess.py", line 363, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\FlynnLi\\AppData\\Local\\Temp\\pip-install-ywrf5o_o\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\FlynnLi\\AppData\\Local\\Temp\\pip-install-ywrf5o_o\\dlib\\build\\lib.win-amd64-3.7', '-DPYTHON_EXECUTABLE=D:\\Python\\Virtual\\face_recognition\\Scripts\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\FlynnLi\\AppData\\Local\\Temp\\pip-install-ywrf5o_o\\dlib\\build\\lib.win-amd64-3.7', '-A', 'x64']' returned non-zero exit status 1.
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'D:\Python\Virtual\face_recognition\Scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\FlynnLi\\AppData\\Local\\Temp\\pip-install-ywrf5o_o\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\FlynnLi\\AppData\\Local\\Temp\\pip-install-ywrf5o_o\\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\FlynnLi\AppData\Local\Temp\pip-record-vngiiz8h\install-record.txt' --single-version-externally-managed --compile --install-headers 'D:\Python\Virtual\face_recognition\include\site\python3.7\dlib' Check the logs for full command output.

Anaconda is downloaded according to the Suggestions on the Internet, conda is used to download, and the virtual environment is created before downloading

conda create -n face python=3.7 #Python3.7
activate face 

Installing Opencv has reported another error… Don’t recurse…

 D:\Anaconda\envs>conda install opencv-python
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.

Actually, the name of the package under Python is OpencV-Python, and Anaconda is Opencv

conda install -c conda-forge opencv

Error reporting also occurred when installing the face_recognition library, and the solution is to use

pip install --no-dependencies face_recognition

And then I can introduce usage and write code normally.