ValueError: Das Objekt „Requirement“ hat kein Feld „use_pep517“, wenn Python-Pakete in einem Docker-Image installiert wePython

Python-Programme
Anonymous
 ValueError: Das Objekt „Requirement“ hat kein Feld „use_pep517“, wenn Python-Pakete in einem Docker-Image installiert we

Post by Anonymous »

Ich habe ein Problem beim Installieren von Python-Abhängigkeiten mithilfe von „pipenv“ in einer Docker-Datei.
Docker-Datei:

Code: Select all

RUN pip install --upgrade pip
RUN pip install pipenv

# Copy dependencies source code
WORKDIR /projects

# Copy project source code
WORKDIR /projects/source
COPY ./projects/source .

# Install packages
RUN pipenv install --system --deploy

Wir haben das Image erfolgreich mit den folgenden Pipenv-Abhängigkeiten erstellt:

Code: Select all

# Result of pip install pipenv
Successfully installed certifi-2023.5.7 distlib-0.3.6 filelock-3.12.2 pipenv-2023.7.11 platformdirs-3.9.1 setuptools-68.0.0 virtualenv-20.24.0 virtualenv-clone-0.5.7
Aber jetzt tritt dieser Fehler auf, wenn wir in unserem Docker-Image ein „pipenv install --system --deploy“ ausführen:

Code: Select all

# Result when executing pipenv install --system --deploy
Traceback (most recent call last):
File "/usr/local/bin/pipenv", line 8, in 
sys.exit(cli())
File "/usr/local/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 1130, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/pipenv/cli/options.py", line 58, in main
return super().main(*args, **kwargs, windows_expand_args=False)
File "/usr/local/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/pipenv/vendor/click/decorators.py", line 84, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/pipenv/cli/command.py", line 233, in install
do_install(
File "/usr/local/lib/python3.10/site-packages/pipenv/routines/install.py", line 170, in do_install
do_init(
File "/usr/local/lib/python3.10/site-packages/pipenv/routines/install.py", line 777, in do_init
do_install_dependencies(
File "/usr/local/lib/python3.10/site-packages/pipenv/routines/install.py", line 455, in do_install_dependencies
batch_install(
File "/usr/local/lib/python3.10/site-packages/pipenv/routines/install.py", line 596, in batch_install
batch_install_iteration(
File "/usr/local/lib/python3.10/site-packages/pipenv/routines/install.py", line 538, in batch_install_iteration
_cleanup_procs(project, procs, failed_deps_queue, retry=retry)
File "/usr/local/lib/python3.10/site-packages/pipenv/routines/install.py", line 651, in _cleanup_procs
dep.use_pep517 = True
File "/usr/local/lib/python3.10/site-packages/pipenv/vendor/requirementslib/models/common.py", line 18, in __setattr__
raise ValueError(f'"{self.__class__.__name__}" object has no field "{name}"')
ValueError: "Requirement" object has no field "use_pep517"
Mir ist eine leichte Änderung der distlib-Version aufgefallen, als Docker versucht, die Pipenv zu installieren, aber ich bin mir nicht sicher, ob das das Problem ist

Code: Select all

Successfully installed certifi-2023.5.7 distlib-0.3.7 filelock-3.12.2 pipenv-2023.7.11 platformdirs-3.9.1 setuptools-68.0.0 virtualenv-20.24.0 virtualenv-clone-0.5.7
Ich habe versucht, mein lokales Pipenv zu aktualisieren und Pipfile.lock neu zu erstellen, aber es gibt immer noch den gleichen Fehler, als ich versuchte, es in einem Docker-Image zu erstellen.

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post