posit-dev / posit-dev/rsconnect-python
Unable to specify the installation of the current directory, which causes a ModuleNotFoundError
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 37
- フォーク
- 28
- 平均マージ
- 1日 3時間
- マージ済み PR(30日)
- 7
説明
I am trying to deploy a Streamlit dashboard to Connect, but get an error.
Setup
I have the following directory structure:
dashboard
`-- app.py # imports from my_awesome_package
src
|-- my_awesome_package
| |-- data.py
| `-- views.py
requirements.txt # Specify requirements for my_awesome_package
pyproject.toml # Specify installation of my_awesome_package
Deployment
Deployment happens in two steps:
rsconnect write-manifest streamlit --entrypoint=dashboard/app.py .rsconnect deploy manifest manifest.json --title "My Dashboard"
The Error
Once deployed, I open the application and get the following error:
ModuleNotFoundError: No module named 'my_awesome_package'
The issue
I believe the issue is as follows: The connect server does not install packages from the local directory (through setup.py or pyproject.toml.), but only what is in requirements. In the manifest.json, the files from my_awesome_package are specified, but they cannot be found because the package has not been installed.
Question
How can I specify through rsconnect that the current directory should also be installed? Could this be an update to the manifest, or is there another way of doing it?
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、dashboard/app.py、requirements.txt、pyproject.toml、および示されている2つのrsconnectコマンドを使ってデプロイを再現します。manifest.jsonを調べてローカルパッケージがどのように表現されているかを確認し、それをデプロイの動作と比較します。デプロイされたダッシュボードが、パッケージファイルを手動でコピーすることなく、カレントディレクトリからmy_awesome_packageをインポートできれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- cli, devops
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 30/100