Error while deploying app

module ‘streamlit’ has no attribute ‘set_page_config’

This is my repo:

please look into it
Thankyou

Hey @iamchoudhari11,

First, welcome to the Streamlit Community! :partying_face: :tada: :fireworks: :partying_face: :wave:

In your requirements.txt you have a lot of (94!!) specific packages including streamlit==0.69 which is a very old version, we are currently on 0.82. In Streamlit 0.69 the st.set_page_config was still in beta. :baby:

I would recommend upgrading to a newer version of streamlit. If for some reason you can’t do this (again HIGHLY recommend that you do) in version 0.69 the call for setting the page config is st.beta_set_page_config

:exclamation: I also think you should remove any of those packages from your requirements.txt that you don’t specifically use in your app. Checkout this link to know why:

Happy Streamlit-ing!
Marisa

Marisa_Smith
snehankekre

Thanks For your Quick Reply
it helped me while converting streamlit version and removing unwanted libraries.

But currently I am facing another issue:

This is my app:
https://share.streamlit.io/iamchoudhari11/yoga_pose/main/my_app.py

Steps:
Go to BlazePose / Openpose from sidebar and you can see button which take real time feed from your camera and I designed it using Opencv.
But when I press button it throws error:
Whoops — something went wrong! An error has been logged.

Detail Error:

cv2.error: OpenCV(4.5.2) /tmp/pip-req-build-5wrl9sz4/opencv/modules/highgui/src/window.cpp:673: error: (-2:Unspecified error) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function ‘cvDestroyAllWindows’

Could you please help me out of this
Thankyou

Hi @iamchoudhari11,

Something to consider as you’re developing your project: The application will try and fail to open a video source with opencv on line 60 of blazepose.py: cap = cv2.VideoCapture(0)

The app will work on your local machine as the “server” and “client” are identical. However, if you deploy your app on a remote server (including Streamlit Sharing), opencv will not be able to find the video source (webcam) as none exists. Meaning, there’s no webcam for the container on Streamlit sharing to open (because there’s no video card, no “display” attached).

You will need to use a component to get your users’ webcam feed. @whitphx is the creator of the :fire: awesome :fire: streamlit-webrtc component for real-time video processing. You should be able to use streamlit-webrtc to capture frames from users’ webcam feed and then process them with tools like opencv.

Happy Streamlit-ing! :balloon:
Snehan

@snehankekre thank you for introducing me.
I have developed streamlit-webrtc to solve this exact problem.
Please check out this forum topic New Component: streamlit-webrtc, a new way to deal with real-time media streams to know the history of this library.
This tutorial Building a Web-Based Real-Time Computer Vision App with Streamlit - DEV Community might be a good first article to read to use streamlit-webrtc.

1 Like