【发布时间】:2022-08-18 21:46:27
【问题描述】:
很奇怪的问题。虽然 python 和工作得很好,但我不能使用 pipenv。 我在 windows 上运行它,它在 windows 终端、powershell、vscode 终端上不起作用。 Python版本是3.10.5,系统PATH已经有了python.exe所在的文件夹位置。我也尝试添加 PYTHONPATH 和 PYTHONHOME 变量,但仍然没有工作。
我对此还是新手,我尝试了 pip uninstall pipenv、virtualenv,但是当我运行 pipenv 时,它仍然给我相同的错误消息,而不是“不被识别为命令”错误。
这是我运行 pipenv --version、pipenv shell、pipenv install 等时的错误消息:
Could not find platform independent libraries <prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Python path configuration:
PYTHONHOME = (not set)
PYTHONPATH = (not set)
program name = \'c:/program files/inkscape/bin/python.exe\'
isolated = 0
environment = 1
user site = 1
import site = 1
sys._base_executable = \'C:\\\\program files\\\\inkscape\\\\bin\\\\python.exe\'
sys.base_prefix = \'D:\\\\a\\\\_temp\\\\msys\\\\msys64\\\\mingw64\'
sys.base_exec_prefix = \'C:\\\\program files\\\\inkscape\'
sys.executable = \'C:\\\\program files\\\\inkscape\\\\bin\\\\python.exe\'
sys.prefix = \'D:\\\\a\\\\_temp\\\\msys\\\\msys64\\\\mingw64\'
sys.exec_prefix = \'C:\\\\program files\\\\inkscape\'
sys.path = [
\'D:\\\\a\\\\_temp\\\\msys\\\\msys64\\\\mingw64\\\\lib\\\\python38.zip\',
\'D:\\\\a\\\\_temp\\\\msys\\\\msys64\\\\mingw64\\\\lib\\\\python3.8\',
\'D:\\\\a\\\\_temp\\\\msys\\\\msys64\\\\mingw64\\\\lib\\\\python3.8\',
\'C:\\\\program files\\\\inkscape\\\\lib\\\\python3.8\\\\lib-dynload\',
]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named \'encodings\'
Current thread 0x00006e4c (most recent call first):
<no Python frame>
我认为inkscape是问题所在,所以我卸载了它,但它仍然无法正常工作。
请帮帮我,谢谢
标签: python windows libraries pipenv pythonpath