简体   繁体   中英

Getting pipenv internal error while trying to run this command “ pipenv lock ” with pycharm in mac OS

I am new to python and pipenv. when I run pipenv lock ,I got the following error, I have reinstall pipenv and search the error on google but I still can not fix the error. Last time when I opened the projects with pipenv it is ok, why now it is bad? Is there any relationship with oh-my-zsh?

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/pipenv/project.py", line 527, in _parse_pipfile
    return tomlkit.parse(contents)
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/tomlkit/api.py", line 49, in parse
    return Parser(string).parse()
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/tomlkit/parser.py", line 146, in parse
    key, value = self._parse_table()
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/tomlkit/parser.py", line 958, in _parse_table
    item = self._parse_item()
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/tomlkit/parser.py", line 270, in _parse_item
    return self._parse_key_value(True)
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/tomlkit/parser.py", line 347, in _parse_key_value
    raise self.parse_error(UnexpectedCharError, "=")
** tomlkit.exceptions.UnexpectedCharError: Unexpected character: '=' at line 45 col 16 **

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/toml/decoder.py", line 456, in loads
    multibackslash)
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/toml/decoder.py", line 678, in load_line
    raise ValueError("Invalid date or number")
ValueError: Invalid date or number

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/pipenv", line 10, 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/vendor/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/pipenv/cli/command.py", line 301, in uninstall
    ctx=ctx
  File "/usr/local/lib/python3.7/site-packages/pipenv/core.py", line 2020, in do_uninstall
    ensure_project(three=three, python=python, pypi_mirror=pypi_mirror)
  File "/usr/local/lib/python3.7/site-packages/pipenv/core.py", line 574, in ensure_project
    pypi_mirror=pypi_mirror,
  File "/usr/local/lib/python3.7/site-packages/pipenv/core.py", line 494, 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 243, in required_python_version
    required = self.parsed_pipfile.get("requires", {}).get(
  File "/usr/local/lib/python3.7/site-packages/pipenv/project.py", line 509, in parsed_pipfile
    parsed = self._parse_pipfile(contents)
  File "/usr/local/lib/python3.7/site-packages/pipenv/project.py", line 531, in _parse_pipfile
    return toml.loads(contents)
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/toml/decoder.py", line 458, in loads
    raise TomlDecodeError(str(err), original, pos)
toml.decoder.TomlDecodeError: Invalid date or number (line 45 column 1 char 848)``

when I run `pipenv update`, I got the same error

Check your Pipfile if there is a typo? I got the same error when the Pipfile has a typo, yours I think it is in line 45

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM