Pakete können nicht zum UV-Projekt in Ubuntu hinzugefügt werdenPython

Python-Programme
Anonymous
 Pakete können nicht zum UV-Projekt in Ubuntu hinzugefügt werden

Post by Anonymous »

Nach einem Tutorial zu UV (Version 0.9.18) habe ich ein Projekt erstellt als:

Code: Select all

uv init new_app
und dann habe ich versucht, in diesem Ordner zwei Pakete wie
hinzuzufügen

Code: Select all

uv add --link-mode copy flask requests
aber das ergibt die folgende Ausgabe:

Code: Select all

Using CPython 3.11.10 interpreter at: /home/alex/.pyenv/versions/3.11.10/bin/python3.11
Creating virtual [url=viewtopic.php?t=25360]environment[/url] at: .venv\
error: failed to symlink file from /home/alex/.pyenv/versions/3.11.10/bin/python3.11 to /home/alex/new_app/.venv/bin/python: Operation not permitted (os error 1)
oder wenn ich es erneut versuche, erhalte ich die folgende Ausgabe:

Code: Select all

error: Project virtual [url=viewtopic.php?t=25360]environment[/url] directory `/home/alex/Work/Learn/UV/new_app/.venv` cannot be used because it is not a valid Python [url=viewtopic.php?t=25360]environment[/url] (no Python executable was found)
Links funktionieren also und das Kopieren funktioniert auch nicht? Fehlt mir etwas? Wie kann man dieses Problem beheben?
  • Das System ist ein VirtualBox-Ubuntu-System (24.04.3), das mit Python 3.11 auf einem Windows 11-Host läuft.
  • Ich möchte keinen Root-Zugriff verwenden (nie erforderlich, bevor ich mit Python arbeite). Oder funktioniert UV nur auf der Root-Ebene?
  • Alle Dateien in /home/alex/.pyenv/versions/3.11.10/bin sind nicht Root. Es handelt sich nur um normale Benutzerdateien (und auch die Verzeichnisse dazwischen).
  • Funktioniert unter Windows und macOS (aber nicht unter Ubuntu)
Folgen Sie den vorgeschlagenen Schritten:
  • Pyenv entfernt (hoffentlich korrekt)
  • Jetzt ist meine Schlüsselring-Installation weg
  • Code: Select all

    which python
    is /usr/bin/python
  • Code: Select all

    python -V
    ist 3.12.3 (sogar ich habe (?) Python 3.11 mit uv ??? installiert)
  • Code: Select all

    getcap /usr/bin/python
    gibt zurück: nichts
Danach:

Code: Select all

> uv init test2
Initialized project `test2` at `/home/alex/Work/Learn/UV/test2`
> cd test2
> uv add flask requests
Using CPython 3.11.14
Creating virtual [url=viewtopic.php?t=25360]environment[/url] at: .venv
error: failed to symlink file from /home/alex/.local/share/uv/python/cpython-3.11.14-linux-x86_64-gnu/bin/python3.11 to /home/alex/Work/Learn/UV/test2/.venv/bin/python: Operation not permitted (os error 1)
Es stellt sich heraus, dass es funktioniert, allerdings NICHT, wenn Sie sich auf einer gemounteten Festplatte befinden, die mit Windows geteilt wird. In diesem Fall sind Sie root (???) und da uv in allen Fällen versucht, Symlinks zu erstellen (auch wenn Sie uv mitteilen, dass Sie keine Symlinks haben möchten), funktioniert es nicht. Ist das ein Fehler in UV?

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post