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

Eynollah on Python 3.8 #24

Closed
nacho-pancho opened this issue Mar 5, 2021 · 18 comments
Closed

Eynollah on Python 3.8 #24

nacho-pancho opened this issue Mar 5, 2021 · 18 comments
Labels
enhancement New feature or request

Comments

@nacho-pancho
Copy link

Hi,
Eynollah's requirements include Tensorflow < 2. This option is not suppored on Python 3.8+. It will work on 3.7, but I'd prefer not install a dedicated environment for this. Will it break with a newer version? Do you have plans for upgrading it to TF 2.0+?
Thank you.

@cneud
Copy link
Member

cneud commented Mar 5, 2021

Hi Ignacio!

Yes this is quite painful. See also OCR-D/ocrd_all#219, OCR-D/ocrd_all#235 - these are getting more.

A problem with migrating to TF2 is that besides API changes, it appears models will need to be re-trained (takes weeks for some models in our case), then tested for regressions etc.

So it is on our agenda, but don't expect a very quick solution. Sorry :/

@kba
Copy link
Contributor

kba commented Mar 5, 2021

If you want to try out more OCR-D tools, then you're really best of with a dedicated Python 3.7 environment for that because there are other processors that will not work with 3.8. And since tensorflow decided not to build tensorflow 1.15 packages for python 3.8, we're pretty much stuck at 3.7 until we find the time and resources to retrain&upgrade all the tools, which as @cneud noted, might be a long while.

@stweil
Copy link

stweil commented Mar 24, 2021

@jbarth-ubhd
Copy link

I'm trying to install it with Ubuntu 18.04 (fresh schroot, native) with python 3.6, python 3.7 - no combination works:

# python3.7 -m pip install .
Could not find a version that satisfies the requirement tensorflow-gpu<2,>=1.15 (from eynollah==0.0.1) (from versions: 1.13.1, 1.13.2, 1.14.0, 2.0.0a0, 2.0.0b0, 2.0.0b1)
No matching distribution found for tensorflow-gpu<2,>=1.15 (from eynollah==0.0.1)

# python3.6 -m pip install .
Could not find a version that satisfies the requirement tensorflow-gpu<2,>=1.15 (from eynollah==0.0.1) (from versions: 0.12.1, 1.0.0, 1.0.1, 1.1.0, 1.2.0, 1.2.1, 1.3.0, 1.4.0, 1.4.1, 1.5.0, 1.5.1, 1.6.0, 1.7.0, 1.7.1, 1.8.0, 1.9.0, 1.10.0, 1.10.1, 1.11.0, 1.12.0, 1.12.2, 1.12.3, 1.13.1, 1.13.2, 1.14.0, 2.0.0a0, 2.0.0b0, 2.0.0b1)
No matching distribution found for tensorflow-gpu<2,>=1.15 (from eynollah==0.0.1)

@cneud
Copy link
Member

cneud commented Apr 7, 2021

@jbarth-ubhd Which version of pip are you using - or can you update pip and try again? tensorflow-gpu 1.15.5 is available on pypi: https://pypi.org/project/tensorflow-gpu/1.15.5/

@jbarth-ubhd
Copy link

python3.7 -m pip list | grep pip: pip (9.0.1)

@cneud
Copy link
Member

cneud commented Apr 7, 2021

That's a bit too old ;-) Can you try to update pip? I think a version of pip >19 is needed to find/fetch tensorflow-gpu 1.15.5.

@jbarth-ubhd
Copy link

That's Ubuntu 18.04 :-)

@jbarth-ubhd
Copy link

python3.7 -m pip install --upgrade pip helped.

@jbarth-ubhd
Copy link

Thanks!

@jbarth-ubhd
Copy link

could something like pip > 19 be added to requirements.txt?

@kba
Copy link
Contributor

kba commented Apr 7, 2021

could something like pip > 19 be added to requirements.txt?

It could but then you still have to run it twice because the first time round you're still using the old pip. It's a good idea in general to do pip install -U pip after a fresh install or a in a fresh venv. In ocrd_all it's part of the Makefile, so as soon as eynollah is part of ocrd_all, that would be the recommended way to install it.

@mikegerber
Copy link
Member

I'd like to note that when creating a Python virtualenv, you can specify the Python interpreter to use, i.e.:

virtualenv -p /usr/bin/python3.7 /tmp/venv-example

or, using mkvirtualenv (if you happen to prefer virtualenvwrapper, like me):

mkvirtualenv -p /usr/bin/python3.7 venv-example

My Linux system (Fedora Linux 32) offers to install older Python interpreters like Python 3.7 in addition to the default version (3.8), so this method is easily available to me.

@mikegerber
Copy link
Member

could something like pip > 19 be added to requirements.txt?

It could but then you still have to run it twice because the first time round you're still using the old pip. It's a good idea in general to do pip install -U pip after a fresh install or a in a fresh venv. In ocrd_all it's part of the Makefile, so as soon as eynollah is part of ocrd_all, that would be the recommended way to install it.

I agree with @kba. I would consider upgrading pip a best practice to do before anything else and the addition to requirements.txt doesn't help in most cases (I would even say it doesn't help in any case).

@cneud cneud added the wontfix This will not be worked on label Jun 8, 2021
@cneud cneud added enhancement New feature or request and removed wontfix This will not be worked on labels May 11, 2022
@bencomp
Copy link

bencomp commented Aug 2, 2022

Could you maybe add a note to the README about supported Python version(s)? And perhaps update the setup.py file too? I spent some time trying to install and run eynollah, only to now find out that the errors may have come from using Python 3.8 and newer through this issue.

Or is this no longer an issue?

@cneud
Copy link
Member

cneud commented Aug 2, 2022

Hi @bencomp! I'll make a note to update the README and setup.py - but actually the current master branch should in principle also work with Python 3.8, since we upgraded the tensorflow 1.x dependency that was mainly causing this. Can you share more details on the issues you encountered and perhaps make a new issue for that?

@bencomp
Copy link

bencomp commented Aug 2, 2022

Thanks, @cneud! Indeed installing went fine on Python 3.10 and 3.8, so my issue has nothing to do with the Python version. I'll look into opening a new issue.

@cneud
Copy link
Member

cneud commented Sep 13, 2022

Since the original problem was solved by the upgrade to tf2, this has not been an issue anymore.

The supported Python version has also been added to the readme. We will deal with Python >3.8 asap, but I will close here.

@cneud cneud closed this as completed Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

7 participants