create virtualenv show error
D:\tools\Python\Python311\python.exe D:\tools\JetBrains\PyCharm 2025.2.4\plugins\python-ce\helpers\virtualenv-py3.pyz D:\pythonwork\python-demo\.venv1
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "D:\tools\JetBrains\PyCharm 2025.2.4\plugins\python-ce\helpers\virtualenv-py3.pyz\__main__.py", line 178, in <module>
File "D:\tools\JetBrains\PyCharm 2025.2.4\plugins\python-ce\helpers\virtualenv-py3.pyz\__main__.py", line 174, in run
File "D:\tools\JetBrains\PyCharm 2025.2.4\plugins\python-ce\helpers\virtualenv-py3.pyz\virtualenv\__main__.py", line 20, in run
File "D:\tools\JetBrains\PyCharm 2025.2.4\plugins\python-ce\helpers\virtualenv-py3.pyz\virtualenv\run\__init__.py", line 33, in cli_run
File "D:\tools\JetBrains\PyCharm 2025.2.4\plugins\python-ce\helpers\virtualenv-py3.pyz\virtualenv\run\session.py", line 46, in run
File "D:\tools\JetBrains\PyCharm 2025.2.4\plugins\python-ce\helpers\virtualenv-py3.pyz\virtualenv\run\session.py", line 53, in _create
File "D:\tools\JetBrains\PyCharm 2025.2.4\plugins\python-ce\helpers\virtualenv-py3.pyz\virtualenv\create\creator.py", line 160, in run
File "D:\tools\JetBrains\PyCharm 2025.2.4\plugins\python-ce\helpers\virtualenv-py3.pyz\virtualenv\create\via_global_ref\builtin\via_global_self_do.py", line 99, in create
File "D:\tools\JetBrains\PyCharm 2025.2.4\plugins\python-ce\helpers\virtualenv-py3.pyz\virtualenv\create\via_global_ref\api.py", line 87, in create
File "D:\tools\JetBrains\PyCharm 2025.2.4\plugins\python-ce\helpers\virtualenv-py3.pyz\virtualenv\create\via_global_ref\api.py", line 90, in install_patch
File "D:\tools\JetBrains\PyCharm 2025.2.4\plugins\python-ce\helpers\virtualenv-py3.pyz\virtualenv\create\via_global_ref\api.py", line 102, in env_patch_text
File "D:\tools\Python\Python311\Lib\pathlib.py", line 1059, in read_text
return f.read()
^^^^^^^^
File "<frozen codecs>", line 322, in decode
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x88 in position 0: invalid start byte
Process finished with exit code 1
It looks like a character set issue, I set editor | file encoding utf-8, It's still the same mistake。
but I use VSCode IDE create virtualenv is normal!
请先登录再写评论。
How are you creating the environment, selecting virtualenv right? Did you try using a different base interpreter version? Like 3.12? Looks like its PyCharm is using its bundled
virtualenv-py3.pyzbut on latest Python versions the built-invenvmodule should be used instead.Also, have you tried to reinstall PyCharm? In case the issue persists, please provide the IDE logs file from Help | Collect Logs and Diagnostic Data
You can upload to https://uploads.jetbrains.com/ and share it's uploadID here