Access setuptools from inside virtual environment #6417
-
Output of
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
It's an upstream issue. As I understand it, A stopgap measure is to inject % invoice2data
Traceback (most recent call last):
File "/Users/aho/.local/bin/invoice2data", line 5, in <module>
from invoice2data.main import main
File "/Users/aho/.local/pipx/venvs/invoice2data/lib/python3.13/site-packages/invoice2data/__init__.py", line 1, in <module>
from .main import extract_data # noqa: F401
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/aho/.local/pipx/venvs/invoice2data/lib/python3.13/site-packages/invoice2data/main.py", line 20, in <module>
from invoice2data.extract.loader import read_templates
File "/Users/aho/.local/pipx/venvs/invoice2data/lib/python3.13/site-packages/invoice2data/extract/loader.py", line 14, in <module>
import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'
% pipx inject invoice2data setuptools
injected package setuptools into venv invoice2data
done! ✨ 🌟 ✨
% invoice2data
/Users/aho/.local/pipx/venvs/invoice2data/lib/python3.13/site-packages/invoice2data/extract/loader.py:14: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
import pkg_resources
usage: invoice2data [-h] [--input-reader {pdftotext,tesseract,pdfminer,pdfplumber,gvision,text,ocrmypdf}] [--output-format {csv,json,xml,none}]
[--output-date-format OUTPUT_DATE_FORMAT] [--output-name OUTPUT_NAME] [--debug] [--copy COPY] [--move MOVE] [--filename-format FILENAME]
[--template-folder TEMPLATE_FOLDER] [--exclude-built-in-templates]
input_files [input_files ...]
invoice2data: error: the following arguments are required: input_files |
Beta Was this translation helpful? Give feedback.
It's an upstream issue. As I understand it,
pkg_resourceshas been deprecated sincesetuptoolsitself was removed from default Python 3.12 installations, i.e. almost 2 years ago.A stopgap measure is to inject
setuptoolsinto theinvoice2datavenv. However,invoice2dataitself may break permanently by the end of this year (2025), unless upstream commits the necessary changes to move away frompkg_resources:-