pipenv install --system cannot find python path
See original GitHub issueWhen executing pipenv install --system
using pipenv 8.1.2 or older, everything works as normal. When using pipenv version 8.1.3 or newer, pipenv cannot find the path to python.
- Environment: I run this inside a docker container: tensorflow:1.3.0-gpu-py3 using nvidia-docker
- Python version: 3.5.2
- Python location: /usr/bin/python
- Pipenv version: 8.1.3 or newer
Expected result
No thrown exception
Pipfile.lock not found, creating…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
Updated Pipfile.lock!
Installing dependencies from Pipfile.lock…
Actual result
The following exception is thrown:
Pipfile.lock not found, creating…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
Error [Errno 2] No such file or directory: '/bin/python' while executing command python setup.py egg_info
Traceback (most recent call last):
File "/usr/local/bin/pipenv", line 11, in <module>
sys.exit(cli())
File "/usr/local/lib/python3.5/dist-packages/pipenv/vendor/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/pipenv/vendor/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.5/dist-packages/pipenv/vendor/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.5/dist-packages/pipenv/vendor/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.5/dist-packages/pipenv/vendor/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/pipenv/cli.py", line 1738, in install
do_init(dev=dev, allow_global=system, ignore_pipfile=ignore_pipfile, system=system, skip_lock=skip_lock, verbose=verbose, concurrent=concurrent, deploy=deploy)
File "/usr/local/lib/python3.5/dist-packages/pipenv/cli.py", line 1250, in do_init
do_lock(system=system)
File "/usr/local/lib/python3.5/dist-packages/pipenv/cli.py", line 1069, in do_lock
pre=pre
File "/usr/local/lib/python3.5/dist-packages/pipenv/utils.py", line 425, in resolve_deps
resolved_tree.update(resolver.resolve())
File "/usr/local/lib/python3.5/dist-packages/piptools/resolver.py", line 101, in resolve
has_changed, best_matches = self._resolve_one_round()
File "/usr/local/lib/python3.5/dist-packages/piptools/resolver.py", line 198, in _resolve_one_round
for dep in self._iter_dependencies(best_match):
File "/usr/local/lib/python3.5/dist-packages/piptools/resolver.py", line 284, in _iter_dependencies
dependencies = self.repository.get_dependencies(ireq)
File "/usr/local/lib/python3.5/dist-packages/piptools/repositories/pypi.py", line 170, in get_dependencies
self._dependencies_cache[ireq] = reqset._prepare_file(self.finder, ireq)
File "/usr/local/lib/python3.5/dist-packages/pipenv/patched/pip/req/req_set.py", line 634, in _prepare_file
abstract_dist.prep_for_dist()
File "/usr/local/lib/python3.5/dist-packages/pipenv/patched/pip/req/req_set.py", line 129, in prep_for_dist
self.req_to_install.run_egg_info()
File "/usr/local/lib/python3.5/dist-packages/pipenv/patched/pip/req/req_install.py", line 447, in run_egg_info
command_desc='python setup.py egg_info')
File "/usr/local/lib/python3.5/dist-packages/pipenv/patched/pip/utils/__init__.py", line 667, in call_subprocess
cwd=cwd, env=env)
File "/usr/lib/python3.5/subprocess.py", line 947, in __init__
restore_signals, start_new_session)
File "/usr/lib/python3.5/subprocess.py", line 1551, in _execute_child
raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: '/bin/python'
Steps to replicate
pip install pipenv==8.1.3
pipenv install --system
Issue Analytics
- State:
- Created 6 years ago
- Comments:17 (10 by maintainers)
Top Results From Across the Web
pipenv doesn't find correct python version on $PATH without ...
When multiple versions of python 3 are installed on $PATH and pyenv is not available, then pipenv will only look at /usr/bin/python3 and...
Read more >Why can't Pipenv find the correct version of python for my venv?
I am having a similar workflow when it comes to installing Python (using both Pyenv and Pipenv). This is working for me: Install...
Read more >Configure a Pipenv environment | IntelliJ IDEA Documentation
Install Pipenv · Run the following command to find the user base's binary directory: $ python -m site --user-base · Add bin...
Read more >pipenv · PyPI
Commands. Locate the Project. Locate the virtualenv. Locate the Python Interpreter. Install Packages. Installing from git. Install a dev dependency.
Read more >Using Python environments in VS Code
Using Python environments in VS Code. This article discusses the helpful Python environments features available in Visual Studio Code. An "environment" in ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok, I’ve done some investigating, and I’ve been able to make it work in a way that’s not too hacky. As an aside, my main reason for doing this is because
pipenv
doesn’t work on my Windows PC due to a corporate firewall that thinks it’s a virus 😛Here are my steps for reproducing the issue:
I tried to track down what was giving this error and had no luck, then I discovered that there is a verbose option to
pipenv install
. I used that and had the following results:I tried to figure out which script referenced
/bin/python
, but to no avail. So I thought, well, I can fix this easy enough:When adding the symbolic link function into my
Dockerfile
, I’m able to do this all dynamically. I understand from @kennethreitz that this goes against the very principle of pipenv, mainly being that when you deploy your application, you have the versions already pinned. I agree with him. In my case, I’m simply using this method to generate myPipfile.lock
since I can’t generate it on my development workstation.If you are interested though, here is what the
Dockerfile
could look like:Hi @erinxocon , the reason it works for you, is because you are missing the slash before notebooks, and pipenv does not find the Pipfile (since it is not in working directory). For your Dockerfile, it does not crash, but the result is a docker container without any dependencies from the Pipfile.
This Dockerfile does not work: (e.g with /notebooks rather than notebooks)
I have also tested this Dockerfile with pipenv version
8.3.2
and the bug still persist.