E: Failed to fetch http://deb.debian.org/debian/pool/main/p/python3.7/python3.7-minimal_3.7.3-2+deb10u2_amd64.deb 404 Not Found [IP: 151.101.54.132 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
I tried to use --fix-missing but it didn’t work for me
Give us a bit more context please.
Are we talking about Streamlit sharing?
If yes, please provide a link to your public github repo.
I am guessing you are using the librosa library?
Could you first try replacing libsndfile-dev in line 5 of packages.txt with libsndfile1 ? If that doesn’t work, try replacing it with libsndfile1-dev and let us know if it helps
Hi @snehankekre! Thanks for the answer, but it doesn’t work for me either. I replaced libsndfile-dev with libsndfile1-dev and then with libsndfile1 and even tried to install both of them, but the error remained.
I was able to fork your repo and successfully deploy to Streamlit Sharing after adding libsndfile1-dev to packages.txt. The contents of the file are exactly the following:
I also noticed that your requirements.txt is bloated with lots of packages that I don’t think are needed. This can also lead to unwanted problems during deployment.
Hi @Franky1!
Wow, thank you very much for your help
I definitely need to learn more about deployment. Could you recommend some tools for me to determine which libraries I need for a project and which ones are unnecessary?
Regarding the python pip libraries, this is relatively simple.
All imports that do not belong to the Python standard library and that you use in your python program with import must be entered in the requirements.txt file.
There is also a python tool called pipreqs that scans the python scripts for non-standard import modules and writes them to a requirements.txt file.
But be careful: Sometimes the import modules are named differently than the package name you want to install.
For example: import cv2 versus pip install opencv-python-headless
There is no quick answer for the dependencies to be entered in packages.txt. To my knowledge, there is no tool for that either. Most python pip packages do not need additional apt install packages.
If they do, only helps: I look in the documentation of the python libraries, usually there is described which external libraries are required as prerequisites.
For corresponding error messages you can also google, but not everything you find e.g. on stackoverflow is correct and up to date. A lot of information is outdated.
Also, I usually test my streamlit app locally first in a Docker container, which is very similar to the streamlit sharing runtime. If there are no error messages anymore and the streamlit app works, the deployment to streamlit sharing usually works as well.
You can also find the corresponding Docker files in my cloned github repo.
Those are not Python packages and should not be included in your requirements. They are apt-get dependencies and belong in their own packages.txt file. However, for librosa, only libsndfile1-dev is required in packages.txt.
Create a new packages.txt file containing only:
libsndfile1-dev
Once you’ve removed those entries from your requirements and have created the packages.txt file, your app should successfully deploy on Streamlit Sharing
The instructions in this thread are specific to deployments on Streamlit sharing. Deployments on App Engine won’t install apt-get dependencies from your packages.txt file.
Have you tried including your apt-get dependencies in your Dockerfile? For example, after you pip install your Python dependencies:
RUN apt-get update && apt-get install -y libsndfile1-dev
I also ran into the error of OSError: sndfile library not found when i tried to do import librosa. I tried tactics mentioned above:
Create packages.txt that contains libsndfile1-dev
Create requirement.txt with librosa - that’s similar to the public repos above.
Reboot the app, delete and create a new app.
Yet still got the same error. May I ask for some help from the community?
The repo is https://github.com/bojne/capstone-dev/app and the file that has error is app.py.
I resolved this issue by putting the packages.txt at the root directory. This was an issue when I put the packages.txt at a sub folder of the repo. Hope this helps someone!
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.