Pipenv dockerfile fails to install
See original GitHub issueLooks like my dockerfiles using pipenv are failing at the moment when I try to build them.
Describe your environment
- OS Type: Docker pipenv docker file
- Python version:
$ python -V
- Pipenv version:
$ pipenv --version
Expected result
Expected pipenv dockerfile to build and install properly.
Actual result
Docker build fails at pipenv install --deploy --system
---> Running in e0eedb80adab
+ pipenv install --deploy --system
Installing dependencies from Pipfile.lock (1c8a85)…
Traceback (most recent call last):
File "/usr/bin/pipenv", line 11, in <module>
load_entry_point('pipenv==11.1.4', 'console_scripts', 'pipenv')()
File "/usr/lib/python3/dist-packages/pipenv/vendor/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/usr/lib/python3/dist-packages/pipenv/vendor/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/usr/lib/python3/dist-packages/pipenv/vendor/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/python3/dist-packages/pipenv/vendor/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python3/dist-packages/pipenv/vendor/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/usr/lib/python3/dist-packages/pipenv/cli.py", line 197, in install
selective_upgrade=selective_upgrade
File "/usr/lib/python3/dist-packages/pipenv/core.py", line 1836, in do_install
pre=pre, requirements_dir=requirements_directory
File "/usr/lib/python3/dist-packages/pipenv/core.py", line 1373, in do_init
requirements_dir=requirements_dir.name)
File "/usr/lib/python3/dist-packages/pipenv/core.py", line 857, in do_install_dependencies
requirements_dir=requirements_dir
File "/usr/lib/python3/dist-packages/pipenv/core.py", line 1474, in pip_install
c = delegator.run(pip_command, block=block)
File "/usr/lib/python3/dist-packages/pipenv/vendor/delegator.py", line 267, in run
c.run(block=block, binary=binary)
File "/usr/lib/python3/dist-packages/pipenv/vendor/delegator.py", line 156, in run
s = PopenSpawn(self._popen_args, **pexpect_kwargs)
File "/usr/lib/python3/dist-packages/pipenv/vendor/pexpect/popen_spawn.py", line 46, in __init__
self.proc = subprocess.Popen(cmd, **kwargs)
File "/usr/lib/python3.6/subprocess.py", line 709, in __init__
restore_signals, start_new_session)
File "/usr/lib/python3.6/subprocess.py", line 1344, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/bin/pip': '/bin/pip'
Steps to replicate
docker build .
with a Dockerfile containing
FROM kennethreitz/pipenv
Issue Analytics
- State:
- Created 6 years ago
- Comments:19 (12 by maintainers)
Top Results From Across the Web
Pipenv in docker fails to install packages - Stack Overflow
The problem lies in --system. This makes pipenv use the pip command - which resolves in /usr/bin/pip , which is the 2.7 pip....
Read more >[Solved]-Pipenv in docker fails to install packages-docker
The problem lies in --system. This makes pipenv use the pip command - which resolves in /usr/bin/pip , which is the 2.7 pip....
Read more >Setting up Docker with Pipenv - DEV Community
I'll give you a rundown of how I am using my Dockerfile and docker-compose together to get python running with pipenv.
Read more >Docker containers for pipenv - Medium
In the image we created earlier, we didn't have dev dependencies installed. Though this would make the container size small, we will not...
Read more >Using Pipenv with Docker - Jonathan Meier
Dockerfile FROM python:3.8 RUN pip install pipenv ENV PROJECT_DIR /usr/local/src/webapp WORKDIR ${PROJECT_DIR} COPY Pipfile Pipfile.lock ...
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
seems plausible, I had an eye on this bug somewhere else. I’ll try to get to it today
@techalchemy So, fixed now. I don’t know why, but your suggestion of reverting back to what I had earlier without the symbolic links may have been it.
As noted in my earlier message, I installed pip via
get-pip.py
. Additionally, I can’t runsudo
in this container as my container user doesn’t have sudo privs (I could login as root if I tried, but I know I haven’t).(I changed the above docker snippet back to:)