posit-dev / posit-dev/rsconnect-python

Unable to specify the installation of the current directory, which causes a ModuleNotFoundError

オープン
#456 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
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:

  1. rsconnect write-manifest streamlit --entrypoint=dashboard/app.py .
  2. 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?

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. 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

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。