pipenv: AttributeError: 'module' object has no attribute '_get_empty_inline_table'

I’m having this exception now. Everything was working fine last friday (I was using version 7.2). Now, I’ve got this error on version 7.2.8.

This error is thrown when I run pipenv lock or pipenv install.

My current environment is a Docker image: Python 2.7.13 pip 9.0.1 from /usr/local/lib/python2.7/site-packages (python 2.7)

Dockerfile

FROM python:2

RUN apt-get update && apt-get install -qyy \
    -o APT::Install-Recommends=false -o APT::Install-Suggests=false \
    git\
    gcc\
    openssh-client\
    libpq-dev\
    postgresql-client

WORKDIR /app

ADD Pipfile /app
ADD Pipfile.lock /app

RUN pip install pipenv
RUN pipenv install --dev

ADD . /app

EXPOSE 8000

Full error

root@dd905c0d6706:/mentors-api# pipenv lock
Traceback (most recent call last):
  File "/usr/local/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python2.7/site-packages/pipenv/vendor/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/pipenv/vendor/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/site-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/site-packages/pipenv/vendor/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/site-packages/pipenv/vendor/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/pipenv/cli.py", line 1575, in lock
    ensure_project(three=three, python=python)
  File "/usr/local/lib/python2.7/site-packages/pipenv/cli.py", line 478, in ensure_project
    ensure_virtualenv(three=three, python=python)
  File "/usr/local/lib/python2.7/site-packages/pipenv/cli.py", line 446, in ensure_virtualenv
    python = ensure_python(three=three, python=python)
  File "/usr/local/lib/python2.7/site-packages/pipenv/cli.py", line 339, in ensure_python
    python = project.required_python_version
  File "/usr/local/lib/python2.7/site-packages/pipenv/project.py", line 54, in required_python_version
    required = self.parsed_pipfile.get('requires', {}).get('python_version')
  File "/usr/local/lib/python2.7/site-packages/pipenv/project.py", line 191, in parsed_pipfile
    data[section][package] = toml._get_empty_inline_table(dict)
AttributeError: 'module' object has no attribute '_get_empty_inline_table'

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 44 (33 by maintainers)

Most upvoted comments

@kennethreitz and contributors, thank you for your time and effort. Pipenv is amazing!

It world like a charm! Good job

Here is the steps Docker and my Dockerfile performed when I built the container

Building api
Step 1/12 : FROM python:2
 ---> ac9424878b8f
Step 2/12 : RUN apt-get update && apt-get install -qyy     -o APT::Install-Recommends=false -o APT::Install-Suggests=false     git    gcc    openssh-client    libpq-dev    postgresql-client
 ---> Using cache
 ---> ae4adbd69c87
Step 3/12 : WORKDIR /app
 ---> Using cache
 ---> d87878cfaf5d
Step 4/12 : ADD Pipfile /app
 ---> Using cache
 ---> d48275eff145
Step 5/12 : ADD Pipfile.lock /app
 ---> Using cache
 ---> 6e6ca8dc803c
Step 6/12 : RUN pip install pipenv
 ---> Running in a3c84aeb591c
Collecting pipenv
  Downloading pipenv-7.3.9.tar.gz (4.1MB)
Requirement already satisfied: virtualenv in /usr/local/lib/python2.7/site-packages (from pipenv)
Collecting pew>=0.1.26 (from pipenv)
  Downloading pew-0.1.26-py2.py3-none-any.whl
Requirement already satisfied: pip>=9.0.1 in /usr/local/lib/python2.7/site-packages (from pipenv)
Collecting pip-tools>=1.9.0 (from pipenv)
  Downloading pip_tools-1.9.0-py2.py3-none-any.whl
Requirement already satisfied: setuptools>=36.3.0 in /usr/local/lib/python2.7/site-packages (from pipenv)
Collecting requests>2.0.0 (from pipenv)
  Downloading requests-2.18.4-py2.py3-none-any.whl (88kB)
Collecting pathlib; python_version == "2.7" (from pew>=0.1.26->pipenv)
  Downloading pathlib-1.0.1.tar.gz (49kB)
Collecting pythonz-bd>=1.10.2 (from pew>=0.1.26->pipenv)
  Downloading pythonz-bd-1.11.4.tar.gz (86kB)
Collecting shutilwhich; python_version == "2.7" (from pew>=0.1.26->pipenv)
  Downloading shutilwhich-1.1.0.tar.gz
Collecting backports.shutil-get-terminal-size; python_version == "2.7" (from pew>=0.1.26->pipenv)
  Downloading backports.shutil_get_terminal_size-1.0.0-py2.py3-none-any.whl
Collecting virtualenv-clone>=0.2.5 (from pew>=0.1.26->pipenv)
  Downloading virtualenv-clone-0.2.6.tar.gz
Collecting six (from pip-tools>=1.9.0->pipenv)
  Downloading six-1.11.0-py2.py3-none-any.whl
Collecting click>=6 (from pip-tools>=1.9.0->pipenv)
  Downloading click-6.7-py2.py3-none-any.whl (71kB)
Collecting first (from pip-tools>=1.9.0->pipenv)
  Downloading first-2.0.1-py2.py3-none-any.whl
Collecting idna<2.7,>=2.5 (from requests>2.0.0->pipenv)
  Downloading idna-2.6-py2.py3-none-any.whl (56kB)
Collecting urllib3<1.23,>=1.21.1 (from requests>2.0.0->pipenv)
  Downloading urllib3-1.22-py2.py3-none-any.whl (132kB)
Collecting certifi>=2017.4.17 (from requests>2.0.0->pipenv)
  Downloading certifi-2017.7.27.1-py2.py3-none-any.whl (349kB)
Collecting chardet<3.1.0,>=3.0.2 (from requests>2.0.0->pipenv)
  Downloading chardet-3.0.4-py2.py3-none-any.whl (133kB)
Building wheels for collected packages: pipenv, pathlib, pythonz-bd, shutilwhich, virtualenv-clone
  Running setup.py bdist_wheel for pipenv: started
  Running setup.py bdist_wheel for pipenv: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/ca/39/d5/f0348ceb0843d18e7884f1a9a42b1b34197a1b96e5052e4f12
  Running setup.py bdist_wheel for pathlib: started
  Running setup.py bdist_wheel for pathlib: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/2a/23/a5/d8803db5d631e9f391fe6defe982a238bf5483062eeb34e841
  Running setup.py bdist_wheel for pythonz-bd: started
  Running setup.py bdist_wheel for pythonz-bd: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/04/de/c8/da2d21bb0112bb65bfb28bdf9ee8f2c819c25db143c32435b2
  Running setup.py bdist_wheel for shutilwhich: started
  Running setup.py bdist_wheel for shutilwhich: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/0e/28/70/d5cc6586f26d614b26901485f6f6072d35cbbb5bbeffb6ea43
  Running setup.py bdist_wheel for virtualenv-clone: started
  Running setup.py bdist_wheel for virtualenv-clone: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/24/51/ef/93120d304d240b4b6c2066454250a1626e04f73d34417b956d
Successfully built pipenv pathlib pythonz-bd shutilwhich virtualenv-clone
Installing collected packages: pathlib, pythonz-bd, shutilwhich, backports.shutil-get-terminal-size, virtualenv-clone, pew, six, click, first, pip-tools, idna, urllib3, certifi, chardet, requests, pipenv
Successfully installed backports.shutil-get-terminal-size-1.0.0 certifi-2017.7.27.1 chardet-3.0.4 click-6.7 first-2.0.1 idna-2.6 pathlib-1.0.1 pew-0.1.26 pip-tools-1.9.0 pipenv-7.3.9 pythonz-bd-1.11.4 requests-2.18.4 shutilwhich-1.1.0 six-1.11.0 urllib3-1.22 virtualenv-clone-0.2.6
 ---> aab9a9f7943f
Removing intermediate container a3c84aeb591c
Step 7/12 : RUN pip install --no-cache-dir ipdb
 ---> Running in a92fd1e8d4fc
Collecting ipdb
  Downloading ipdb-0.10.3.tar.gz
Requirement already satisfied: setuptools in /usr/local/lib/python2.7/site-packages (from ipdb)
Collecting ipython<6.0.0,>=0.10.2 (from ipdb)
  Downloading ipython-5.5.0-py2-none-any.whl (758kB)
Collecting simplegeneric>0.8 (from ipython<6.0.0,>=0.10.2->ipdb)
  Downloading simplegeneric-0.8.1.zip
Collecting pickleshare (from ipython<6.0.0,>=0.10.2->ipdb)
  Downloading pickleshare-0.7.4-py2.py3-none-any.whl
Requirement already satisfied: backports.shutil-get-terminal-size; python_version == "2.7" in /usr/local/lib/python2.7/site-packages (from ipython<6.0.0,>=0.10.2->ipdb)
Collecting pathlib2; python_version == "2.7" or python_version == "3.3" (from ipython<6.0.0,>=0.10.2->ipdb)
  Downloading pathlib2-2.3.0-py2.py3-none-any.whl
Collecting pexpect; sys_platform != "win32" (from ipython<6.0.0,>=0.10.2->ipdb)
  Downloading pexpect-4.2.1-py2.py3-none-any.whl (55kB)
Collecting traitlets>=4.2 (from ipython<6.0.0,>=0.10.2->ipdb)
  Downloading traitlets-4.3.2-py2.py3-none-any.whl (74kB)
Collecting pygments (from ipython<6.0.0,>=0.10.2->ipdb)
  Downloading Pygments-2.2.0-py2.py3-none-any.whl (841kB)
Collecting decorator (from ipython<6.0.0,>=0.10.2->ipdb)
  Downloading decorator-4.1.2-py2.py3-none-any.whl
Collecting prompt-toolkit<2.0.0,>=1.0.4 (from ipython<6.0.0,>=0.10.2->ipdb)
  Downloading prompt_toolkit-1.0.15-py2-none-any.whl (247kB)
Requirement already satisfied: six in /usr/local/lib/python2.7/site-packages (from pathlib2; python_version == "2.7" or python_version == "3.3"->ipython<6.0.0,>=0.10.2->ipdb)
Collecting scandir; python_version < "3.5" (from pathlib2; python_version == "2.7" or python_version == "3.3"->ipython<6.0.0,>=0.10.2->ipdb)
  Downloading scandir-1.5.tar.gz
Collecting ptyprocess>=0.5 (from pexpect; sys_platform != "win32"->ipython<6.0.0,>=0.10.2->ipdb)
  Downloading ptyprocess-0.5.2-py2.py3-none-any.whl
Collecting enum34; python_version == "2.7" (from traitlets>=4.2->ipython<6.0.0,>=0.10.2->ipdb)
  Downloading enum34-1.1.6-py2-none-any.whl
Collecting ipython-genutils (from traitlets>=4.2->ipython<6.0.0,>=0.10.2->ipdb)
  Downloading ipython_genutils-0.2.0-py2.py3-none-any.whl
Collecting wcwidth (from prompt-toolkit<2.0.0,>=1.0.4->ipython<6.0.0,>=0.10.2->ipdb)
  Downloading wcwidth-0.1.7-py2.py3-none-any.whl
Installing collected packages: simplegeneric, scandir, pathlib2, pickleshare, ptyprocess, pexpect, enum34, ipython-genutils, decorator, traitlets, pygments, wcwidth, prompt-toolkit, ipython, ipdb
  Running setup.py install for simplegeneric: started
    Running setup.py install for simplegeneric: finished with status 'done'
  Running setup.py install for scandir: started
    Running setup.py install for scandir: finished with status 'done'
  Running setup.py install for ipdb: started
    Running setup.py install for ipdb: finished with status 'done'
Successfully installed decorator-4.1.2 enum34-1.1.6 ipdb-0.10.3 ipython-5.5.0 ipython-genutils-0.2.0 pathlib2-2.3.0 pexpect-4.2.1 pickleshare-0.7.4 prompt-toolkit-1.0.15 ptyprocess-0.5.2 pygments-2.2.0 scandir-1.5 simplegeneric-0.8.1 traitlets-4.3.2 wcwidth-0.1.7
 ---> d0d1608ea903
Removing intermediate container a92fd1e8d4fc
Step 8/12 : RUN pipenv install --dev
 ---> Running in acd1d847534e
Using /usr/local/bin/python2.7 to create virtualenv…
Creating a virtualenv for this project…
Running virtualenv with interpreter /usr/local/bin/python2.7
New python executable in /root/.local/share/virtualenvs/app-6QS5KGRI/bin/python2.7
Also creating executable in /root/.local/share/virtualenvs/app-6QS5KGRI/bin/python
Installing setuptools, pip, wheel...done.

Virtualenv location: /root/.local/share/virtualenvs/app-6QS5KGRI
No package provided, installing all dependencies.
Installing dependencies from Pipfile.lock…
To activate this project's virtualenv, run the following:
 $ pipenv shell
 ---> ad5f243eaafe
Removing intermediate container acd1d847534e