Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install Openalpr in Windows python

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

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

I follow the instruction in OpenAlpr

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

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

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

like image 635
VICTOR Avatar asked Aug 23 '16 05:08

VICTOR


1 Answers

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. 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

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.

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

like image 105
thodnev Avatar answered Oct 06 '22 02:10

thodnev