Managing your Streamlit dependencies using conda

Unofficially streamlit was supporting conda dependencies via the conda.txt file and custom conda channels via the conda_channles.txt file. If you were using this feature you should migrate to the new supported environment.yml configuration file.

Example of migrating from conda.txt and conda_channles.txt to environment.yml:

conda.txt

numpy==1.18.1
scikit-learn==0.22.2.post1

conda_channles.txt

conda-forge

The two above files should be converted to one environment.yml file:

environment.yml

channles:
  - conda-forge
dependencies:
  - numpy==1.18.1
  - scikit-learn==0.22.2.post1

For more information about the environment.yml please consult the conda documentation.

4 Likes

Thanks for your solution, now my app is working! :v:

1 Like

The ability to download from conda-forge opens so many new possibilities :heart: will test ASAP!

ah and welcome to the community @gmerticariu :slight_smile:

I have as well dependencies issue but I’m using requirements.txt file

this is what the file contain:

streamlit~=0.62.0
pytube~=10.7.2
pathlib2~=2.3.5
os-sys~=2.1.4

Try deleting and recreating the app. This should fix your issue.

Hi, I have such a directory structure:

src
  |--- ...
  |--- environment.yml
  |--- main.py

and my dependency file: environment.yml

name: vudoku
dependencies:
- pip:
    - streamlit_webcam_example==0.1.0
    - streamlit==0.82.0
    - Keras==2.4.3
    - numpy==1.20.3
    - Pillow==8.2.0
    - opencv-python-headless

But there’s error deploying the app:

Here’s the source code. I’ve tried rebooting and recreating the application but it does not work.

Can anyone please help me resolve this?

What is the error message in the log?

log.txt

[client] Provisioning machine...
[client] Preparing system...
[manager] [0mStarting up for owner: 'joe733', repository: 'vudoku', branch: 'main', main module: 'src/main.py'
[manager] [0mCloning repository ...
[manager] [0mCloning into 'vudoku'...

[manager] [0mCloned repository!
[manager] [0mProcessing dependencies ...

SpecNotFound: Invalid name, try the format: user/package

[manager] [0minstaller returned a non-zero exit code
[manager] [0mError during processing dependencies! Please fix the error and push an update, or try restarting the app.
[client] Spinning up manager process...

is that what you’re referring to?

I guess this is conda issue. See: Error from `conda env create --name test` · Issue #3859 · conda/conda · GitHub

When creating conda environment does Sreamlit use env like: conda env create -n test. I don’t know, if it does, how to change it to conda create -n test?

1 Like

I am having the same problem when deploying an app with environment.yml and get the exact same error: SpecNotFound: Invalid name, try the format: user/package

Any solution to this?