question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

streamlit's webserver not working when using pdm for installation

See original GitHub issue

Summary

When I’m using pdm to install streamlit, I cannot connect to streamlit’s webserver. From pdm’s web site: PDM is a modern Python package manager with PEP 582 support.

Steps to reproduce

  1. Install PDM: pipx install pdm
  2. Create new directory and go there: mkdir st_test; cd st_test
  3. Init pdm: pdm init (and use the defaults)
  4. Install streamlit: pdm add streamlit
  5. Use any minimal streamlit example and run streamlit: pdm run streamlit run hello_world.py

Expected behavior:

Browser opens correct web page served by streamlit.

Actual behavior:

Browser tries to connect to localhost:3000 (which is also mentioned in the logs), but when I look at the logs, the server actually runs on port 8501. When I try this port, I get a 404, so I can connect to the server on this port, but something’s broken.

Is this a regression?

That is, did this use to work the way you expected in the past? never tried before

Debug info

  • Streamlit version: 0.80.0
  • Python version: 3.8.8
  • Using pdm
  • OS version: Linux 5.11.11
  • Browser version: Chrome 89.0.4389.114 (Official Build) (64-bit)

Additional information

jupyter-lab show a similar issue with pdm, but it can be fixed by running pdm run jupyter-lab --core-mode

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
randyzwitchcommented, Mar 24, 2022

It looks like @AnOctopus is an enthusiast and is working towards this:

https://github.com/pdm-project/pdm/issues/972

I’ll re-open, so everyone can be aware that its been requested.

1reaction
AnOctopuscommented, Mar 28, 2022

I found a way that works: pdm-project/pdm#989 (comment). Hopefully it’s not only for me, but for everyone.

Actually PDM is getting more and more popular recently. It would be great if it could be supported officially.

That workaround gives me a very good idea about the source of the problem. We automatically set development mode by trying to detect how streamlit was installed, and I suspect being installed into __pypackages__ breaks our heuristics for that. Should be relatively easy to fix.

Read more comments on GitHub >

github_iconTop Results From Across the Web

pdm-installed streamlit fails to launch a server - Stack Overflow
The problem is that, while streamlit configs default to server port 8501 , the server is launched on the port 3000 .
Read more >
App is not loading when running remotely - Streamlit Docs
If you see Streamlit running, the most likely culprit is the Streamlit port not being exposed. The fix depends on your exact setup....
Read more >
Troubleshooting - Streamlit Docs
If your app is running slowly or you're hitting the 'Argh' page, we first highly recommend going through and implementing the suggestions in...
Read more >
Network URL not working on other computers - Using Streamlit
When I try to access the web app from another computer using the provided network URL, Streamlit shows: Safari can't open the page...
Read more >
Deployed Streamlit App not working despite no build errors
I work for a healthcare firm and currently package client dashboards as macro-based Excel files (with forms & a hidden application ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found