ModuleNotFoundError: No module named 'plotly'

Hi,

I am having an issue with a “ModuleNotFoundError: No module named ‘plotly’” when deploying through GitHub.

https://share.streamlit.io/trymaas/master-project/main/visualization.py

I made the requirements.txt file with pipreqs, so not sure how I could have done anything wrong on that front. Any pointers?

Hello @trymaas,

In your app, you should see a black sidebar with all the installation logs for your app. If you reboot your app and read the logs, can you see anything related to plotly?

I tried on my side, I can see:

Collecting matplotlib==1.5.1

  Downloading matplotlib-1.5.1.tar.gz (54.0 MB)

    ERROR: Command errored out with exit status 1:

     command: /usr/local/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-5tii96y5/matplotlib_8af6ac0a2d024d35826310b8dcbfe1e9/setup.py'"'"'; __file__='"'"'/tmp/pip-install-5tii96y5/matplotlib_8af6ac0a2d024d35826310b8dcbfe1e9/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' --no-user-cfg egg_info --egg-base /tmp/pip-pip-egg-info-4xbt2eex

         cwd: /tmp/pip-install-5tii96y5/matplotlib_8af6ac0a2d024d35826310b8dcbfe1e9/

    Complete output (68 lines):

    IMPORTANT WARNING:

        pkg-config is not installed.

        matplotlib may not be able to find some of its dependencies

    ============================================================================

    Edit setup.cfg to change the build options

So I actually removed the versions from the requirements.txt (master-project/requirements.txt at main · andfanilo/master-project · GitHub) and now it works https://share.streamlit.io/andfanilo/master-project/main/visualization.py. Maybe matplotlib 1.5.1 is a bit too old?

Cheers,
Fanilo

Thanks,

Yeah, seems like I was using some old versions

I have the same error, when I run the script with streamlit run app.py it works fine but when I tried to deploy it with streamlit share it is giving me this error "ModuleNotFoundError: No module named ‘plotly’ ". Can someone please guide me what to do next.

Hi @ira_bajpai, welcome to the Streamlit community!! :tada: :partying_face:

If possible, could you share your repo on here? It might be the case that plotly isn’t included in your requirements.txt.

Best,
Snehan :balloon:

Hi @snehankekre , this is really random, but I just learned how to build dashboards using streamlit from your tutorials on coursera project network. It was really helpful !!! Great tutorial!!

I was trying to deploy the same dashboard, I did added plotly to the requirements however, this is the error that I am now getting " FileNotFoundError: [Errno 2] No such file or directory: ‘C:\Users\DELL\Downloads\tweets.xlsx’ " , I don’t think I have added the file correctly.

here’s the repo: GitHub - irab21/dashboard

Thankyou very much!

1 Like

yes you did that a bit strange.

Just put tweets.xlsx in your folder and set DATA_URL="tweets.xlsx" and it should work.

2 Likes

Thank you @Franky1 , it worked!

1 Like

@ira_bajpai That’s fantastic and wholesome to hear :grinning_face_with_smiling_eyes: I’m glad you found value in my Coursera projects.

Thanks for hopping in with the solution, @Franky1!

Best,
Snehan :balloon:

1 Like