[英]Why does Streamlit not find my python file?
我有 Streamlit 在終端中工作,即在終端中運行以下命令:
$ streamlit hello
我正在嘗試使用在線教程創建應用程序但遇到錯誤 - 見下文
https://docs.streamlit.io/en/latest/tutorial/create_a_data_explorer_app.html#let-s-put-it-all-together
我已將以下內容保存為 uber_pickups.py
import streamlit as st
import pandas as pd
import numpy as np
st.title('Uber pickups in NYC')
(base) lf-mac-0250:~ alastairhayes$ streamlit hello
You can now view your Streamlit app in your browser.
Local URL: http://localhost:8501
Network URL: http://172.20.10.2:8501
^C
停止...
(base) lf-mac-0250:~ alastairhayes$ streamlit run uber_pickups.py
Usage: streamlit run [OPTIONS] TARGET [ARGS]...
Error: Invalid value: File does not exist: uber_pickups.py
我哪里錯了? 我有 python 3.7.6 非常感謝!
如果您使用的是 Windows 操作系統,您可以嘗試以下步驟:
首先需要下載Anaconda: https://www.anaconda.com/
打開 Anaconda PowerShell 提示並鍵入以下內容:
conda list
pip uninstall streamlit
然后,創建一個新環境,並測試以下內容:
pip install streamlit
streamlit hello
最后,您可以在代碼上測試 streamlit,將 your_app 替換為文件的實際名稱。 確保您與源代碼文件位於同一目錄中。
streamlit run your_app.py
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.