确保正确设置了PYTHONHOME环境变量。
如果PYTHONHOME指向无效的位置或您要运行的其他Python安装,您将收到此错误。
试试这个:
C:\>set PYTHONHOME=C:\Python27C:\>python
用
setx PYTHONHOME C:\Python27
将其永久设置为后续命令提示符
快速解决方案:设置PYTHONHOME和PYTHONPATH并在PATH上包含PYTHONHOME
例如,如果您安装到c:\ Python27
set PYTHONHOME=c:\Python27
set PYTHONPATH=c:\Python27\Lib
set PATH=%PYTHONHOME%;%PATH%
Windows:
setPATH="path\to\Clarisse";%PATH%
setPYTHONPATH="path\to\Clarisse\python";%PYTHONPATH%
Linux:
export PATH="path/to/Clarisse/":$PATH
export PYTHONPATH="path/to/Clarisse/python":$PYTHONPATH
export LD_LIBRARY_PATH="path/to/Clarisse":"path/to/Clarisse/python":$LD_LIBRARY_PATH
macOS:
export PATH="path/to/Clarisse/":$PATH
export PYTHONPATH="path/to/Clarisse/python":$PYTHONPATH
export DYLD_LIBRARY_PATH="path/to/Clarisse":"path/to/Clarisse/python":$DYLD_LIBRARY_PATH
网友评论