ModuleNotFoundError: No module named 'ConfigParser'

I tried to deploy my app on streamlit cloud, but it’s giving me a ModuleNotFoundError : No module named ‘ConfigParser’. This happened when I added the library “Janitor” to my requirements.txt.

The app works perfectly fine on my local system. I created a test repo which replicates the same error.
Link to repo : https://github.com/srivallid/Streamlit-Test-New.git
Link to my app: https://srivallid-streamlit-test-new-home-2tpxsf.streamlit.app/
Password : 1

Please help, Thanks

Hey @ceeva,

Can you share the contents of your requirements file? It looks like the repo might be private – specifically, do you have “ConfigParser” in your requirements file?

Hi @Caroline,

Thanks for reaching out!
I have the repo as “Public”
image
I can share the contents of requirements.txt file:
image
I tried two ways - by having configarser in requirements.txt and without including it in requirements.
Both did not work.

@ceeva Which package are you trying to import for configparser? Can you link to the pypi page?

@Caroline I was trying to import Janitor - to clean the column names.
pypi page link : pyjanitor · PyPI

On local I downloaded through anaconda : Pyjanitor :: Anaconda.org

@ceeva shouldn’t the import statement be import pyjanitor rather than import ConfigParser? What is ConfigParser referring to in this case?

@Caroline yes below is a screenshot of my py file which uses janitor, I do not have an import configparser anywhere, were you able to open the link to my github repo?
image

I am not sure where the configparser came from on streamlit cloud, but it started throwing an error only when I added import janitor in my script

You are installing janitor, totally unrelated to pyjanitor and unmaintained for almost ten years.

I replaced “janitor” with “pyjanitor” in requirements.txt and it worked, I completely overlooked the fact that I am installing “pyjanitor” and importing it using “janitor”

Thanks a lot @goyo and @Caroline for all your help.

1 Like

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