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.

`pipenv shell` fails with path including spaces.

See original GitHub issue
tsbertalan@sindri:~$ sudo pip install pipenv
... snip ...
tsbertalan@sindri:~$ cd dirname\ with\ spaces/
tsbertalan@sindri:~/dirname with spaces$ pipenv shell
Creating a Pipfile for this project...
Creating a virtualenv for this project...
New python executable in /home/tsbertalan/dirname with spaces/.venv/bin/python
Installing setuptools, pip, wheel...done.

Virtualenv location: /home/tsbertalan/dirname with spaces/.venv
Spawning environment shell (/bin/bash).
/bin/bash: /home/tsbertalan/dirname: No such file or directory
tsbertalan@sindri:~$ cd dirname\ with\ spaces/
tsbertalan@sindri:~/dirname with spaces$ pipenv shell
Creating a Pipfile for this project...
Creating a virtualenv for this project...
New python executable in /home/tsbertalan/dirname with spaces/.venv/bin/python
Installing setuptools, pip, wheel...done.

Virtualenv location: /home/tsbertalan/dirname with spaces/.venv
Spawning environment shell (/bin/bash).
/bin/bash: /home/tsbertalan/dirname: No such file or directory

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
nateprewittcommented, Jan 26, 2017

I’m going to leave this here for when someone eventually searches trying to solve this issue. While #99 solves the pipenv activation issue, most other pipenv commands still don’t work properly. After a couple hours of pulling threads, I came across this.

virtualenv, and thus pipenv, calls the absolute path to the .venv directory to run things like pip and python. Since these have a space in their path, the the linux exec call will always treat the first space it encounters as the end of the command. Anything after that is considered a parameter. This means anything in the form /home/user/path to dir/.venv/bin/pip won’t work.

So in order to address this, we’d need to allow the user to provide an alternative path for installing the virtualenv and then track that somewhere. That seems a bit excessive for a likely uncommon, and fairly avoidable, edge case. If it proves to be a significant problem, that’s probably the best route to go though. Until then, I don’t think we can support paths with spaces in a meaningful way.

1reaction
jessebrahamcommented, Jan 26, 2017

@kfirbreger At this point Windows is not officially supported, so it was not something that was taken in to consideration. If Windows support is added then yes it will need to be changed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - Pipenv install acting weird
Failed to load paths: File "<string>", line 1 import sysconfig, distutils.sysconfig, io, json, sys; paths = {u'purelib': u'{0}'.format(distutils ...
Read more >
pipenv Documentation
If pipenv isn't available in your shell after installation, you'll need to add the user base's binary directory to your PATH.
Read more >
Advanced Usage of Pipenv - Python Packaging Authority
Pipenv allows you to open any Python module that is installed (including ones in your codebase), with the $ pipenv open command: $...
Read more >
Basic Usage of Pipenv - Read the Docs
Pipenv is a reference implementation for using Pipfile. ... A proper shell configuration only sets environment variables like PATH during a login session, ......
Read more >
Running Python and Jupyter with Pipenv | by Edward ...
Environments are the space in which developers work, learn, and create. ... If any issues arose be sure that you have run pipenv...
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