MicheleCotrufo / pdf2doi

A python library/command-line tool to extract the DOI or other identifiers of a scientific paper from a pdf file.
101 stars 18 forks source link

Running this on Mac Big Sur in VSC, v 0.5 returns this error. v 0.4 does not. #5

Closed Pathos315 closed 3 years ago

Pathos315 commented 3 years ago

Traceback (most recent call last): File "/Users/johnfallot/venv/210706_PDN_ScienceAssistant_v16.py", line 3, in from pdf2doi.finders import validate File "/usr/local/lib/python3.9/site-packages/pdf2doi/init.py", line 13, in from .main import pdf2doi File "/usr/local/lib/python3.9/site-packages/pdf2doi/main.py", line 6, in import pdf2doi.utils_registry as utils_registry File "/usr/local/lib/python3.9/site-packages/pdf2doi/utils_registry.py", line 5, in import winreg ModuleNotFoundError: No module named 'winreg'

MicheleCotrufo commented 3 years ago

Thank you for posting this. This is due to the fact that pdf2doi tries to include the module winreg which exists only in Windows. This module is only needed for "advanced" functionalities (e.g. being able to call pdf2doi by just right-clicking on a pdf file), but it gets mistakenly loaded at very beginning of one of the main modules. I will fix this in the next version which will be released in a few days.

MicheleCotrufo commented 3 years ago

This was solved in version 0.6.