Import Error plotly/geopandas

I keep trying to deploy my app but it doesn’t seem to like geopandas.

Traceback (most recent call last):

  File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 563, in _run_script

    exec(code, module.__dict__)

  File "/app/floridaearlyvoting/streamlitVotingApp.py", line 81, in <module>

    st.plotly_chart(makeplot(df1, check_flag=True), use_container_width=False)

  File "/app/floridaearlyvoting/streamlitVotingApp.py", line 43, in makeplot

    fig = ff.create_choropleth(

  File "/home/appuser/venv/lib/python3.9/site-packages/plotly/figure_factory/_county_choropleth.py", line 624, in create_choropleth

    raise ImportError(

ImportError: geopandas, pyshp and shapely must be installed for this figure factory.

Run the following commands to install the correct versions of the following modules:

$ pip install geopandas==0.3.0
$ pip install pyshp==1.2.10
$ pip install shapely==1.6.3

If you are using Windows, follow this post to properly install geopandas and dependencies:http://geoffboeing.com/2014/09/using-geopandas-windows/

If you are using Anaconda, do not use PIP to install the packages above. Instead use conda to install them:

$ conda install plotly

$ conda install geopandas

Fixed it.

How did you fix it?

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