0

Using the method listed here: How to run python script in webpage, I can use my Python script in a web page. But what if that Python script needs to have something installed with PIP? Is it possible to install things using PIP if it's not installed?

JaceG
  • 134
  • 2
  • 15

1 Answers1

0

Whilst developing a web application you would identify what modules are required by your script. The convention is that they are added to a requirements.txt file which allows the process of installing the required modules to be automated. Pip can read the file and install the correct modules.

This is something that would be done when the production server is configured.

It wouldn't be advisable to have a method to allow the web application to install it's own modules during normal operation. This is likely to be a security risk.

scotty3785
  • 6,763
  • 1
  • 25
  • 35