Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot have pip as a requirement on windows #6138

Closed
3 tasks done
vxgmichel opened this issue Aug 8, 2022 · 5 comments · Fixed by #6430
Closed
3 tasks done

Cannot have pip as a requirement on windows #6138

vxgmichel opened this issue Aug 8, 2022 · 5 comments · Fixed by #6430
Labels
area/installer Related to the dependency installer area/windows For Windows-specific issues kind/bug Something isn't working as expected status/confirmed Issue is reproduced and confirmed

Comments

@vxgmichel
Copy link

  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • 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 vxgmichel added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Aug 8, 2022
@davidgilbertson
Copy link

I get the same error (on Poetry 1.2.0, Windows 11) and don't have pip listed in my pyproject.toml file.
I manually ran the bit after "To modify pip, please run the following command:" to prevent Poetry from trying to do the update itself and got past this error.

@neersighted
Copy link
Member

@davidgilbertson can you please try the 1.2 branch (installed via pipx) and see if this still occurs? Our invocation of pip there is different and it may (or may not) help.

@neersighted neersighted added area/installer Related to the dependency installer status/confirmed Issue is reproduced and confirmed area/windows For Windows-specific issues and removed status/triage This issue needs to be triaged labels Sep 6, 2022
@radoering
Copy link
Member

That's what I mentioned in #6062 (comment). It makes no difference.

@neersighted
Copy link
Member

Ah, I didn't make that connection -- fair enough. I wonder if we can tweak our invocation to be similar to the python.exe method that apparently sidesteps file locking.

Copy link

github-actions bot commented Mar 1, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/installer Related to the dependency installer area/windows For Windows-specific issues kind/bug Something isn't working as expected status/confirmed Issue is reproduced and confirmed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants