Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

poetry shell unexpected behavior - spawning the "wrong" shell

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

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
powershell, python
領域
cli

調査の方向性

Windows 10 で poetry -vvv shell のエントリポイントから開始し、そこで起動されるシェルと、示されている Activate.ps1 パスを直接呼び出した場合を比較します。異なるプロンプトと環境設定を再現し、その後、期待されるシェルの動作を特定して、報告された設定の差異が解消されていることを確認します。

索引モデルが issue の本文から書いたものです。

説明

  • 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?

主要言語
Python
スター
141
フォーク
10
平均マージ
59分
マージ済み PR(30日)
3

環境構築

このプロジェクトの環境構築ファイルはまだ確認していません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

python-poetry/poetry-plugin-shell のほかの issue

python-poetry/poetry-plugin-shell の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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