python.poetryPath default setting isn't working on Windows
See original GitHub issueEnvironment data
- VS Code version: 1.14.1
- Extension version (available under the Extensions sidebar): 2020.1.58038
- OS and version: Windows 10
- Python version (& distribution if applicable, e.g. Anaconda): 3.8.1
- Type of virtual environment used (N/A | venv | virtualenv | conda | …): in project .venv
- Relevant/affected Python packages and their versions: poetry v1.0.2 ‘in the path’
- Jedi or Language Server? (i.e. what is
"python.jediEnabled"
set to; more info #3977): both
Expected behaviour
poetry add --dev pylint
Actual behaviour
python -m pip install pylint
Steps to reproduce:
- poetry init
- poetry install
- create a python file
- the python extension start and activate the virtualenv as expected
- popup that inform no linter found in venv, ask to install
- this will install linter without poetry
The default python.poetryPath is set to poetry
and this is fine on linux;
on windows however, though the executable is in the path and is actually poetry
, it is called by the poetry.bat
file
this means that the right python.poetryPath for windows had to be set to poetry.bat
This isn’t really a big issue, maybe can only be explicit as a settings reference
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Introduction | Documentation | Poetry - Python dependency ...
Poetry is a tool for dependency management and packaging in Python. ... and the goal is to make it work equally well on...
Read more >Poetry installed but `poetry: command not found`
When I run this, after shutdown of bash Terminal: export PATH="$HOME/.poetry/bin:$PATH". poetry command is then recognised.
Read more >Using Python environments in VS Code
Configuring Python Environments in Visual Studio Code. ... by the python.envFile setting. The default value of this setting is ${workspaceFolder}/.env .
Read more >Dependency Management With Python Poetry
When your Python project relies on external packages, you need to make sure you're using the right version of each package. After an...
Read more >Configure a Poetry environment | PyCharm Documentation
On macOS and Windows, the installation script will suggest adding the folder with the poetry executable to the PATH variable. Do that by...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Spike results
Due to an upstream Windows only bug on node https://github.com/nodejs/node-v0.x-archive/issues/2318 (also see stack overflow answer),
child_process.spawn
fails to run files without any extension.poetry
file inside%USERPROFILE%/.poetry/bin
is not an executable, hence spawning it viachild_process
fails. It is documentedshell: true
may help us out there, but using it doesn’t return any output for the command for some reason.The easiest option is just to use
child_process.exec
instead ofchild_process.spawn
to run poetry, which is provided via https://github.com/microsoft/vscode-python/blob/3a7c11cee5953eb39e666ee441df99d99cda6ac9/src/client/common/process/proc.ts#L60It works fine both for
poetry
andpoetry.bat
files.Maybe we shouldn’t let poetryPath point to the
bat
file.I think we could prompt an error saying:
“The path to poetry is invalid. Please point it to the executable file.”
What do folks here think?