本文介绍了在Windows python中安装Openalpr的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我正在使用 Windows 10 ,并且要安装 openalpr 并将库导入到 python .

I am using Windows 10 and I want to install openalpr and import the library to python.

但是,下载了预编译的Windows二进制文件后,我不知道如何在python中导入alpr

However, after downloaded the Pre-compiled Windows binaries, I dont know how ti import alpr in python

我遵循 OpenAlpr

我在此处下载了 openalpr-2.3.0-win-64bit.zip 并解压缩.

I downloaded the openalpr-2.3.0-win-64bit.zip here and unzipped it.

然后,我可以在命令行中运行alpr,但不能导入它.

Afterwards, I can run alpr in command line but I cannot import it.

任何人都可以教我如何在python中导入Openalpr.谢谢.

Can anyone teach me how I can import Openalpr in python. Thank you.

推荐答案

下载二进制发行版后,导航至python子目录并运行python setup.py.这会将OpenALPR作为软件包安装,因此您可以从任何地方导入它,而不仅仅是从ALPR的目录中导入.

When you've downloaded the binary distribution, navigate to python subdirectory and run python setup.py. This would install OpenALPR as package, so then you would be able to import it from anywhere, not just from ALPR's directory.

说明:为了可导入,它要求您尝试导入的软件包为其他软件包:

Explaination:To be importable, it requires that the package you're trying to import been else:

  1. 在当前目录中,运行python
  2. 的位置
  3. 通过PYTHONPATH环境变量指定
  4. 标准库的一部分
  5. .pth个文件之一中指定
  6. 位于site-packages目录
  7. 手动添加到sys.path
  1. In current directory, from where you run python
  2. Specified via PYTHONPATH environment variable
  3. Part of standard library
  4. Specified in one of .pth files
  5. Located in site-packages dir
  6. Added to sys.path by hand

当您运行setup.py脚本时,它将踢distutils正确地将软件包的发行版复制到site-packages,从而将其添加到您的库中.

And when you run setup.py script, it kicks distutils to properly copy package's distribution to site-packages, thus adding it to your libs.

有关更多信息,请参见 setup.py用法导入系统如何工作

For more information, see setup.py usage and how import system works

这篇关于在Windows python中安装Openalpr的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-07 00:18