Hi,
I am trying to deploy my python scripts which involve externally installed python packages to Digital Ocean Functions, however, I get the following error every time during the deployment process
Installing collected packages: psycopg2, numpy, pandas ERROR: Could not install packages due to an OSError: [Errno 30] Read-only file system: ‘/usr/local/lib/python3.9/site-packages/psycopg2’
Here are how my scripts and folders are structured:
cryptometrics
My project.yml script is as follow:
packages:
- name: sentiment
actions:
- name: summary
runtime: 'python:default'
The requirements.txt file contains all Python packages that need to be installed:
pandas==1.4.2
psycopg2==2.9.3
The build.sh file contains instructions to install packages during the remote build process during deployment
#!/bin/bash
set -e
virtualenv virtualenv
source virtualenv/bin/activate
pip install -r requirements.txt
deactivate
This error would pop up after running the following command for a while:
doctl serverless deploy cryptometrics --remote-build
Does anyone here face this problem before?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hi there,
I’ve just tried this with the following sample function:
https://github.com/digitalocean/sample-functions-python-sendgrid-email
The sample function has the same instruction as the one that you’ve described, however it seems to be working as expected.
What I could suggest is, if you have the
cryptometrics
already deployed, try to deleted it and redeploy it again with the command that you’ve provided.Let me know how it goes!
Best,
Bobby