Skip to content
This repository has been archived by the owner on Feb 9, 2022. It is now read-only.

Creating poetry environment does not use specified version of Python #258

Open
ecwootten opened this issue Jul 26, 2021 · 3 comments
Open

Comments

@ecwootten
Copy link

ecwootten commented Jul 26, 2021

Describe the bug
Creating poetry env. does not use the Python specified in the 'create' dialogue, it uses any old Python found on the user's path.

To Reproduce
Steps to reproduce the behavior:

  1. Add interpreter, choose "Poetry Environment",
  2. Set base environment by navigating to python.exe from Anaconda venv
  3. Click 'OK'
  4. See "Python was not found but can be installed from the Microsoft Store: ms-windows-store://pdp/?productid=9NJ46SX7X90P" error dialogue. (This is the error from running the fake python.exe shipped with Windows, which actually redirects the user to the M$ store).

Expected behavior
Expect usable interpreter to be created, using the specified version of Python.

Screenshots

Creating env:
poetry_1

Error:
poetry_2

The command from the dialogue box runs fine in ordinary Windows CLI:
poetry_3

Also in PyCharm terminal (currently set to PowerShell):
poetry_4

Environments (please complete the following information):

  • IDE: PyCharm Professional 2020.2
  • OS: Windows 10 Enterprise (Version 1909, OS build 18363.1646)
  • Poetry Version 1.1.7
  • Plugin version 0.5.5

Additional context
Think this is related to #168.
The command line shown in the error dialogue executes without issue in other contexts, and env.-creation works fine if I add the Anaconda venv to PATH (yugh).

@ecwootten
Copy link
Author

ecwootten commented Jul 26, 2021

Now updated to:
PyCharm Professional 2021.1.3
Plugin 1.1.4
... but no change in behaviour.

@ecwootten
Copy link
Author

As an experiment, I tried adding the path of my venv. (C:\Users\WoottenE\Anaconda3\envs\workerlib) to my system PATH, and the plugin now correctly builds the interpreter (modulo some faffing about to work around this issue: https://stackoverflow.com/questions/54175042/python-3-7-anaconda-environment-import-ssl-dll-load-fail-error). This is OK as a temporary workaround, but obviously adding virtual conda envs to PATH kind of defeats the point :-)

Anyway... I think this is a similar problem to that described in #168: the path to Python specified in the 'create poetry environment' dialogue box is ignored and, instead any python on the user's PATH is used . (In my case, it tries to use the trick-Python in %USERPROFILE%\AppData\Local\Microsoft\WindowsApps, which actually just redirects to the M$ app store). I'll update the description accordingly.

@ecwootten ecwootten changed the title Cannot create interpreter / error running poetry Creating poetry environment does not used specified version of Python Jul 26, 2021
@ecwootten ecwootten changed the title Creating poetry environment does not used specified version of Python Creating poetry environment does not use specified version of Python Jul 26, 2021
@koxudaxi
Copy link
Owner

koxudaxi commented Aug 1, 2021

Thank you for reporting the problem.
I haven't tried anaconda in windows.
Also, I understand the plugin has a problem in some situations related to the path.
I will investigate the reason for the problem.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants