Skip to content

Conversation

@jonathan-eckel
Copy link
Contributor

Issue: #1176

Description: Added an item to the FAQ to discuss the use of PYTHONPATH to track changes in other modules imported into a Streamlit app.

By default, Streamlit only watches modules contained in the current directory of the main app module. You can track other modules by adding the parent directory of the module to the `PYTHONPATH`.

```bash
PYTHONPATH=/path/to/module streamlit run your_script.py

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to add several module paths to the PYTHONPATH and if so, could you include that in the docs? :)

By default, Streamlit only watches modules contained in the current directory of the main app module. You can track other modules by adding the parent directory of the module to the `PYTHONPATH`.

```bash
PYTHONPATH=/path/to/module streamlit run your_script.py
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better to have this example appending to PYTHONPATH rather than overwriting

export PYTHONPATH=$PYTHONPATH:/path/to/module
streamlit run your_script.py

@randyzwitch randyzwitch merged commit 6bc8b4c into streamlit:develop Jun 9, 2021
tconkling added a commit to tconkling/streamlit that referenced this pull request Jun 9, 2021
* develop: (21 commits)
  config.py: types + cleanup (streamlit#3393)
  add faq item regarding use of PYTHONPATH (streamlit#3391)
  Fix vertical align (streamlit#3317)
  Create visualize_rent_prices_with_Streamlit.md (streamlit#3193)
  Update app resource limits (streamlit#3384)
  Bump dns-packet from 1.3.1 to 1.3.4 in /frontend (streamlit#3341)
  Bump ws from 6.2.1 to 6.2.2 in /frontend (streamlit#3358)
  Fix ReST vs Markdown typos and update conda docs link (streamlit#3371)
  update requirements file documentation (streamlit#3372)
  Fix a peculiar issue with yarn start (streamlit#3374)
  Remove unused mocha dependency (streamlit#3326)
  Update `typed-signals` to 2.2.0 (streamlit#3325)
  update classnames lib to 2.3.1 (streamlit#3331)
  Update DOMPurify to 2.2.8 (the latest) (streamlit#3327)
  Update protobufjs to 6.11.2 (streamlit#3329)
  Update react to latest point release (streamlit#3328)
  Update @craco/craco to 6.1.2 (streamlit#3324)
  Update testing-library to the latest (streamlit#3330)
  Update clipboardjs to 2.0.8 (streamlit#3332)
  Update JSON5 to 2.2.0 (streamlit#3333)
  ...
@jonathan-eckel jonathan-eckel deleted the faq-pythonpath branch June 9, 2021 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants