First of all, thank you for being part of this beautiful community.
Explaining my problem. When I implemented my application in heroku, the following error appears when trying to install the somoclu library. locally I have no operational problems with any of the libraries.
I have tried to solve this problem by downloading the previous versions of the used libraries and the problem is still present.
I attach the libraries I am using and a screenshot of the error in heroku
Well, this doesn’t seem to be related to streamlit but somoclu which uses numpy in its setup file.
Even if numpy is written before somoclu in your requirements.txt, it won’t be ready to be used yet in somoclu’s setup.py. And the reason why it worked locally is maybe because numpy was already present in your python environment when you installed somoclu.
To fix the issue you’ll have to pip install numpy before installing somoclu.
Thank you very much for answering my problem, my question is where I install numpy so that I can run somoclu since even though it is first in the list of requirements it keeps throwing the error that is not installed.
The solution that comes to mind is to install it as follows in the app.py file and delete the somoclu library of requirements.txt
file app.py
import pandas as pd
import numpy as np
import pickle
import streamlit as st
import matplotlib.pyplot as plt
import plotly.express as px
import os
os.system('pip install somoclu==1.7.5')
import somoclu
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.