ERROR: Invalid requirement: '-' installer returned a non-zero exit code ``` ``` Error during processing dependencies! Please fix the error and push an update, or try restarting the app

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

Welcome to the community.
Please share a link to your public github repo.

1 Like

The repo is extra-project-on-t-test
The link brings to the app script

Hi @LeonardoAcquaroli :wave:

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:

  1. Rename the Project 5 - States data folder to not have spaces. Something like Project-5-States-data. Replace the empty spaces with -.
  2. 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:

:sweat_smile:

2 Likes

Awesome help!
Many thanks!

1 Like