How to install Python external libraries?
-
Hi there,
for a Python script I need the external Python library "Beautiful Soup" installed on the LAMP system. Trying to do so, I run in an error:pip3 install beautifulsoup4 Defaulting to user installation because normal site-packages is not writeable Collecting beautifulsoup4 Downloading beautifulsoup4-4.9.3-py3-none-any.whl (115 kB) Collecting soupsieve>1.2; python_version >= "3.0" Downloading soupsieve-2.2-py3-none-any.whl (33 kB) Installing collected packages: soupsieve, beautifulsoup4 ERROR: Could not install packages due to an EnvironmentError: [Errno 30] Read-only file system: '/root/.local'
How would I solve this issue? I tried also:
apt install python3-bs4 Reading package lists... Done Building dependency tree Reading state information... Done W: Not using locking for read only lock file /var/lib/dpkg/lock-frontend W: Not using locking for read only lock file /var/lib/dpkg/lock E: Unable to locate package python3-bs4
So, I run out of options at the moment. Does anyone have a hint for me?
Thanks in advance,
why42 -
Hi,
apps on Cloudron run on a read-only root file system, so further system dependencies cannot be installed dynamically. Out of interest, how are you using python apps within the LAMP app?
To resolve your issue, one option is to build your own app package with all the assets your app requires. We have some information with examples on this at https://docs.cloudron.io/custom-apps/guide/
Also there is a forum section for app packaging https://forum.cloudron.io/category/96/app-packaging-development
-
Thanks nebulon for the quick reply.
I just want to use a homegrown python script to run within the LAMP app. The Python script has some dependencies for external Python libraries like Beautiful Soup.
So perhaps I am out of scope with my request for the LAMP app?