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.

AssertionError on pipenv install in ubuntu trusty docker

See original GitHub issue

I try to use pipenv in a docker container based on ubuntu trusty. Basically bare metal except for some security patches like apt-get install libssl-dev, libffi-dev and pip install requests[security]

I can run pipenv but whenever I try to call pipenv install I get the following output

root@782753ee5bc0:/# pipenv install requests
Creating a virtualenv for this project…
Using /usr/bin/python (2.7.6) to create virtualenv…
⠋usage: __main__.py [-h] [-p PYTHON] [-i PACKAGES] [-r REQUIREMENTS] [-d]
                   [-a PROJECT]
                   envname
__main__.py: error: too few arguments

Virtualenv location: 
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/python2.7/dist-packages/pipenv/vendor/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pipenv/cli.py", line 402, in install
    selective_upgrade=selective_upgrade,
  File "/usr/local/lib/python2.7/dist-packages/pipenv/core.py", line 1781, in do_install
    skip_requirements=skip_requirements,
  File "/usr/local/lib/python2.7/dist-packages/pipenv/core.py", line 650, in ensure_project
    ensure_pipfile(validate=validate, skip_requirements=skip_requirements, system=system)
  File "/usr/local/lib/python2.7/dist-packages/pipenv/core.py", line 304, in ensure_pipfile
    project.create_pipfile(python=python)
  File "/usr/local/lib/python2.7/dist-packages/pipenv/project.py", line 571, in create_pipfile
    config_parser = ConfigOptionParser(name=self.name)
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/pip9/baseparser.py", line 149, in __init__
    assert self.name
AssertionError
/usr/local/lib/python2.7/dist-packages/pipenv/_compat.py:86: ResourceWarning: Implicitly cleaning up <TemporaryDirectory '/tmp/pipenv-bI5NJZ-requirements'>
  warnings.warn(warn_message, ResourceWarning)

Running $ python -m pipenv.help yields:

$ python -m pipenv.help output

Pipenv version: '2018.05.18'

Pipenv location: '/usr/local/lib/python2.7/dist-packages/pipenv'

Python location: '/usr/bin/python'

Other Python installations in PATH:

  • 2.7: /usr/bin/python2.7

  • 2.7: /usr/bin/python2.7

  • 3.4: /usr/bin/python3.4m

  • 3.4: /usr/bin/python3.4

  • 2.7.6: /usr/bin/python

  • 2.7.6: /usr/bin/python2

  • 3.4.3: /usr/bin/python3

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '0',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '4.9.60-linuxkit-aufs',
 'platform_system': 'Linux',
 'platform_version': '#1 SMP Mon Nov 6 16:00:12 UTC 2017',
 'python_full_version': '2.7.6',
 'python_version': '2.7',
 'sys_platform': 'linux2'}

System environment variables:

  • LANG
  • TERM
  • LESSCLOSE
  • LANGUAGE
  • SHLVL
  • HOSTNAME
  • PYTHONDONTWRITEBYTECODE
  • LESSOPEN
  • PWD
  • PATH
  • LC_ALL
  • PIP_PYTHON_PATH
  • LS_COLORS
  • HOME
  • _

Pipenv–specific environment variables:

Debug–specific environment variables:

  • PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
  • LANG: en_US.UTF-8
  • PWD: /

Steps to replicate

Dockerfile

FROM ubuntu:trusty

RUN apt-get update && apt-get dist-upgrade -y && apt-get autoremove -y
&& apt-get install -y --force-yes --no-install-recommends
apt-transport-https
curl
ca-certificates
automake
python-dev
language-pack-en
libffi-dev
libssl-dev
&& apt-get clean

RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && python get-pip.py RUN python get-pip.py --force-reinstall RUN pip install requests[security]

ENV LANG en_US.UTF-8 ENV LANGUAGE en_US.UTF-8 ENV LC_ALL en_US.UTF-8 RUN locale-gen && dpkg-reconfigure locales RUN pip install pipenv RUN pipenv install requests

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:18 (9 by maintainers)

github_iconTop GitHub Comments

3reactions
littlejicommented, Apr 22, 2019

after I touched a Pipfile, the problem solved…

2reactions
larsclaussencommented, Jun 5, 2018

Running pipenv shell --fancy circumvents the problem

root@89918561ad95:/foo# pipenv shell --fancy
Launching subshell in virtual environment. Type 'exit' or 'Ctrl+D' to return.
# 
Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does pipenv fail to install a package inside a docker ...
In my Dockerfile, which has python and pip preinstalled (I'm using python:3.6-slim-jessie docker image) I have the line pip install --upgrade ...
Read more >
rstudio/checkrs-tew - Docker Image
Use pip to install pipenv: ... Use the following command to install packages into your local pyenv based Python environment: ... pipenv install...
Read more >
Python - Topic - codingforentrepreneurs.com
Deploy a Python web application on Ubuntu 18.04 LTS. We'll be using Django as our example but that's just a small part of...
Read more >
Bug listing with status UNCONFIRMED as at 2022/12/20 15 ...
Bug:128538 - "sys-apps/coreutils: /bin/hostname should be installed from coreutils not sys-apps/net-tools" status:UNCONFIRMED resolution: severity:enhancement ...
Read more >
labelImg - PyPI
Linux/Ubuntu/Mac requires at least Python 2.6 and has been tested with PyQt 4.8. ... brew install python3 pip3 install pipenv pipenv run pip...
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