Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

poetry shell unexpected behavior - spawning the "wrong" shell

Aperta
#12 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
powershell, python
Ambito
cli

Direzione di ricerca

Inizia dal punto di ingresso poetry -vvv shell su Windows 10 e confronta la shell avviata con l’invocazione diretta del percorso Activate.ps1 mostrato. Riproduci i diversi prompt e la configurazione dell’ambiente, quindi determina il comportamento previsto della shell e verifica che la differenza di configurazione segnalata sia stata risolta.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

  • Poetry version: Poetry (version 1.2.1)
  • Python version:
Poetry
Version: 1.2.1
Python:  3.10.5

Virtualenv
Python:         3.10.5
Implementation: CPython
Path:           C:\Users\my_user\AppData\Local\pypoetry\Cache\virtualenvs\pyspark-write-demo-CwtTbJGc-py3.10
Executable:     C:\Users\my_user\AppData\Local\pypoetry\Cache\virtualenvs\pyspark-write-demo-CwtTbJGc-py3.10\Scripts\python.exe
Valid:          True

System
Platform:   win32
OS:         nt
Python:     3.10.5
Path:       C:\Users\my_user\.pyenv\pyenv-win\versions\3.10.5
Executable: C:\Users\my_user\.pyenv\pyenv-win\versions\3.10.5\python.exe
  • I am on the latest stable Poetry version, installed using a recommended method. *I believe that I installed it using pip and that could be the reason of my issue. However, due to certificates issue and Co, I was not able to install poetry using (Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | python -.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have consulted the FAQ and blog for any relevant entries or release notes.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option) and have included the output below.

Issue

When trying to activate the created environment using poetry -vvv shell I get:

Loading configuration file C:\Users\my_user\AppData\Roaming\pypoetry\config.toml
Loading configuration file C:\Users\my_user\AppData\Roaming\pypoetry\auth.toml
Using virtualenv: C:\Users\my_user\AppData\Local\pypoetry\Cache\virtualenvs\pyspark-write-demo-CwtTbJGc-py3.10
Spawning shell within C:\Users\my_user\AppData\Local\pypoetry\Cache\virtualenvs\pyspark-write-demo-CwtTbJGc-py3.10

C:\Users\my_user\dev\pyspark_write_demo>

The problem is that I get a new type of shell which is not working as I expect. Consider the following screen shot:

image

As you can see, the new prompt is different than the one where I execute poetry shell. In turn, the new shell doesn't have many configurations that I'd have in the original shell (e.g. the nice-looking prompt).

However, if I try to start the environment "directly":

 C:/Users/my_user/AppData/Local/pypoetry/Cache/virtualenvs/pyspark-write-demo-Rmcv68Jg-py3.10/Scripts/Activate.ps1

I get the expected behavior as can be seen in the following image:

image

Why is this happening? What have I configured wrongly with Poetry?

Lingua principale
Python
Stelle
141
Fork
10
Merge medio
59m
PR unite (30g)
3

Preparare l'ambiente

Non abbiamo ancora controllato i file di configurazione di questo progetto. Parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di python-poetry/poetry-plugin-shell

Tutte le issue di python-poetry/poetry-plugin-shell

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.