CambridgeMolecularEngineering / chemdataextractor2

ChemDataExtractor Version 2.0
Other
121 stars 28 forks source link

Python version for 2.2.2 release #50

Closed ViktorWeissenborn closed 3 months ago

ViktorWeissenborn commented 6 months ago

Hey,

What python version are you using for the newest 2.2.2 cde release?

I can't get cde 2.2.2 installed and I am using a fresh conda environment, with miniconda on my system. I downloaded the latest release from GitHub assets "Source code (zip)" and installed from the setup.py file with "pip install ."

Before I was using python 3.7.9 which seemed to work fine until version 2.1.2, but then not anymore.

The error message I constantly get (and I am not getting past)when testing the cde installation with "cde --version" in terminal is as follows:

  File "/Users/viktorweissenborn/miniconda3/envs/CDE222/bin/cde", line 5, in <module>
    from chemdataextractor.cli import cli
  File "/Users/viktorweissenborn/miniconda3/envs/CDE222/lib/python3.7/site-packages/chemdataextractor/cli/__init__.py", line 66, in <module>
    from . import cluster, config, data, tokenize, pos, chemdner, cem, dict, evaluate
  File "/Users/viktorweissenborn/miniconda3/envs/CDE222/lib/python3.7/site-packages/chemdataextractor/cli/evaluate.py", line 17, in <module>
    from ..reader import RscHtmlReader, AcsHtmlReader, NlmXmlReader
  File "/Users/viktorweissenborn/miniconda3/envs/CDE222/lib/python3.7/site-packages/chemdataextractor/reader/__init__.py", line 16, in <module>
    from .pdf import PdfReader
  File "/Users/viktorweissenborn/miniconda3/envs/CDE222/lib/python3.7/site-packages/chemdataextractor/reader/pdf.py", line 12, in <module>
    from pdfminer.converter import PDFPageAggregator
  File "/Users/viktorweissenborn/miniconda3/envs/CDE222/lib/python3.7/site-packages/pdfminer/__init__.py", line 1, in <module>
    from importlib.metadata import version, PackageNotFoundError
ModuleNotFoundError: No module named 'importlib.metadata'

I am guessing this could be bypassed by using the correct python version..

kind regards Viktor

ViktorWeissenborn commented 6 months ago

I found the answer to my question: When I used python 3.8.1 the installation worked flawlessly. Any Version before 3.8 was not working!

The Python version for CDE seems to be quite important in general. For example when I tried using python 3.8.12 and higher the installation of CDE would again cause errors when trying to execute cde functions.

kind regards Vitkor

Dingyun-Huang commented 5 months ago

Interesting... We had dealt with this issue in 2.2.2 by this line in requirements pdfminer.six >=20160614, <=20220524 ; python_version < "3.8", which treats 3.8 or above separately from 3.7 or below.