Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. LAMP
  3. Is this pip install persistent for app updates?

Is this pip install persistent for app updates?

Scheduled Pinned Locked Moved Solved LAMP
pythonpython3venvlamp
5 Posts 2 Posters 60 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • imc67I Offline
    imc67I Offline
    imc67
    translator
    wrote last edited by imc67
    #1

    For a specific script (check via API the mail logs if there is a S3150 Micros$%t bounce) I needed this:

    pip3 install --user requests --break-system-packages
    

    Now the script works perfectly and via cron checks every hour the logs and informs via Pushover. However is this specific pip install persistent over app restart / update?

    1 Reply Last reply
    1
    • jamesJ Offline
      jamesJ Offline
      james
      Staff
      wrote last edited by
      #4

      Hello @imc67
      You can use venv or uv to create virtual environments.
      Here is a quick cheatsheet for venv => https://aaronlelevier.github.io/virtualenv-cheatsheet/
      Many prefer uv these days, see => https://github.com/astral-sh/uv

      imc67I 1 Reply Last reply
      1
      • jamesJ Offline
        jamesJ Offline
        james
        Staff
        wrote last edited by
        #2

        Hello @imc67
        Since the --user flag installed packages as a user, when you run this in the LAMP as root, it will install packages into /root/.local/lib/python3.12/site-packages/
        And since /root/.local/ is a symbolic link to /root/.local -> /run/root.local /run is not included in the backup.

        What you want to do is create a virtual environment with pip in /app/data/ and use that environment.
        That will be included in the backup.

        imc67I 1 Reply Last reply
        2
        • jamesJ james

          Hello @imc67
          Since the --user flag installed packages as a user, when you run this in the LAMP as root, it will install packages into /root/.local/lib/python3.12/site-packages/
          And since /root/.local/ is a symbolic link to /root/.local -> /run/root.local /run is not included in the backup.

          What you want to do is create a virtual environment with pip in /app/data/ and use that environment.
          That will be included in the backup.

          imc67I Offline
          imc67I Offline
          imc67
          translator
          wrote last edited by
          #3

          @james said in Is this pip install persistent for app updates?:

          What you want to do is create a virtual environment with pip in /app/data/ and use that environment.
          That will be included in the backup.

          Thanks for your feedback! Can you advise on what command to use to create this?

          1 Reply Last reply
          0
          • jamesJ Offline
            jamesJ Offline
            james
            Staff
            wrote last edited by
            #4

            Hello @imc67
            You can use venv or uv to create virtual environments.
            Here is a quick cheatsheet for venv => https://aaronlelevier.github.io/virtualenv-cheatsheet/
            Many prefer uv these days, see => https://github.com/astral-sh/uv

            imc67I 1 Reply Last reply
            1
            • jamesJ james

              Hello @imc67
              You can use venv or uv to create virtual environments.
              Here is a quick cheatsheet for venv => https://aaronlelevier.github.io/virtualenv-cheatsheet/
              Many prefer uv these days, see => https://github.com/astral-sh/uv

              imc67I Offline
              imc67I Offline
              imc67
              translator
              wrote last edited by
              #5

              @james said in Is this pip install persistent for app updates?:

              Hello @imc67
              You can use venv or uv to create virtual environments.
              Here is a quick cheatsheet for venv => https://aaronlelevier.github.io/virtualenv-cheatsheet/
              Many prefer uv these days, see => https://github.com/astral-sh/uv

              thanks again! I used venv and it works very well!

              1 Reply Last reply
              2
              • imc67I imc67 marked this topic as a question
              • imc67I imc67 has marked this topic as solved
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Bookmarks
              • Search