• 0 Posts
  • 5 Comments
Joined 1 year ago
cake
Cake day: June 11th, 2023

help-circle




  • Perfect use case. pipx is awesome for Python! Glad you found a great easy solution.

    Is it over engineering or error prone?

    Nope. pipx is like a big guard rail to keep you from doing error prone things with system Python.

    In these examples we’ll assume your venv is at /home/TrueBlue/project/venv

    Is there another way…?

    • shebang: Set your #! to point at your Python venv runtime
      #!/home/TrueBlue/project/venv python3
      Now you can just run your Python file and it’ll use the correct Python runtime.
    • poetry can be useful for running personal projects using poetry run.
    • In linux you can use an alias to create to call your venv Python runtime with your package.

    e.g. I want to use a new command named sdf to call my app.

    alias sdf="/home/TrueBlue/project/venv/bin/python3 my_app.py"