python-poetry/install.python-poetry.org

Cryptic error if python is out of date

wd60622 opened this issue · 2 comments

I've tried to install poetry on Windows with python=3.6.X using the curl command.

Doesn't work of course since it is not supported. However, it errors out from a TypeError

Full Error Message Installing Poetry (1.3.1): Creating environment Traceback (most recent call last): File "", line 306, in make ModuleNotFoundError: No module named 'ensurepip'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 940, in
File "", line 919, in main
File "", line 550, in run
File "", line 571, in install
File "C:\Users\William\Anaconda3\lib\contextlib.py", line 81, in enter
return next(self.gen)
File "", line 643, in make_env
File "", line 629, in make_env
File "", line 334, in make
File "", line 354, in run
File "C:\Users\William\Anaconda3\lib\subprocess.py", line 403, in run
with Popen(*popenargs, **kwargs) as process:
File "C:\Users\William\Anaconda3\lib\subprocess.py", line 709, in init
restore_signals, start_new_session)
File "C:\Users\William\Anaconda3\lib\subprocess.py", line 971, in _execute_child
args = list2cmdline(args)
File "C:\Users\William\Anaconda3\lib\subprocess.py", line 461, in list2cmdline
needquote = (" " in arg) or ("\t" in arg) or not arg
TypeError: argument of type 'WindowsPath' is not iterable

Would it makes sense to catch it earlier and throw some type of warning in order to be clearer to the user?

This is only tangentially related, as you are missing ensurepip in your Python install. Users with a functioning Python 3.6 will get a slightly less baffling failure to find a compatible distribution for the selected Poetry version. The fallback code takes a path that is not Python 3.6-related. In any case, ideally we could use Requires-Python from the PyPI API to report if we've been asked to install an incompatible version instead of failing with a missing distribution.

Sounds good. Thank you for the response! If there is no action, then feel free to close