ERROR: Invalid requirement: '-'
WARNING: You are using pip version 22.0.3; however, version 22.3.1 is available.
You should consider upgrading via the '/home/appuser/venv/bin/python -m pip install --upgrade pip' command.
Checking if Streamlit is installed
──────────────────────────────────────────────────────
[12:40:32] ❗️ installer returned a non-zero exit code
[12:40:32] ❗️ Error during processing dependencies! Please fix the error and push an update, or try restarting the app.
Hi everyone, I’m trying to deploy a very trivial dashboard and I always get this error.
The imports are:
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
import scipy.stats
import streamlit as st
and the requirements.txt that I tried where:
scipy
matplotlib
numpy
pandas
streamlit
scipy.stats
matplotlib.pyplot
numpy
pandas
streamlit
and this with the corresponding version numbers
scipy==123
matplotlib==123
numpy==123
pandas==123
streamlit==123
Where’s my mistake?
Thank you in advance
Franky1
December 12, 2022, 9:47pm
2
Welcome to the community.
Please share a link to your public github repo.
1 Like
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
import scipy.stats
import streamlit as st
# from tqdm import tqdm
# from sampleSplit import *
# from sampleSplit_copy import *
# import seaborn as sns
# import plotly.express as px
#sampleSplit_copy function
class sampleSplit():
def __init__(self, df, col: str, target: str):
# initialize the splitters
self.median = df[col].median()
self.iq_range_mean_point = (((df[col].quantile([0.25,0.75])).iloc[0] + (df[col].quantile([0.25,0.75])).iloc[1]))/2
self.m = df[col].mean()
self.minmax_mean_point = (df[col].max() + df[col].min())/2
This file has been truncated. show original
The repo is extra-project-on-t-test
The link brings to the app script
Hi @LeonardoAcquaroli
The error results from a combination of having spaces in the directory name and using the incorrect syntax in your requirements file.
The steps to resolve your issue:
Rename the Project 5 - States data folder to not have spaces. Something like Project-5-States-data
. Replace the empty spaces with -
.
Fix the errors in your requirements file. The package is scipy
, not scipy.stats . The package is matplotlib
, not matplotlib.pyplot .
Once you make the above changes, and deploy your app, it should install the requirements:
You will run into other errors unrelated to this thread. Namely, your script tries to load files from non-existent directories. You will have to change those filepaths in your code to
states = pd.read_excel(r"Project-5-States-data/State data.xlsx")
After which you will run into another error about a missing openpyxl
dependency required to read Excel files with Pandas. So you will also have to include openpyxl
in requirements.txt
:
scipy
matplotlib
numpy
pandas
streamlit
openpyxl
Doing all of the above will finally lead to a successful deploy:
2 Likes
Awesome help!
Many thanks!
1 Like