Installing pytesser

前端 未结 7 1272
我寻月下人不归
我寻月下人不归 2020-12-11 03:31

I\'m new to python and would like to install and use the pytesser OCR library. All of the other modules that I\'ve installed, I\'ve used easy_install, which has worked fine.

7条回答
  •  萌比男神i
    2020-12-11 04:05

    I suspect the problem is with Python not being able to find your C:\Python27\Scripts directory because it's not in your PYTHONPATH.

    Python looks in certain directories for files when you run an import command, they're described here http://docs.python.org/2/tutorial/modules.html#the-module-search-path

    Your main options are:

    1) Tell Python to look in your Scripts folder. This involves adding the folder to your Python path, see here How to add to the pythonpath in windows 7?

    2) Put your script in a folder which is already searched by Python. This is wRAR's answer, to use the standard Python 3rd-party modules directory, see here http://docs.python.org/2/install/index.html#how-installation-works

    3) Have the pytesser file in Python's current directory. import os followed by os.getcwd() will show you python's current directory, where the code is running (in a sense). os.chdir("my/other/dir") changes the current directory. See How to know/change current directory in Python shell? for more detail.

提交回复
热议问题