Pipenv: Pipenv 2018.10.9 tidak dapat menangani tabel sebaris

Dibuat pada 10 Okt 2018  ·  3Komentar  ·  Sumber: pypa/pipenv

Deskripsi masalah

Pipenv gagal dengan kesalahan toml saat mencoba melakukan apa pun pada Pipfile yang berisi tabel [package.<>] , sesuatu yang versi sebelumnya dari pipenv menulis ulang dari inline ke bentuk yang diperluas. Ironisnya, kesalahan yang ditimbulkan adalah kesalahan atribut yang mencoba mengurai tabel _inline_, yang tidak harus ada di file contoh.

Misalnya, Pipfile ini rusak (dengan atau tanpa bagian [package] kosong):

[packages]

[packages.apache-airflow]
editable = true
git = "https://github.com/apache/incubator-airflow.git"

[requires]
python_version = "3.7"

Pipfile ini tidak rusak _untuk masalah ini_ (ini malah diblokir oleh show stopper di #2984):

[packages]
apache-airflow = {editable = true, git = "https://github.com/apache/incubator-airflow.git"}

[requires]
python_version = "3.7"

Hasil yang diharapkan

pipenv untuk bekerja (instal, kunci, shell, dll).

Hasil sebenarnya

Traceback (most recent call last):
  File "/usr/local/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/pipenv/cli/command.py", line 308, in lock
    ensure_project(three=state.three, python=state.python, pypi_mirror=state.pypi_mirror)
  File "/usr/local/lib/python3.7/site-packages/pipenv/core.py", line 561, in ensure_project
    pypi_mirror=pypi_mirror,
  File "/usr/local/lib/python3.7/site-packages/pipenv/core.py", line 484, in ensure_virtualenv
    python = ensure_python(three=three, python=python)
  File "/usr/local/lib/python3.7/site-packages/pipenv/core.py", line 394, in ensure_python
    python = project.required_python_version
  File "/usr/local/lib/python3.7/site-packages/pipenv/project.py", line 229, in required_python_version
    required = self.parsed_pipfile.get("requires", {}).get(
  File "/usr/local/lib/python3.7/site-packages/pipenv/project.py", line 448, in parsed_pipfile
    parsed = self._parse_pipfile(contents)
  File "/usr/local/lib/python3.7/site-packages/pipenv/project.py", line 480, in _parse_pipfile
    data[section][package] = toml._get_empty_inline_table(dict)
AttributeError: module 'toml' has no attribute '_get_empty_inline_table'

$ pipenv --dukungan

Versi Pipenv: '2018.10.9'

Lokasi Pipenv: '/usr/local/lib/python3.7/site-packages/pipenv'

Lokasi Python: '/usr/local/opt/python/bin/python3.7'

Instalasi python ditemukan:

  • 3.7.0 : /Users/jacobhayes/.local/share/virtualenvs/yay-vfCSW5aP/bin/python3.7
  • 3.7.0 : /usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/bin/python3.7
  • 3.7.0 : /usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/bin/python3.7m
  • 2.7.15 : /usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/bin/python2.7
  • 2.7.10 : /usr/bin/python
  • 2.7.10 : /usr/bin/pythonw
  • 2.7.10 : /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7

Informasi PEP 508:

{'implementation_name': 'cpython',
 'implementation_version': '3.7.0',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '18.0.0',
 'platform_system': 'Darwin',
 'platform_version': 'Darwin Kernel Version 18.0.0: Wed Aug 22 20:13:40 PDT '
                     '2018; root:xnu-4903.201.2~1/RELEASE_X86_64',
 'python_full_version': '3.7.0',
 'python_version': '3.7',
 'sys_platform': 'darwin'}

Variabel lingkungan sistem:

  • Apple_PubSub_Socket_Render
  • COLORFGBG
  • COLORTERM
  • COMMAND_MODE
  • COPYFILE_DISABLE
  • EDITOR
  • GO111MODULE
  • GOPATH
  • HOME
  • HOMEBREW_GITHUB_API_TOKEN
  • ITERM_PROFILE
  • ITERM_SESSION_ID
  • LANG
  • LC_ALL
  • LOGNAME
  • PAGER
  • PATH
  • PIPENV_ACTIVE
  • PIP_PYTHON_PATH
  • PIP_SHIMS_BASE_MODULE
  • PWD
  • PYTHONDONTWRITEBYTECODE
  • SECURITYSESSIONID
  • SHELL
  • SHLVL
  • SSH_AUTH_SOCK
  • TERM
  • TERM_PROGRAM
  • TERM_PROGRAM_VERSION
  • TERM_SESSION_ID
  • TMPDIR
  • TMUX
  • TMUX_PANE
  • TMUX_PLUGIN_MANAGER_PATH
  • USER
  • VIRTUAL_ENV
  • XPC_FLAGS
  • XPC_SERVICE_NAME
  • _OLD_FISH_PROMPT_OVERRIDE
  • _OLD_VIRTUAL_PATH
  • __CF_USER_TEXT_ENCODING
  • __pipenv_fish_initial_pwd

Variabel lingkungan spesifik Pipenv:

  • PIPENV_ACTIVE : 1

Variabel lingkungan khusus debug:

  • PATH : /Users/jacobhayes/.local/share/virtualenvs/yay-vfCSW5aP/bin:/Users/jacobhayes/bin:/Users/jacobhayes/bin:/Users/jacobhayes/bin:/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/bin:/Users/jacobhayes/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
  • SHELL : /usr/local/bin/fish
  • EDITOR : nvim
  • LANG : en_US.UTF-8
  • PWD : /Users/jacobhayes/src/github.com/JacobHayes/dockerfiles/yay
  • VIRTUAL_ENV : /Users/jacobhayes/.local/share/virtualenvs/yay-vfCSW5aP

Isi Pipfile ('/Users/jacobhayes/src/github.com/JacobHayes/dockerfiles/yay/Pipfile'):

[packages]
apache-airflow = {editable = true, git = "https://github.com/apache/incubator-airflow.git"}

[requires]
python_version = "3.7"

Isi Pipfile.lock ('/Users/jacobhayes/src/github.com/JacobHayes/dockerfiles/yay/Pipfile.lock'):

{
    "_meta": {
        "hash": {
            "sha256": "4fe62ca4ea8f5d57635a26fba05110d9a5301d8aa69f2aebc8d1c7be6738e37b"
        },
        "pipfile-spec": 6,
        "requires": {
            "python_version": "3.7"
        },
        "sources": [
            {
                "name": "pypi",
                "url": "https://pypi.org/simple",
                "verify_ssl": true
            }
        ]
    },
    "default": {
        "apache-airflow": {
            "editable": true,
            "git": "https://github.com/apache/incubator-airflow.git",
            "ref": "cdbdcae7c0645ac2987360fced43407202716b99"
        }
    },
    "develop": {}
}

Komentar yang paling membantu

Ini telah diselesaikan di #2971 dan akan dirilis hari ini

Semua 3 komentar

Ini telah diselesaikan di #2971 dan akan dirilis hari ini

@techalchemy ada rilis ETA yang diperbarui? Ingin tahu apakah saya harus memasang pin ke versi sebelumnya untuk rilis berikutnya pada hari Senin atau menunggu versi pipenv berikutnya

Hari ini, semoga dalam 20 menit ke depan karena saya sedang berlibur dan akan menjadi AFK untuk sisa hari itu

Apakah halaman ini membantu?
0 / 5 - 0 peringkat