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 creates virtualenvs in ~/Library/Application Support on OSX, so binaries can be unrunnable

See original GitHub issue

Need to fill this in with full steps to reproduce, since I suspect this should be easily reproduced in a much simpler project than the first one that I’m trying pipenv with, but pipenv is putting virtualenvs in ~/Library/Application Support (which is at first thought the right place to put them on OSX, but:), which can make even pipenv install itself fail:

⊙  pipenv install                                                                                                                                                                                                                                                                                                                                           Julian@Macnetic
Warning: Your Pipfile requires python_version pypy, but you are using 2.7.13 (/Users/Julian/L/A/v/M/bin/python).
  $ pipenv check will surely fail.
Installing dependencies from Pipfile.lock (ee6476)…
Traceback (most recent call last):▉▉▉▉▉ 0/65 — 00:00:00
  File "/Users/Julian/.local/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "/Users/Julian/.local/share/virtualenvs/pipenv/site-packages/pipenv/vendor/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/Users/Julian/.local/share/virtualenvs/pipenv/site-packages/pipenv/vendor/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/Users/Julian/.local/share/virtualenvs/pipenv/site-packages/pipenv/vendor/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/Julian/.local/share/virtualenvs/pipenv/site-packages/pipenv/vendor/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/Julian/.local/share/virtualenvs/pipenv/site-packages/pipenv/vendor/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/Users/Julian/.local/share/virtualenvs/pipenv/site-packages/pipenv/cli.py", line 195, in install
    selective_upgrade=selective_upgrade
  File "/Users/Julian/.local/share/virtualenvs/pipenv/site-packages/pipenv/core.py", line 1854, in do_install
    pre=pre, requirements_dir=requirements_directory
  File "/Users/Julian/.local/share/virtualenvs/pipenv/site-packages/pipenv/core.py", line 1394, in do_init
    requirements_dir=requirements_dir.name)
  File "/Users/Julian/.local/share/virtualenvs/pipenv/site-packages/pipenv/core.py", line 877, in do_install_dependencies
    requirements_dir=requirements_dir
  File "/Users/Julian/.local/share/virtualenvs/pipenv/site-packages/pipenv/core.py", line 1495, in pip_install
    c = delegator.run(pip_command, block=block)
  File "/Users/Julian/.local/share/virtualenvs/pipenv/site-packages/pipenv/vendor/delegator.py", line 267, in run
    c.run(block=block, binary=binary)
  File "/Users/Julian/.local/share/virtualenvs/pipenv/site-packages/pipenv/vendor/delegator.py", line 156, in run
    s = PopenSpawn(self._popen_args, **pexpect_kwargs)
  File "/Users/Julian/.local/share/virtualenvs/pipenv/site-packages/pipenv/vendor/pexpect/popen_spawn.py", line 46, in __init__
    self.proc = subprocess.Popen(cmd, **kwargs)
  File "/usr/local/Cellar/pypy/5.10.0_1/libexec/lib-python/2.7/subprocess.py", line 405, in __init__
    errread, errwrite)
  File "/usr/local/Cellar/pypy/5.10.0_1/libexec/lib-python/2.7/subprocess.py", line 1053, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

From dropping into a debugger, what’s actually happening there is pipenv is trying to subprocess ~/Library/Application\ Support/virtualenvs/Mux-zp_HsCah/bin/pip, but that file has a shebang with a space in it, so that’s not a runnable binary, even though it exists. One could get around that by using ~/Library/Application\ Support/virtualenvs/Mux-zp_HsCah/bin/python -m pip instead (in pipenv.core), but FWIW for this reason in my own virtualenv tool I had to choose to not follow the OSX convention of using Application Support and put binaries in the linux location (~/.local/share/virtualenvs).

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
claudeleveillecommented, Jan 21, 2020

I think this has since been fixed, see get_workon_home()'s implementaion in the current latest commit in master.

0reactions
AlJohricommented, Jun 12, 2018

happy to test any pew/virtualenvwrapper + mac stuff if needed

Read more comments on GitHub >

github_iconTop Results From Across the Web

Virtual Environments, pip and pipenv on MacOS - Jayden Chua
When we run python3 -m venv we are installing a new virtual environment and specifying the venv folder as the folder where all...
Read more >
Advanced Usage of Pipenv - Read the Docs
Pipenv will expand environment variables (if defined) in your Pipfile. Quite useful if you need to authenticate to a private PyPI:.
Read more >
virtual environment's architecture made by pipenv become ...
I'm struggling with using python on mac m1, and I found that there's an issue on pipenv for making virtual environment with correct...
Read more >
PyCharm 2019.3 macOS 10.15.3 pipenv not able to create ...
Hi, I am trying to get pipenv support to work. I followed the guide at https://www.jetbrains.com/help/pycharm/pipenv.html I installed...
Read more >
Pyenv and Pipenv (on MacOS) – Index - Wilson Mar
The tools to dynamically install and use different versions of Python, packages, all within Virtualenv.
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