Unable to install streamlit with conda in new environment

Hi. I’ve decided to create this new discussion because I can’t reply the last one with same title. Besides, the last one didn’t help me.

As it is suggestioned on the last discussion, I created a new environment on Anaconda, with python version 3.9.13. It seemed that the person who suggested it had an experience with no conflits to install streamlit. I tried to install streamlit in this new environment’s terminal and I didn’t have the same experience.

Follow the message that appears when I try to install streamlit on new environment’s terminal:

WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘ProtocolError(‘Connection aborted.’, ConnectionResetError(10054, ‘Foi forçado o cancelamento de uma conexão existente pelo host remoto’, None, 10054, None))’: /simple/streamlit/
ERROR: Could not find a version that satisfies the requirement streamlit (from versions: none)
ERROR: No matching distribution found for streamlit

** the sentences in bold type appears 5 times and then appears the error.

Somebody could help me?

Sorry for any inconvenience. That wasn’t my intention.

Thanks in advance.

Are you able to install any other packages to the environment?

Searching for something similar to your error, I found a mention of using proxy to get around it. Does this thread provide any help? python 3.x - Pip can't install any package - Stack Overflow

Are you using conda-forge?

If you don’t have your conda configured to check conda-forge, you may need to pass it explicitly.

conda install streamlit -c conda-forge

Hi. I installed sklearn and joblib, but not streamlit.
I saw the link you suggested me.
I tried "python.exe -m pip install package --proxy=“proxy:port” but it didn’t work.

The error message:
ERROR: Could not install packages due to an OSError: Please check proxy URL. It is malformed and could be missing the host.

Maybe I need to write something instead of just copy the command.
Thanks.

Hello!
I tried your suggestion and it works! I could installed streamlit in my new environment!

However, I need one more help: in order to make work completely a browser with streamlit, seems like I need to install numpy C-extensions.

Follow the error messages on VScode:

ImportError:

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.

We have compiled some common reasons and troubleshooting tips at:

https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  • The Python version is: Python3.9 from “C:\Users\rocki\anaconda3\envs\environments\python.exe”
  • The NumPy version is: “1.22.3”

and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.

Original error was: DLL load failed while importing _multiarray_umath: it wasn’t possible to find the specific module.

Could you help installing the numpy C-extensions?

Thanks!

Hi, I have a similar problem. I wanted to experiment with streamlit, but couldn’t install it… :confused:

Using Windows 10. I uninstalled my whole python & anaconda (!), and reinstalled a fresh conda (version 23.3.1), then tried to install streamlit in a fresh clean environment, with no other packages in it:

(base) conda create --name clean-env python=3.10
(base) conda activate clean-env
(clean-env) conda install -c conda-forge streamlit

Mind you, this is the most clean slate I could get the machine to be: fresh conda, python, and environment. No other packages.

In addition, I have a feeling that the process is a bit flaky and non-determinstic: see for example the third line in the output here - if it solved the environment, why did it have to try the next package metadata file?

Anyway, here is the output after 40 minutes of waiting for it to solve the environment etc., after which I simply gave up and broke it. Sorry, it’s a fresh environment, so waiting that long seems like a bug, which might conceal other, sneakier, bugs.

Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: done
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.

CondaError: KeyboardInterrupt

^CTerminate batch job (Y/N)?
^C

Will appreciate any insights on the matter!
April 3rd, 2023.

p.s. after looking for solutions in other places - I don’t know how to request it more politely, so I’ll just say it: please do not close issues and tickets arbitrarily (e.g. because streamlit version has changed, so this issue may not be applicable etc.).

Hi, I have a similar problem. I wanted to experiment with streamlit, but couldn’t install it… :confused:

Using Windows 10. I uninstalled my whole python & anaconda (!), and reinstalled a fresh conda (version 23.3.1), then tried to install streamlit in a fresh clean environment, with no other packages in it:

(base) conda create --name clean-env python=3.10
(base) conda activate clean-env
(clean-env) conda install -c conda-forge streamlit

Mind you, this is the most clean slate I could get the machine to be: fresh conda, python, and environment. No other packages.

In addition, I have a feeling that the process is a bit flaky and non-determinstic: see for example the third line in the output here - if it solved the environment, why did it have to try the next package metadata file?

Anyway, here is the output after 40 minutes of waiting for it to solve the environment etc., after which I gave up and broke it. Sorry, it’s a fresh environment, so waiting that long seems like a bug, which might conceal other, sneakier, bugs.

Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: done
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.

CondaError: KeyboardInterrupt

^CTerminate batch job (Y/N)?
^C

Will appreciate any insights on the matter!
April 3rd, 2023.

p.s. after looking for solutions in other places - I don’t know how to request it politely, so I’ll just say it: please do not close issues and tickets arbitrarily (e.g. because streamlit version has changed, so this issue may not be applicable etc.).

(note: this was posted twice, because the original post was automatically hidden by “Akismet” (spam detector bot?), without me being clearly notified, so I naturally assumed that it’s a bug in this forum service and reposted it)

Is using the python installer from python.org and pip an option for you? I have found it much easier to work with than conda.

Hi @Goyo , thanks for replying.

  1. If I prefer to use conda as my package manager + virtual environments in general, then: no, unfortunately, using pip is not a valid solution, sorry.

  2. If streamlit is officially not supporting conda anymore, that’s okay. It would just be easier for us users to be aware of that.

  3. On that note, there are some mixed messages here: I suddenly found in a weird sidenote here from version 0.46.0 back in 2019 - Changelog - Streamlit Docs - that “We’ve therefore deactivated our Conda repo.” (!!!). However, the original OP @RodrigoHigashi wrote his question here in 2022, and a streamlit Team Member advised him to use conda -c conda-forge etc., so apparently you did not deactivate your conda repo after all?.. Unclear.

My question still stands. Please read it carefully, and see how I tried using streamlit in a “clean slate” environment. Please advise.

p.s. please do not close this ticket yet?

I can’t speak on behalf of the devs and packagers, I just know what works best for me. I don’t know how to help you with Conda, hopefully somebody more experienced with that will step in.

No one is going around closing tickets arbitrarily, so no need to worry. My very first post on the forum got temporarily hidden as well. Brand new account plus new post = some rate limiting/spam detection that will self resolve.

Have you attempted to create a clean conda environment more than once? (Sometimes it can fail to install and then work if you try again…I know, definition of insanity…)

Make sure you don’t have any antivirus that might be subtly messing up any of the installation/environment creation.

Do you have any objection to trying environment management/Streamlit installation from the Anaconda GUI vs command line? I use Anaconda to manage all my environments. Sometimes I install into my Anaconda environment using the GUI, sometimes conda via command line, and sometimes pip using command line.

Other than that, I yield to a dev to speak in terms of more nitty-gritty detail.

Thanks for your reply.

I personally prefer, as a user, not to use Anaconda GUI. Also, not really into giving conda / Miniconda multiple attempts. As you may have guessed, I already tried installing streamlit multiple times into environments that also had other packages in them, and not just that “clean env” that I described. Also, I think I know what you refer to when you talk about failing to install via conda / antivirus / network etc. - I believe that it wasn’t it in my case.

All in all, my personal subjective preference / approach: if the packages and dependencies etc. are not stable enough so the installation process is susceptible to minor interferences, and/or it takes it more than 10 minutes to install - it’s not stable enough for me, and I wouldn’t use it.

Thanks again for your feedback. I’ll stick with flask.

Hey, Sorry for the delay in response. I wish I could provide some ideas, but we just ran a fresh install on Windows 11 machine, and it worked as expected. I wish I could reliably reproduce the issue to find out what’s going on.

What I can say is based on the error, I see some confusion in the dependency resolution. I did notice in testing that the protobuf resolution is quite weird. Anaconda, marks protobuf with its minor.patch version whereas PyPi adds a major version. I wonder if that’s making the dependency resolver work too hard that it’s impossible to resolve on your side. Perhaps the solution is to download the protobuf version (I believe it’s 3.20.3 via pip) and then install. This is all a hunch.

I did reach out about this, and they do not seem to be open to changing this setup. Perhaps there’s a way to get this working in the protobuf feedstock for conda-forge?

I wish I can provide greater help here, but hopefully this can provide context and ideas to help resolve the issue.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.