dlib 已安装但无法导入(与代码)

发布于 2025-01-20 12:21:28 字数 269 浏览 0 评论 0原文

我已经使用传统的 pip 命令在我的计算机上成功安装了 python 3.10.4 的 dlib 库。 但现在安装后,我尝试导入相同的内容,但它抛出错误。 请帮我解决同样的问题。在此处输入图像说明

dlib 的安装确认

I have installed dlib library successfully for python 3.10.4 on my computer using the traditional pip command.
But after installing now I am trying to import the same and it is throwing error.
Please help me out on the same.enter image description here

installation confirmation for dlib

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

又怨 2025-01-27 12:21:28

解决我问题的解决方案是....

  1. 安装cmake(pip安装cmake)
  2. 安装轮(pip安装轮)
  3. 安装dlib(pip install dlib)
  4. 将解释器设置为纠正Python版本
    (在我的情况下,VS代码使用了Python 3.9,我在3.10上安装了Dlib ....然后,我将解释器更改为3.10,然后对我有用)

The solution for my problem was....

  1. install cmake (pip install cmake)
  2. install wheel (pip install wheel)
  3. install dlib (pip install dlib)
  4. set the interpreter to correct version of python
    (in my case vs code was using python 3.9 and I have installed dlib on 3.10.... then I changed the interpreter to 3.10 and then it worked for me)
相守太难 2025-01-27 12:21:28

就我而言,通过正确设置 Python 解释器的 PATH 解决了问题。如果您想检查或尝试一下,请检查下面的操作方法。

如果您在 Windows 上运行 VSCode,请转到:

  • 文件
  • 首选项
  • 设置
  • 用户(左上角的选项卡)
  • 扩展(侧栏)
  • Python
  • 默认解释器路径(右侧部分)

插入您的 Python 解释器路径。就我而言,它是“C:\Users\userName\AppData\Local\Programs\Python\Python310”,检查你的。
希望有帮助。

In my case, the problem has been solved by setting properly the PATH for the Python Interpreter. If you want to check or give it a try to this, check bellow how you can do that.

If you run VSCode on Windows go to:

  • File
  • Preferences
  • Settings
  • User (tab on the top left)
  • Extensions (side column)
  • Python
  • Default Interpreter Path (section, on the right side)

Insert your Python Interpreter Path. In my case it is "C:\Users\userName\AppData\Local\Programs\Python\Python310", check yours.
Hope that helps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文