Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install dlib library in python

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

Python how to install dlib library, I believe that many inexperienced people do not know what to do, so this article summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.

Compile boost.python

Generally speaking, the most common mistake when installing dlib is that you can't find boost. In order for dlib to find boost, we need to compile boost.python.

In fact, the error message when installing dlib fails gives detailed guidelines, and generally speaking, there is no problem to follow the guidelines.

The problem I have here is that the latest version of boost cannot compile python. Other modules can be compiled but not Python modules.

My attempts are as follows:

In addition to the original installation of Anaconda2 and Anaconda3, and then to install Python2, I am not sure if this also played a role.

Instead of using the latest version of boost, use the penultimate or fourth stable version.

Since only Boost.python is needed here, I only compiled the python module. The process is as follows:

Go to the official website to download not the latest version, but a stable version of boost.

Running bootstrap.bat generates the b2.exe and bjam.exe we need.

Run the following command

B2-a-- with-python address-model=64 toolset=msvc runtime-link=static

This process may take a few minutes, please wait patiently. After successful compilation, two folders, bin.v2 and stage, are generated.

Files like the following will be generated under the stage/lib folder, which I have not been able to generate with the latest version of boost:

It also prompts you that two paths need to be added:

Now look back at the prompt in the first picture above:

Then you can know that we need to add two environment variables. Here are the system variables BOOST_LIBRARYDIR and BOOST_ROOT that I added.

Since I tried a different version, the version I actually added may not be the same version of boost that I demonstrated when I wrote this article. But I believe I have made myself clear.

Install Dlib

Then run the installation command under the installation Dlib folder:

Python setup.py install

There should be no error of not finding boost this time. There are usually no other mistakes.

If you still have this error and confirm that you have done nothing wrong, you can restart it.

After reading the above, have you mastered how to install the dlib library in python? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report