python - Python PIP 安装 v3.8
问题描述
嗨,我从 Python.org 下载了最新的 python 3.8,并试图继续阅读“Al Sweigart 于 2015 年出版的用 Python 自动化无聊的东西”,它似乎使用 3.4.0。到目前为止,所有示例都使用 IDLE,而不是使用不同的解释器。我现在需要导入模块 pyperclip 以便继续阅读这些章节。但是,安装 PiP 和 3rd 方模块的说明似乎不起作用。当我从 Windows 命令提示符运行 python 时,它说
C:\Users\brentond>python
'python' is not recognized as an internal or external command,
operable program or batch file.
这有效
C:\Users\brentond>py
Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:21:23) [MSC v.1916 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
书的附录 A 说 pip.exe 应该保存在程序 C:\Users\brentond\AppData\Local\Programs\Python\Python38-32 的地方。但这对我来说不是这样。
C:\Users\brentond>pip install pyperclip
'pip' is not recognized as an internal or external command,
operable program or batch file.
>>> C:\Users\brentond>py -m pip install pyperclip
File "<stdin>", line 1
C:\Users\brentond>py -m pip install pyperclip
^
SyntaxError: unexpected character after line continuation character
>>>
请帮忙?
解决方案
三个尖括号表示您在 Python shell 中。py -m install pyperclip
需要从普通命令行执行。退出 Python shell(带有quit()
),然后执行C:\Users\brentond>py -m pip install pyperclip
.
推荐阅读
- javascript - TabNavigation 中的标题标题为空
- mongodb - MongoDB Group By '$group' 问题在日期的聚合函数中获取记录我们在表 DB 中有日期时间格式
- winforms - Groupbox子控件限制?
- excel - Excel:具有多个(日期)条件和 If 语句的聚合公式
- javascript - 将包含 html 的对象作为属性传递给 jsx 元素
- java - 无法在 Android SDK 中使用 CET 解析字符串
- python - 将 postgresql 查询的结果返回到 html 页面
- eclipse - 如何从命令行打开特定的 Eclipse 向导或对话框?
- node.js - 我想将 DialogFlow 连接到 Google SpreadSheet
- javascript - JS 如何创建一个计算标签数量的函数