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

Support for python env managers #1010

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open

Support for python env managers #1010

wants to merge 16 commits into from

Conversation

lfoppiano
Copy link
Collaborator

@lfoppiano lfoppiano commented May 6, 2023

This PR adds support for python virtual environments for JDK 11+. Should be merged after #921.
It supports venv and conda.

Update: I've noticed I'm not able to run grobid natively on linux without installing the python dependencies as a system dependencies. Usually I've correlate the use of this PR with the removal of the JEP library under the grobid-home, in favour of the JEP installed in the python library / virtual environment.

We could improve the detection of the python version.

@lfoppiano lfoppiano marked this pull request as draft May 6, 2023 09:40
@lfoppiano lfoppiano added this to the 0.7.3 milestone May 6, 2023
@kermitt2 kermitt2 modified the milestones: 0.7.3, 0.8.0 May 6, 2023
@coveralls
Copy link

coveralls commented Mar 12, 2024

Coverage Status

coverage: 40.768% (-0.01%) from 40.781%
when pulling 8a16401 on python-envs
into 37dcec1 on master.

@lfoppiano lfoppiano removed this from the 0.8.0 milestone Jun 9, 2024
@lfoppiano lfoppiano added this to the 0.8.2 milestone Sep 9, 2024
@lfoppiano lfoppiano marked this pull request as ready for review September 9, 2024 02:56
@lfoppiano
Copy link
Collaborator Author

lfoppiano commented Nov 29, 2024

With this PR is possible to run a different version than 3.8 (the jep shipped with grobid requires python 3.8) and relay on conda for the environment.

Here what I did for running DL models natively using a conda environment:

  1. cd grobid
  2. Switch to this branch
  3. rm -rf grobid-home/lib/lin-64/jep
  4. cd ..
  5. git clone https://github.com/kermitt2/delft (delft should be in the parent directory)
  6. assuming conda is installed (if not, I installed this) and the environment delft has been created with either python=3.8 or python=3.9 (e.g. conda create --name delft python=3.8
  7. pip install delft==0.3.4
  8. conda install jep=4.1.1 (conda will install also openjdk 8)
  9. conda uninstall --force openjdk-8
  10. conda install --force openjdk-17
  11. change any model in the grobid config to use delft instead of wapiti (e.g. header model)
  12. ./gradlew run

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

Successfully merging this pull request may close these issues.

3 participants