$ python text.py
Python path configuration:
PYTHONHOME = (not set)
PYTHONPATH = (not set)
program name = 'C:\Program Files\Python38\python.exe'
isolated = 0
environment = 1
user site = 1
import site = 1
sys._base_executable = 'C:\\Program Files\\Python38\\python.exe
sys.base_prefix = 'C:\\Program Files\\Python38
sys.base_exec_prefix = 'C:\\Program Files\\Python38
sys.executable = 'C:\\Program Files\\Python38\\python.exe
sys.prefix = 'C:\\Program Files\\Python38
sys.exec_prefix = 'C:\\Program Files\\Python38
sys.path = [
'C:\\Program Files\\Python38\\python38.zip',
'C:\\Program Files\\Python38\\DLLs',
'C:\\Program Files\\Python38\\lib',
'C:\\Program Files\\Python38',
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
LookupError: no codec search functions registered: can't find anything
Current thread 0x0000c158 (most recent call first):
<no Python frame>我现在又开始学习python了。目前我使用的是超级终端。由于某种原因,当我执行诸如"python (pythonFile.py)“之类的命令时,它会显示上面所示的错误。我去年做了python,因为学校的原因而停了下来。我的笔记本电脑里还有python文件。
发布于 2021-01-15 09:33:56
修复了运行python文件和使用pip的问题。使用py {yourPythonFile.py}而不是python (https://docs.python.org/3/faq/windows.html#how-do-i-run-a-python-program-under-windows)来运行文件。至于使用pip,我可以安装它但不能导入它。将pythonpath路径更改为包含pip文件夹的文件夹(https://stackoverflow.com/a/56861629/10176299)确保也检查pip文档(https://pip.pypa.io/en/stable/installing/)显示从安装到显示pip文件夹所在位置的所有内容。
{
"python.pythonPath": "C:\\Users\\hal19\\AppData\\Local\\Programs\\Python\\Python39\\Lib\\site-packages",
}
https://stackoverflow.com/questions/65728526
复制相似问题