简体   繁体   English

在Linux中,如何为python 2.7而不是python 3安装pytesseract?

[英]In linux, how to install pytesseract for python 2.7, not for python 3?

I'd like to install pytesseract in python2.7/dist-packages. 我想在python2.7 / dist-packages中安装pytesseract。 I tried "pip install pytesseract". 我尝试了“ pip install pytesseract”。 But it is installed in python3/dist-packages. 但它安装在python3 / dist-packages中。 Please help me. 请帮我。

pip is a small script that executes the pip package. pip是执行pip包的小脚本。 You can do that yourself with the python of your choice using the -m option. 您可以使用-m选项,使用所选的Python自己执行此操作。 Assuming your python 2.7 executable is python , you can 假设您的python 2.7可执行文件是python ,则可以

python -m pip install pytesseract

or 要么

sudo -H python -m pip install pytesseract

if you want to install into system directories. 如果要安装到系统目录中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM