pipenv creates virtualenvs in ~/Library/Application Support on OSX, so binaries can be unrunnable
See original GitHub issueNeed 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:
- Created 5 years ago
- Comments:13 (8 by maintainers)
Top GitHub Comments
I think this has since been fixed, see get_workon_home()'s implementaion in the current latest commit in master.
happy to test any pew/virtualenvwrapper + mac stuff if needed