poke1024 / origami

A suite of batches and tools for OCR tasks.
71 stars 15 forks source link

ModuleNotFoundError: No module named 'shapely' #9

Open sepastian opened 3 years ago

sepastian commented 3 years ago

First off, thanks for origami, this looks promising and useful!

I'm following the installation instructions in README.md.

I am not using conda but asdf, so I skipped:

conda create --name origami python=3.7 -c defaults -c conda-forge --file origami/requirements/conda.txt
conda activate origami

and directly installed requirements with PIP:

# Install requirements.
pip install -v -r requirements/pip.txt 

I then try to give origami a first try with, which results in an error:

cd /path/to/origami
python -m origami.batch.detect.segment
Traceback (most recent call last):
  File "/home/sebastian/.asdf/installs/python/3.7.2/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/home/sebastian/.asdf/installs/python/3.7.2/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/sebastian/Code/origami/origami/batch/detect/segment.py", line 7, in <module>
    from origami.core.segment import SegmentationPredictor
  File "/home/sebastian/Code/origami/origami/core/segment.py", line 9, in <module>
    from origami.core.page import Page, Annotations
  File "/home/sebastian/Code/origami/origami/core/page.py", line 6, in <module>
    import shapely
ModuleNotFoundError: No module named 'shapely'

To fix this, installed shapely with:

pip install shapely

Shapely should be added to requirements.txt.

poke1024 commented 3 years ago

To get all necessary packages when using only pip you should try

pip install -v -r requirements/pip.txt 
pip install -v -r requirements/conda.txt 

...yes, the naming is not ideal.