Skip to content

Poetry on Windows 10 + pyenv-win is quickly corrupted #2795

@kiudee

Description

@kiudee
  • I am on the latest Poetry version (reason below).
  • 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).

Issue

I spent several days trying to install poetry on my Windows workstation (after already using it for months on my Linux PCs). After trying the following methods (which failed):

  • Global python installation + PowerShell command
  • pyenv-win + PowerShell command
  • pyenv-win + pipx + poetry==1.0.10

I got poetry to work using:

  1. Uninstalling global python and removing entries from PATH
  2. Installing pyenv-win 2.64.1
  3. Installing python using pyenv install 3.8.2 and pyenv global 3.8.2
  4. Installing pipx using pip install pipx
  5. Correctly adding all directories to PATH
  6. Installing poetry using pipx install poetry==1.1.0b2 (beta was required to get poetry to run - got the tip from another issue)

Running poetry install on a project worked once, but broke when trying again on another project.
So what already fails then is the following:

  1. Create a new project using poetry new blablub
  2. poetry add tqdm (or insert any other package here) fails with
  Command C:\Users\Karlson\AppData\Local\pypoetry\Cache\virtualenvs\blablub-HgamxXlr-py3.8\Scripts\pip.exe install --no-deps file://C:\Users\Karlson\AppData\Local\pypoetry\Cache\artifacts\be\98\c7\69fe6fea7a59659af1c6260899226129565330b1e07c9c5b3769be76bf\six-1.15.0-py2.py3-none-any.whl errored with the following return code 1, and output:
  Processing c:\users\karlson\appdata\local\pypoetry\cache\artifacts\be\98\c7\69fe6fea7a59659af1c6260899226129565330b1e07c9c5b3769be76bf\six-1.15.0-py2.py3-none-any.whl
      ERROR: Command errored out with exit status 1:
       command: 'C:\Users\Karlson\AppData\Local\pypoetry\Cache\virtualenvs\blablub-HgamxXlr-py3.8\Scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Karlson\\AppData\\Local\\Temp\\pip-req-build-mm0i0yyu\\setup.py'"'"'; __file__='"'"'C:\\Users\\Karlson\\AppData\\Local\\Temp\\pip-req-build-mm0i0yyu\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Karlson\AppData\Local\Temp\pip-pip-egg-info-sly7kipr'
           cwd: C:\Users\Karlson\AppData\Local\Temp\pip-req-build-mm0i0yyu\
      Complete output (5 lines):
      Traceback (most recent call last):
        File "<string>", line 1, in <module>
        File "c:\users\karlson\.pyenv\pyenv-win\versions\3.8.2\lib\tokenize.py", line 392, in open
          buffer = _builtin_open(filename, 'rb')
      FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\Karlson\\AppData\\Local\\Temp\\pip-req-build-mm0i0yyu\\setup.py'
      ----------------------------------------
  ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Gist with the full debug output: https://gist.github.com/kiudee/70df85a30c7caed4156fc490d2569d02

Installing the same package in the pyenv environment using pip install six works perfectly fine.

Let me know if you need more information to debug the problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/windowsFor Windows-specific issueskind/bugSomething isn't working as expectedstatus/needs-reproductionIssue needs a minimal reproduction to be confirmed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions