gpt4 book ai didi

python - 尝试初始化环境时出错(Pipenv))

转载 作者:行者123 更新时间:2023-12-01 14:04:00 25 4
gpt4 key购买 nike

<分区>

放轻松,我是 n00b。当我尝试初始化环境以启动项目时出现此错误。在我决定在这里发布之前,我已经搜索了许多堆栈溢出和 GitHub(使用/请求)。我更新了 pipenv,甚至通过 python 从 3.6 更新到 3.7。我已经花了 2 个小时,但我决定我可能需要你的帮助。

pipenv run python3
Creating a virtualenv for this project…
Pipfile: /home/user1/Pipfile
Using /usr/bin/python3 (3.6.7) to create virtualenv…
⠙ Creating virtual environment...
✘ Failed creating virtual environment
[pipenv.exceptions.VirtualenvCreationException]: File "/home/user1/.local/lib/python3.6/site-packages/pipenv/cli/command.py", line 408, in run
[pipenv.exceptions.VirtualenvCreationException]: command=command, args=args, three=state.three, python=state.python, pypi_mirror=state.pypi_mirror
[pipenv.exceptions.VirtualenvCreationException]: File "/home/user1/.local/lib/python3.6/site-packages/pipenv/core.py", line 2310, in do_run
[pipenv.exceptions.VirtualenvCreationException]: three=three, python=python, validate=False, pypi_mirror=pypi_mirror,
[pipenv.exceptions.VirtualenvCreationException]: File "/home/user1/.local/lib/python3.6/site-packages/pipenv/core.py", line 574, in ensure_project
[pipenv.exceptions.VirtualenvCreationException]: pypi_mirror=pypi_mirror,
[pipenv.exceptions.VirtualenvCreationException]: File "/home/user1/.local/lib/python3.6/site-packages/pipenv/core.py", line 506, in ensure_virtualenv
[pipenv.exceptions.VirtualenvCreationException]: python=python, site_packages=site_packages, pypi_mirror=pypi_mirror
[pipenv.exceptions.VirtualenvCreationException]: File "/home/user1/.local/lib/python3.6/site-packages/pipenv/core.py", line 935, in do_create_virtualenv
[pipenv.exceptions.VirtualenvCreationException]: extra=[crayons.blue("{0}".format(c.err)),]
[pipenv.exceptions.VirtualenvCreationException]: Traceback (most recent call last):
File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/user1/.local/lib/python3.6/site-packages/virtualenv.py", line 26, in <module>
import logging
ImportError: bad magic number in 'logging': b'\x03\xf3\r\n'
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
from apport.report import Report
File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
import apport.fileutils
File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
from apport.packaging_impl import impl as packaging
File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 24, in <module>
import apt
File "/usr/lib/python3/dist-packages/apt/__init__.py", line 26, in <module>
from apt.package import Package
File "/usr/lib/python3/dist-packages/apt/package.py", line 24, in <module>
import logging
ImportError: bad magic number in 'logging': b'\x03\xf3\r\n'

Original exception was:
Traceback (most recent call last):
File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/user1/.local/lib/python3.6/site-packages/virtualenv.py", line 26, in <module>
import logging
ImportError: bad magic number in 'logging': b'\x03\xf3\r\n'

Failed to create virtual environ

修改。

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