Problem with Running Streamlit

I am using Winpython 3.8.5. When I run the streamlit hello, this shows up. Anyone know how to fix this?

Traceback (most recent call last):
  File "C:\temp_softwares\WPy64-3850\python-3.8.5.amd64\lib\site-packages\git\__init__.py", line 83, in <module>
    refresh()
  File "C:\temp_softwares\WPy64-3850\python-3.8.5.amd64\lib\site-packages\git\__init__.py", line 73, in refresh
    if not Git.refresh(path=path):
  File "C:\temp_softwares\WPy64-3850\python-3.8.5.amd64\lib\site-packages\git\cmd.py", line 278, in refresh
    raise ImportError(err)
ImportError: Bad git executable.
The git executable must be specified in one of the following ways:
    - be included in your $PATH
    - be set via $GIT_PYTHON_GIT_EXECUTABLE
    - explicitly set via git.refresh()

All git commands will error until this is rectified.

This initial warning can be silenced or aggravated in the future by setting the
$GIT_PYTHON_REFRESH environment variable. Use one of the following values:
    - quiet|q|silence|s|none|n|0: for no warning or exception
    - warn|w|warning|1: for a printed warning
    - error|e|raise|r|2: for a raised exception

Example:
    export GIT_PYTHON_REFRESH=quiet


The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\temp_softwares\WPy64-3850\python-3.8.5.amd64\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\temp_softwares\WPy64-3850\python-3.8.5.amd64\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\temp_softwares\WPy64-3850\python-3.8.5.amd64\Scripts\streamlit.exe\__main__.py", line 4, in <module>
  File "C:\temp_softwares\WPy64-3850\python-3.8.5.amd64\lib\site-packages\streamlit\cli.py", line 28, in <module>
    import streamlit.bootstrap as bootstrap
  File "C:\temp_softwares\WPy64-3850\python-3.8.5.amd64\lib\site-packages\streamlit\bootstrap.py", line 29, in <module>
    from streamlit.server.server import Server, server_address_is_unix_socket
  File "C:\temp_softwares\WPy64-3850\python-3.8.5.amd64\lib\site-packages\streamlit\server\server.py", line 39, in <module>
    from streamlit.report_session import ReportSession
  File "C:\temp_softwares\WPy64-3850\python-3.8.5.amd64\lib\site-packages\streamlit\report_session.py", line 26, in <module>
    from streamlit.git_util import GitRepo
  File "C:\temp_softwares\WPy64-3850\python-3.8.5.amd64\lib\site-packages\streamlit\git_util.py", line 1, in <module>
    import git  # type: ignore[import]
  File "C:\temp_softwares\WPy64-3850\python-3.8.5.amd64\lib\site-packages\git\__init__.py", line 85, in <module>
    raise ImportError('Failed to initialize: {0}'.format(exc)) from exc
ImportError: Failed to initialize: Bad git executable.
The git executable must be specified in one of the following ways:
    - be included in your $PATH
    - be set via $GIT_PYTHON_GIT_EXECUTABLE
    - explicitly set via git.refresh()

All git commands will error until this is rectified.

This initial warning can be silenced or aggravated in the future by setting the
$GIT_PYTHON_REFRESH environment variable. Use one of the following values:
    - quiet|q|silence|s|none|n|0: for no warning or exception
    - warn|w|warning|1: for a printed warning
    - error|e|raise|r|2: for a raised exception

Example:
    export GIT_PYTHON_REFRESH=quiet

HI @bbmak, welcome to the Streamlit community!

I’ve never used Winpython before, but I wonder if it’s expecting you to have Git installed but you don’t.

If you open the command prompt and type git, do you get something like this?

Hi @randyzwitch, I have the same problem as @bbmak. I am getting the message you posted. streamlit_error

What do I have to do?

@randyzwitch I installed git on my pc and now streamlit works perfectly, Thanks!!

1 Like