Install Streamlit with Anaconda

Is it possible?
The last time I installed something with pip it broke my anaconda installation… Thus if the package could be installed through something similar to “conda install streamlit” it would be great!

2 Likes

Found the solution in Conda User’s Guide.
A short sum up:

conda activate base
pip install streamlit

Then check the install by doing:

conda list | grep streamlit

If it doesn’t appear, read the guide, there’s a solution there.

3 Likes

I was able to install streamlit using pip inside of a Conda environment, but would highly recommend NOT to install it to “base” environment.

Here are the steps I followed to go from 0 to running the Streamlit demo:

conda create streamlit // create new Conda environment
conda activate streamlit // switch to new env
pip install streamlit
streamlit hello

Please note that “conda list” does not show the streamlit package for this env (contrary to the answer from soqueroprogramar above), even though streamlit seems to work fine. (Might be a conda update has changed this behavior since her/his answer?)

2 Likes

That is correct @samudranb, installing a package to the base Anaconda environment somewhat defeats the purpose of conda.

Welcome to the Streamlit community!

I am not able to install streamlit.
steps i followed are as follows:

  1. conda create -y -n streamlit python=3.7
  2. conda activate streamlit
  3. pip install streamlit

Hello @raj_waje, welcome to the community !

When you say you are not able to install streamlit, what error are you running in ? Do you have any particular log trace from the terminal ?

Best,
Fanilo

sir please help me

while I am running streamlit run app.py
this is showing
Traceback (most recent call last):
File “C:\Users\USER\AppData\Local\Programs\Python\Python39\lib\runpy.py”, line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File “C:\Users\USER\AppData\Local\Programs\Python\Python39\lib\runpy.py”, line 87, in run_code
exec(code, run_globals)
File "C:\Users\USER\PycharmProjects\pythonProject\venv\Scripts\streamlit.exe_main
.py", line 7, in
File “c:\users\user\pycharmprojects\pythonproject\venv\lib\site-packages\click\core.py”, line 829, in call
return self.main(*args, **kwargs)
File “c:\users\user\pycharmprojects\pythonproject\venv\lib\site-packages\click\core.py”, line 782, in main
rv = self.invoke(ctx)
File “c:\users\user\pycharmprojects\pythonproject\venv\lib\site-packages\click\core.py”, line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “c:\users\user\pycharmprojects\pythonproject\venv\lib\site-packages\click\core.py”, line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “c:\users\user\pycharmprojects\pythonproject\venv\lib\site-packages\click\core.py”, line 610, in invoke
return callback(*args, **kwargs)
File “c:\users\user\pycharmprojects\pythonproject\venv\lib\site-packages\streamlit\cli.py”, line 161, in main_run
bootstrap.load_config_options(flag_options=kwargs)
File “c:\users\user\pycharmprojects\pythonproject\venv\lib\site-packages\streamlit\bootstrap.py”, line 318, in load_config_options
config.get_config_options(force_reparse=True, options_from_flags=options_from_flags)
File “c:\users\user\pycharmprojects\pythonproject\venv\lib\site-packages\streamlit\config.py”, line 1082, in get_config_options
_update_config_with_toml(file_contents, filename)
File “c:\users\user\pycharmprojects\pythonproject\venv\lib\site-packages\streamlit\config.py”, line 959, in _update_config_with_toml
parsed_config_file = toml.loads(raw_toml)
File “c:\users\user\pycharmprojects\pythonproject\venv\lib\site-packages\toml\decoder.py”, line 433, in loads
raise TomlDecodeError(“Key group not on a line by itself.”,
toml.decoder.TomlDecodeError: Key group not on a line by itself. (line 1 column 1 char 0)
PS C:\Users\USER\PycharmProjects\pythonProject> conda create -y -n streamlit python=3.7

please help me sir

conda install streamlit it’s right command

If I install pip install streamlit with python 2.7 I got this error.

 Downloading terminado-0.8.3-py2.py3-none-any.whl (33 kB)
Collecting prometheus-client
  Using cached prometheus_client-0.11.0-py2.py3-none-any.whl (56 kB)
Collecting ipaddress; python_version == "2.7"
  Downloading ipaddress-1.0.23-py2.py3-none-any.whl (18 kB)
Collecting nbconvert<6.0
  Downloading nbconvert-5.6.1-py2.py3-none-any.whl (455 kB)
     |################################| 455 kB 6.0 MB/s
Collecting pyzmq>=17
  Downloading pyzmq-19.0.2-cp27-cp27m-win_amd64.whl (687 kB)
     |################################| 687 kB 5.7 MB/s
Collecting pywin32>=1.0; sys_platform == "win32"
  Downloading pywin32-228-cp27-cp27m-win_amd64.whl (7.5 MB)
     |################################| 7.5 MB 4.1 MB/s
Collecting backports.functools-lru-cache>=1.2.1; python_version < "3.2"
  Downloading backports.functools_lru_cache-1.6.4-py2.py3-none-any.whl (5.9 kB)
Collecting pywinpty>=0.5; os_name == "nt"
  Downloading pywinpty-1.1.0.tar.gz (48 kB)
     |################################| 48 kB 3.0 MB/s
  Installing build dependencies ... error
  ERROR: Command errored out with exit status 1:
   command: 'c:\python27\python.exe' 'c:\python27\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'c:\users\nikul\appdata\local\temp\pip-build-env-mftrcv\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- maturin
       cwd: None
  Complete output (14 lines):
  DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
  Collecting maturin
    Downloading maturin-0.11.2.tar.gz (109 kB)
    Installing build dependencies: started
    Installing build dependencies: finished with status 'error'
    ERROR: Command errored out with exit status 1:
     command: 'c:\python27\python.exe' 'c:\python27\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'c:\users\nikul\appdata\local\temp\pip-build-env-ljjjc_\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools~=53.0.0' 'wheel~=0.36.2' 'toml~=0.10.2'
         cwd: None
    Complete output (3 lines):
    DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
    ERROR: Could not find a version that satisfies the requirement setuptools~=53.0.0 (from versions: 0.6b1, 0.6b2, 0.6b3, 0.6b4, 0.6rc1, 0.6rc2, 0.6rc3, 0.6rc4, 0.6rc5, 0.6rc6, 0.6rc7, 0.6rc8, 0.6rc9, 0.6rc10, 0.6rc11, 0.7.2, 0.7.3, 0.7.4,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21.2.2, 22.0.0, 22.0.1, 22.0.2, 22.0.4, 22.0.5, 23.0.0, 23.1.0, 23.2.0, 23.2.1, 24.0.0, 24.0.1, 24.0.2, 24.0.3, 24.1.0, 24.1.1, 24.2.0, 24.2.1, 24.3.0, 24.3.1, 25.0.0, 25.0.1, 25.0.2, 25.1.0, 25.1.1, 25.1.2, 25.1.3, 25.1.4, 25.1.5, 25.1.6, 25.2.0, 25.3.0, 25.4.0, 26.0.0, 26.1.0, 26.1.1, 27.0.0, 27.1.0, 27.1.2, 27.2.0, 27.3.0, 27.3.1, 28.0.0, 28.1.0, 28.2.0, 28.3.0, 28.4.0, 28.5.0, 28.6.0, 28.6.1, 28.7.0, 28.7.1, 28.8.0, 28.8.1, 29.0.0, 29.0.1, 30.0.0, 30.1.0, 30.2.0, 30.2.1, 30.3.0, 30.4.0, 31.0.0, 31.0.1, 32.0.0, 32.1.0, 32.1.1, 32.1.2, 32.1.3, 32.2.0, 32.3.0, 32.3.1, 33.1.0, 33.1.1, 34.0.0, 34.0.1, 34.0.2, 34.0.3, 34.1.0, 34.1.1, 34.2.0, 34.3.0, 34.3.1, 34.3.2, 34.3.3, 34.4.0, 34.4.1, 35.0.0, 35.0.1, 35.0.2, 36.0.1, 36.1.0, 36.1.1, 36.2.0, 36.2.1, 36.2.2, 36.2.3, 36.2.4, 36.2.5, 36.2.6, 36.2.7, 36.3.0, 36.4.0, 36.5.0, 36.6.0, 36.6.1, 36.7.0, 36.7.1, 36.7.2, 36.8.0, 37.0.0, 38.0.0, 38.1.0, 38.2.0, 38.2.1, 38.2.3, 38.2.4, 38.2.5, 38.3.0, 38.4.0, 38.4.1, 38.5.0, 38.5.1, 38.5.2, 38.6.0, 38.6.1, 38.7.0, 39.0.0, 39.0.1, 39.1.0, 39.2.0, 40.0.0, 40.1.0, 40.1.1, 40.2.0, 40.3.0, 40.4.0, 40.4.1, 40.4.2, 40.4.3, 40.5.0, 40.6.0, 40.6.1, 40.6.2, 40.6.3, 40.7.0, 40.7.1, 40.7.2, 40.7.3, 40.8.0, 40.9.0, 41.0.0, 41.0.1, 41.1.0, 41.2.0, 41.3.0, 41.4.0, 41.5.0, 41.5.1, 41.6.0, 42.0.0, 42.0.1, 42.0.2, 43.0.0, 44.0.0, 44.1.0, 44.1.1)
    ERROR: No matching distribution found for setuptools~=53.0.0
    ----------------------------------------
  ERROR: Command errored out with exit status 1: 'c:\python27\python.exe' 'c:\python27\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'c:\users\nikul\appdata\local\temp\pip-build-env-ljjjc_\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools~=53.0.0' 'wheel~=0.36.2' 'toml~=0.10.2' Check the logs for full command output.
  ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\python27\python.exe' 'c:\python27\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'c:\users\nikul\appdata\local\temp\pip-build-env-mftrcv\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- maturin Check the logs for full command output.

Hi @milenge_dubara,

Streamlit does not support Python 2.7. It requires Python 3.6 or above as a prerequisite.

Happy Streamlit’ing! :balloon:
Snehan

4 Likes

Oh, no. because my required project is in python 2.7 and for Streamlit I need python 3.6 or above version.

How’s possible 2 version in one PC?

1 Like

Hi,
I am trying to run streamlit on Spyder 5.1 . I’ve installed streamlit using
pip install streamlit
yet when I try to use
streamlit hello
I get invalid syntax error. When I try running a code using
streamlit run code.py
I also get invalid syntax or
module streamlit has no attribute ‘run’
anyone know how to fix this?

1 Like

Hi @Adam_Bloebaum,

Where exactly within Spyder are you executing streamlit hello?

From the error message, it looks like you have a .py file with the line streamlit hello, and you’re running into the invalid syntax error while executing the .py file. Is this the case?

The streamlit hello and streamlit run code.py commands are supposed to be run from the command line / terminal.

Best, :balloon:
Snehan

1 Like

Am also getting errors as we speak… mine is pyarrow pywint