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

1.0.3: failure on creating environment via python3 version not from PATH #168

Open
abcdenis opened this issue Feb 3, 2021 · 2 comments
Open

Comments

@abcdenis
Copy link

abcdenis commented Feb 3, 2021

Describe the bug
Plugin uses python3 path from PATH not from 'create poetry dialog' and could fail on multiple Python3 version installed.

To Reproduce
Steps to reproduce the behavior:

  1. macos
  2. have three versions of Python3 installed on machine: 3.6, 3.7, 3.8 with 3.7 as default:
$ which python3
/usr/local/bin/python3

$ /usr/local/bin/python3 -V
Python 3.7.9

$ which -a python3
/usr/local/bin/python3
/Library/Frameworks/Python.framework/Versions/3.7/bin/python3
/Library/Frameworks/Python.framework/Versions/3.6/bin/python3
/Library/Frameworks/Python.framework/Versions/3.8/bin/python3
  1. install poetry on every Python3 version via 'path/../python3 -m pip install poetry==1.1.4'
  2. open project with python version required as "^3.8" in Pycharm 2020.3.3 with Poetry plugin v1.0.3

Expected behavior
created poetry environment

Screenshots
2021-02-03_05-20-35
2021-02-03_05-21-26
If applicable, add screenshots to help explain your problem.

Environments (please complete the following information):
Already done above.
It might be helpful to move this section to the top of the form.

Additional context
Full text from error window:

executed command

/Library/Frameworks/Python.framework/Versions/3.8/bin/poetry env use /usr/local/bin/python3


  NoCompatiblePythonVersionFound

  The specified Python version (3.7.9) is not supported by the project (^3.8).
  Please choose a compatible version or loosen the python constraint specified in the pyproject.toml file.

  at /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/poetry/utils/env.py:675 in create_venv
       671│             # If an executable has been specified, we stop there
       672│             # and notify the user of the incompatibility.
       673│             # Otherwise, we try to find a compatible Python version.
       674│             if executable:
    →  675│                 raise NoCompatiblePythonVersionFound(
       676│                     self._poetry.package.python_versions, python_patch
       677│                 )
       678│ 
       679│             io.write_line(

@koxudaxi
Copy link
Owner

koxudaxi commented Feb 3, 2021

@abcdenis
Thank you for creating this issue.

I can see you selected /usr/local/bin/python3  for a project with python version required as "^3.8"
But, you show me /usr/local/bin/python3 is Python 3.7.9.
I guess the error is correct.

$ /usr/local/bin/python3 -V
Python 3.7.9

However, PyCharm displays Python version 3.8 in the list. It's interesting.
The version may be wrong. 🤔

2021-02-03 17 04 07

@abcdenis
Copy link
Author

I used to see this bug in PyCharm. I will check and notify PyCharm developers if need. Thank you for suggestion.

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