question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

poetry install fails because a space in path to env

See original GitHub issue
  • I am on the latest Poetry version.

    I’m on 1.1.0rc1

  • I have searched the issues of this repo and believe that this is not a duplicate.

    There are issues that deal with this error but are one or two years old, are closed or marked as fixed and the error output message is different.

  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).

Issue

poetry install throws the next error:

  EnvCommandError

  Command "C:\Users\John Smith\AppData\Local\pypoetry\Cache\virtualenvs\dge-bot-KUpJK1g6-py3.7\Scripts\pip.exe" install --no-deps C:\Users\John Smith\AppData\Local\pypoetry\Cache\artifacts\61\a4\b1\1096e79aeb46c7d99c2c17427ce252e25c6bf439f2b2747770cbcda517\zipp-3.2.0-py3-none-any.whl errored with the following return code 1, and output:       
  ERROR: Invalid requirement: 'C:\\Users\\John'
  Hint: It looks like a path. It does exist.
  WARNING: You are using pip version 20.2.2; however, version 20.2.3 is available.
  You should consider upgrading via the 'C:\Users\John Smith\AppData\Local\pypoetry\Cache\virtualenvs\dge-bot-KUpJK1g6-py3.7\Scripts\python.exe -m pip install --upgrade pip' command.


  at c:\users\john smith\appdata\local\programs\python\python37\lib\site-packages\poetry\utils\env.py:944 in _run
       940│                 output = subprocess.check_output(
       941│                     cmd, stderr=subprocess.STDOUT, **kwargs
       942│                 )
       943│         except CalledProcessError as e:
    →  944│             raise EnvCommandError(e, input=input_)
       945│
       946│         return decode(output)
       947│
       948│     def execute(self, bin, *args, **kwargs):

The error seems to be caused because there’s a space in my username, that’s included in the path to the virtualenv.

This error has been reported before (https://github.com/python-poetry/poetry/issues/199, https://github.com/python-poetry/poetry/issues/657), but in those instances the error was fixed. This one is happening in the latest version of Poetry.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
fcruzelcommented, Oct 2, 2020

Oh… I had forgotten that I was using 1.1.0rc1. Thank you.

Sure, I’ll open a new issue. Thank you @abn

0reactions
abncommented, Oct 2, 2020

Looks like poetry is downloading the exe for some reason and pip doesn’t like the exe. Can you raise a separate issue for that please? You can work around it by using a url dependency pointing to the zip file directly.

As for poetry update, if you have an older poetrg performing the update you will have the bug since well it is not updated yet. 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Announcing Poetry 1.3.0 | Blog
The Poetry team is pleased to announce the immediate availability of Poetry 1.3.0. If you have a previous version of Poetry installed via...
Read more >
How To Install Poetry to Manage Python Dependencies on ...
1) is installed now. Great! To get started you need Poetry's bin directory (/home/ sammy /.local/bin) in your `PATH` environment variable.
Read more >
Poetry install fails during docker build with CalledProcessError ...
Poetry gets and cache path to pip wheel on startup from virtualenv package with virtualenv.seed.wheels.embed.get_embed_wheel .
Read more >
Implementing dependency management with Python Poetry
One of the biggest issues with Python (our preferred development ... pipenv, pip-tools, hatch and the tool we ultimately chose: Poetry.
Read more >
Discussion on: Build Command Line Tools with Python Poetry
You are right; that space in Macintosh SR0 is causing problems. What version of poetry are you using, and how did you install...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found