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 install does not provide a good error message for no Pipfile.

See original GitHub issue
Issue 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:closed
  • Created 5 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jr7squarecommented, Oct 4, 2018

I’ll pick this up since the previous PR isn’t merged.

0reactions
andb0tcommented, Sep 3, 2019

Any update on this? I’m encountering the same error when installing pipenv in a fresh alpine dockerfile:

FROM alpine:latest

# install python3 and pipenv
RUN apk add --no-cache --virtual .build-deps g++ python3-dev libffi-dev openssl-dev \
    && apk add --no-cache --update python3 \
    && pip3 install --upgrade pip setuptools pipenv

Running this causes the error:

docker build -t pipenv-test .
docker run -it pipenv-test sh
pipenv shell
Read more comments on GitHub >

github_iconTop Results From Across the Web

Common Pipenv Errors and How to Solve Them: Why Won't it ...
Here, you'll learn how to troubleshoot Pipenv installation and locking issues. ... Pipfile won't lock when it tries to install packages that don't...
Read more >
pipenv Documentation - Read the Docs
This tutorial walks you through installing and using Python packages. It will show you how to install and use the necessary tools and...
Read more >
Configure a Pipenv environment | IntelliJ IDEA Documentation
If you see the Pipenv executable is not found error message, follow the pipenv installation procedure to discover the executable path and add...
Read more >
Using `pipenv install` on a Mac fails with 'No such file or ...
There you'll get the same error because your virtual env's python was still symlinked to some Python installation that does not exist anymore....
Read more >
Frequently Encountered Pipenv Problems - Read the Docs
This is usually a result of mixing Pipenv with system packages. We strongly recommend installing Pipenv in an isolated environment. Uninstall all existing ......
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