gpt4 book ai didi

python - 尝试在 Mac OS 中使用 pycharm 运行此命令 "pipenv lock "时出现 pipenv 内部错误

转载 作者:行者123 更新时间:2023-12-03 19:23:38 25 4
gpt4 key购买 nike

我是 python 和 pipenv 的新手。当我运行 pipenv lock 时,出现以下错误,我重新安装了 pipenv 并在 google 上搜索错误,但仍然无法修复错误。上次用pipenv打开项目还可以,为什么现在就不行了?和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

最佳答案

检查您的 Pipfile 是否有拼写错误?当 Pipfile 有错字时,我遇到了同样的错误,你的我认为它在第 45 行

关于python - 尝试在 Mac OS 中使用 pycharm 运行此命令 "pipenv lock "时出现 pipenv 内部错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58503128/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com