Pipenv install does not provide a good error message for no Pipfile.
See original GitHub issueIssue description
When attempting to run pipenv install --dev
in the wrong spot I got this error below (not a bug I assume).
~ # pipenv install --dev
Creating a Pipfile for this project...
Traceback (most recent call last):
File "/usr/local/bin/pipenv", line 11, in <module>
sys.exit(cli())
File "/usr/local/lib/python3.4/site-packages/pipenv/vendor/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.4/site-packages/pipenv/vendor/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.4/site-packages/pipenv/vendor/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.4/site-packages/pipenv/vendor/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.4/site-packages/pipenv/vendor/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.4/site-packages/pipenv/cli.py", line 435, in install
selective_upgrade=selective_upgrade,
File "/usr/local/lib/python3.4/site-packages/pipenv/core.py", line 1759, in do_install
pypi_mirror=pypi_mirror,
File "/usr/local/lib/python3.4/site-packages/pipenv/core.py", line 639, in ensure_project
ensure_pipfile(validate=validate, skip_requirements=skip_requirements, system=system)
File "/usr/local/lib/python3.4/site-packages/pipenv/core.py", line 288, in ensure_pipfile
project.create_pipfile(python=python)
File "/usr/local/lib/python3.4/site-packages/pipenv/project.py", line 576, in create_pipfile
config_parser = ConfigOptionParser(name=self.name)
File "/usr/local/lib/python3.4/site-packages/pipenv/patched/notpip/_internal/baseparser.py", line 141, in __init__
assert self.name
AssertionError
~ #
Expected result
I would expect something about missing a Pipfile or some such. Probaly something along these lines.
AssertionError("Could not find Pipfile.")
Actual result
Instead I just got AssertionError()
.
Steps to replicate
mkdir foo
cd foo
pipenv install --dev
$ pipenv --support
Pipenv version: '2018.7.1'
Pipenv location: '/usr/local/lib/python3.4/site-packages/pipenv'
Python location: '/usr/local/bin/python'
Other Python installations in PATH
:
-
3.4
:/usr/local/bin/python3.4m
-
3.4
:/usr/local/bin/python3.4
-
3.4
:/usr/local/bin/python3.4
-
3.4.9
:/usr/local/bin/python
-
3.4.9
:/usr/local/bin/python
-
3.4.9
:/usr/local/bin/python3
-
3.4.9
:/usr/local/bin/python3
PEP 508 Information:
{'implementation_name': 'cpython',
'implementation_version': '3.4.9',
'os_name': 'posix',
'platform_machine': 'x86_64',
'platform_python_implementation': 'CPython',
'platform_release': '4.15.0-33-generic',
'platform_system': 'Linux',
'platform_version': '#36-Ubuntu SMP Wed Aug 15 16:00:05 UTC 2018',
'python_full_version': '3.4.9',
'python_version': '3.4',
'sys_platform': 'linux'}
System environment variables:
PYTHONDONTWRITEBYTECODE
https_proxy
http_proxy
HOME
HTTPS_PROXY
LANG
PWD
no_proxy
PATH
HOSTNAME
PIP_PYTHON_PATH
OLDPWD
NO_PROXY
GPG_KEY
HTTP_PROXY
TERM
PYTHON_PIP_VERSION
SHLVL
PYTHON_VERSION
Pipenv–specific environment variables:
Debug–specific environment variables:
PATH
:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
LANG
:C.UTF-8
PWD
:/
Contents of Pipfile
(‘/Pipfile’):
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (5 by maintainers)
Top GitHub Comments
I’ll pick this up since the previous PR isn’t merged.
Any update on this? I’m encountering the same error when installing pipenv in a fresh alpine dockerfile:
Running this causes the error: