posit-dev / posit-dev/rsconnect-python
Unable to specify the installation of the current directory, which causes a ModuleNotFoundError
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 37
- Fork
- 28
- Merge medio
- 1g 3h
- PR unite (30g)
- 7
Descrizione
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?
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia riproducendo il deployment con dashboard/app.py, requirements.txt, pyproject.toml e i due comandi rsconnect mostrati. Esamina manifest.json per determinare come viene rappresentato il package locale e confrontalo con il comportamento del deployment. Il lavoro è completato quando il dashboard distribuito può importare my_awesome_package dalla directory corrente senza dipendere dalla copia manuale dei file del package.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- cli, devops
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 30/100