python - 无法从 powershell 访问 python
问题描述
当我尝试从 Windows 机器上的 powershell 命令提示符访问已安装的 python 时,出现以下错误。
我从从门户下载的 .exe 文件安装了 python,并且在安装时我在启动时检查了环境变量设置选项。
python安装在我的系统上的“C:\Users\username\AppData\Local\Programs\Python\Python38-32”这个位置
任何人都可以帮助我哪里出错了。
错误:当我从系统文件夹中输入 python
PS C:\WINDOWS\system32> python
python : The term 'python' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ python
+ ~~~~~~
+ CategoryInfo : ObjectNotFound: (python:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
错误:当我从 python 安装位置键入 python 时
PS C:\Users\username\AppData\Local\Programs\Python\Python38-32> .\python
Python path configuration:
PYTHONHOME = (not set)
PYTHONPATH = (not set)
program name = 'C:\Users\username\AppData\Local\Programs\Python\Python38-32\python.exe'
isolated = 0
environment = 1
user site = 1
import site = 1
sys._base_executable = 'C:\\Users\\username\\AppData\\Local\\Programs\\Python\\Python38-32\\python.exe'
sys.base_prefix = ''
sys.base_exec_prefix = ''
sys.executable = 'C:\\Users\\username\\AppData\\Local\\Programs\\Python\\Python38-32\\python.exe'
sys.prefix = ''
sys.exec_prefix = ''
sys.path = [
'C:\\Users\\username\\AppData\\Local\\Programs\\Python\\Python38-32\\python38.zip',
'.\\DLLs',
'.\\lib',
'C:\\Users\\username\\AppData\\Local\\Programs\\Python\\Python38-32',
]
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 0x000034d8 (most recent call first):
<no Python frame>
解决方案
推荐阅读
- google-sheets - 谷歌表格公式如何通过列参考查找唯一数据
- flutter - 在 adobe XD 中安装“XD to flutter”插件时出错
- sql - oracle按列求和而不使用联合
- c# - Web API HttpDelete - 如何调用删除 API 方法并在 [FromBody] 中发送模型
- azure - 将项目添加到服务总线的 Azure API 管理策略 - 应返回错误
- flutter - Flutter 使用 map 将数据从列表类对象加载到 DropdownMenuItem
- swift - Swift 中是否有 Kotlin 等效的“对象”?
- amazon-web-services - 如何将弹性 ip 分配给现有的 AWS 应用程序负载均衡器?
- android - 如何从我的 webview 应用程序(如 Instagram 等)打开其他应用程序?
- node.js - 一个 API 调用 vs 多个