Cannot uninstall 'PyYAML'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall. CondaEnvException:

I am trying to sharing my streamlit app. I have generated the requirements.txt file. But it showing this error. I don’t what is happening. Can someone help me out ?

Please share your public repo link

1 Like

GitHub - drprajapati/streamlit-deolidfy this is my repo link

Phew… first of all, clean up the requirements.txt, otherwise it won’t work at all.
It is bloated with lots of unnecessary packages, local file references…

1 Like

I created the requirements.txt file with pip freeze > requirements.txt

This is bad practice regarding streamlit sharing - unless you used a virtual env locally.
Better use a tool like pipreqs or write the requirements.txt just by hand, usually you only have a few packages.

1 Like

I have done as you said. But still, it is giving me the same error.

Hi @drprajapati,

Sorry to hear you’re having trouble with Python dependencies. I cloned your repo and made a few changes so that all the requirements successfully install. I used pipreqs. Here are the steps:

  1. Either delete or rename environments.yml as all the Python dependencies can be installed via the requirements file
  2. Add only the following packages to your requirements.txt:
    scipy==1.6.2
    requests==2.22.0
    notebook==6.2.0
    youtube_dl==2020.3.24
    streamlit==0.81.1
    opencv_python==4.5.1.48
    tqdm==4.59.0
    numpy==1.20.1
    matplotlib==3.4.1
    fastai==1.0.51
    ffmpeg==1.4
    Flask==2.0.1
    imageio==2.9.0
    ipython==7.23.1
    Pillow==8.2.0
    scikit-image
    tensorboardX==2.2
    torch==1.8.1
    torchvision==0.9.1
    Werkzeug==2.0.1
    
  3. Create a packages.txt file for opengl apt-get dependencies containing the following:
    freeglut3-dev
    libgtk2.0-dev
    

After making the :point_up: changes, all the Python packages should successfully get installed. There may be other bugs in your code (e.g. line 11 in app_utils.py) that lead to additional errors, but they are unrelated to this Python dependencies issue.

Hope this helps! :grinning_face_with_smiling_eyes:

Happy Streamlit-ing! :balloon:
Snehan

1 Like

Thank you for your help. It solved the issue. But I am facing another issue. Can we create directory?

Certainly! You can create and delete directories from your Python script on sharing :slight_smile:

Best, :balloon:
Snehan