Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant install tesseocr with pip -r #29

Closed
xkrt opened this issue Jan 20, 2017 · 7 comments
Closed

Cant install tesseocr with pip -r #29

xkrt opened this issue Jan 20, 2017 · 7 comments

Comments

@xkrt
Copy link

xkrt commented Jan 20, 2017

Hi, I want to install tess with pip insatll -r requirements.txt (in running tests with tox actually), but this scenario doesnt work. See:

$ virtualenv test
$ cd test/
$ source bin/activate
(test) $ echo Cython >> requirements.txt
(test) $ echo tesserocr >> requirements.txt
(test) $ pip install -r requirements.txt

I got error:

Collecting Cython (from -r requirements.txt (line 1))
  Using cached Cython-0.25.2-cp35-cp35m-manylinux1_x86_64.whl
Collecting tesserocr (from -r requirements.txt (line 2))
  Using cached tesserocr-2.1.3.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-ag5vqu0y/tesserocr/setup.py", line 11, in <module>
        from Cython.Distutils import build_ext
    ImportError: No module named 'Cython'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-ag5vqu0y/tesserocr/

I'm Python newbie, but I think this issue maybe due to lack of setup_requires or install_requires in https:/sirfz/tesserocr/blob/master/setup.py?

@sirfz
Copy link
Owner

sirfz commented Jan 22, 2017

pip install -r does not guarantee the order of modules installation. In your case, it's trying to install tesserocr before installing Cython. You can try one of the workarounds suggested here.

@sirfz sirfz closed this as completed Jan 22, 2017
@xkrt
Copy link
Author

xkrt commented Jan 28, 2017

@sirfz sorry, can you please read this issue pypa/pip#2478, especially this comment pypa/pip#2478 (comment) with answer
my issue not on the same topic?

@sirfz
Copy link
Owner

sirfz commented Jan 28, 2017

Yes, those are exactly what's happening in your case as far as I understand. You must install Cython before installing tesserocr.

Cython is a setup-requirement, not a runtime-requirement, so pip install tesserocr will not install Cython for you.

@xkrt
Copy link
Author

xkrt commented Jan 28, 2017

As far I understand this comment pypa/pip#2478 (comment) tesserocr should setup_requires Cython with "some lazy-import glue", because it impossible run setup.py without Cython

@sirfz
Copy link
Owner

sirfz commented Jan 28, 2017

I've already implemented this in the tesseract4 branch. Not sure how well pip plays with setup_requires though.

You can try it out by switching to that branch and pip install . from the repo's root directory.

@xkrt
Copy link
Author

xkrt commented Jan 28, 2017

Yes, this works for me:

$ virtualenv test
$ cd test/
$ source bin/activate
$ echo Cython >> requirements.txt
$ echo -egit+https:/sirfz/tesserocr/@tesseract4#egg=tesseocr >> requirements.txt
$ pip install -r requirements.txt

Thanks!

@xkrt
Copy link
Author

xkrt commented Feb 28, 2017

@sirfz is it possible backport your setup.py from tesseract4 branch to master? or publish current version of tesseract4 branch to pypi?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants