poetry icon indicating copy to clipboard operation
poetry copied to clipboard

Cannot have pip as a requirement on windows

Open vxgmichel opened this issue 3 years ago • 0 comments

  • [x] I am on the latest Poetry version.
  • [x] I have searched the issues of this repo and believe that this is not a duplicate.
  • [x] If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).
  • OS version and name: Windows 10
  • Poetry version: 1.2.0b3
  • Contents of pyproject.toml file:
    [tool.poetry]
    name = "some-api"
    version = "1.0.0"
    description = ""
    authors = ["redacted"]
    
    [tool.poetry.dependencies]
    python = "~3.9"
    pip = "^22"
    

Issue

It seems like pip cannot be listed as requirement on windows since the pip commands are run as pip install ... instead of python -m pip install .... On windows, running commands such as pip install pip produces an error of the type:

ERROR: To modify pip, please run the following command:
  C:\...\python.exe -m pip install pip

Find bellow the full trace corresponding to pyproject.toml above:

λ poetry install
Installing dependencies from lock file

Package operations: 0 installs, 1 update, 0 removals

  • Updating pip (22.1.2 -> 22.2.2): Failed

  CalledProcessError

  Command 'C:\Users\User\AppData\Local\pypoetry\Cache\virtualenvs\some-api-PA_BOgSJ-py3.9\Scripts\python.exe C:\Users\User\AppData\Roaming\pypoetry\venv\lib\site-packages\virtualenv\seed\wh
eels\embed\pip-22.2.1-py3-none-any.whl\pip install --disable-pip-version-check --prefix C:\Users\User\AppData\Local\pypoetry\Cache\virtualenvs\some-api-PA_BOgSJ-py3.9 --upgrade --no-deps C:
\Users\User\AppData\Local\pypoetry\Cache\artifacts\80\e1\ce\21d858207e1a33dc020819410970a306662661b1529bb85f459633a476\pip-22.2.2-py3-none-any.whl' returned non-zero exit status 1.

  at C:\Python39\lib\subprocess.py:528 in run
       524│             # We don't call process.wait() as .__exit__ does that for us.
       525│             raise
       526│         retcode = process.poll()
       527│         if check and retcode:
    →  528│             raise CalledProcessError(retcode, process.args,
       529│                                      output=stdout, stderr=stderr)
       530│     return CompletedProcess(process.args, retcode, stdout, stderr)
       531│
       532│

The following error occurred when trying to handle this error:


  EnvCommandError

  Command C:\Users\User\AppData\Local\pypoetry\Cache\virtualenvs\some-api-PA_BOgSJ-py3.9\Scripts\python.exe C:\Users\User\AppData\Roaming\pypoetry\venv\lib\site-packages\virtualenv\seed\whe
els\embed\pip-22.2.1-py3-none-any.whl\pip install --disable-pip-version-check --prefix C:\Users\User\AppData\Local\pypoetry\Cache\virtualenvs\some-api-PA_BOgSJ-py3.9 --upgrade --no-deps C:\
Users\User\AppData\Local\pypoetry\Cache\artifacts\80\e1\ce\21d858207e1a33dc020819410970a306662661b1529bb85f459633a476\pip-22.2.2-py3-none-any.whl errored with the following return code 1, a
nd output:
  Processing c:\users\user\appdata\local\pypoetry\cache\artifacts\80\e1\ce\21d858207e1a33dc020819410970a306662661b1529bb85f459633a476\pip-22.2.2-py3-none-any.whl
  ERROR: To modify pip, please run the following command:
  C:\Users\User\AppData\Local\pypoetry\Cache\virtualenvs\some-api-PA_BOgSJ-py3.9\Scripts\python.exe -m pip install --disable-pip-version-check --prefix C:\Users\User\AppData\Local\pypoetry\
Cache\virtualenvs\some-api-PA_BOgSJ-py3.9 --upgrade --no-deps C:\Users\User\AppData\Local\pypoetry\Cache\artifacts\80\e1\ce\21d858207e1a33dc020819410970a306662661b1529bb85f459633a476\pip-22
.2.2-py3-none-any.whl
[...]

vxgmichel avatar Aug 08 '22 13:08 vxgmichel