Python 3.5 Pyperclip 模块导入失败

标签 python python-3.x pyperclip

刚开始学习Python。我在使用 Pyperclip 模块时遇到了问题。

当我尝试在命令行中使用 pip install pyperclip 时,它显示了这个错误:

pip install pyperclip
          ^
SyntaxError: invalid syntax

我在 Windows 7 桌面上运行 Python 3.5(32 位)。

最佳答案

open command prompt type: pip install pyperclip

如果这不起作用,那么就使用这个 cd Python35/Scripts 进入脚本文件夹 这是pip所在的文件夹。

Now type: pip install pyperclip

这将下载并安装 pyperclip

now type: pip freeze

应该列出 pyperclip

如果你想在 python shell 中进行测试,请记住关闭 shell(如果打开)并打开一个新的,因为它需要加载新的包。

type in python shell: import pyperclip

它应该接受它,现在你可以使用 pyperclip.copy() 和 pyperclip.paste()

祝你好运!

关于Python 3.5 Pyperclip 模块导入失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33469015/

相关文章:

python - 相机捕获蓝色时如何打印文本?

Python 3 逻辑 not 将 True 返回为 True

python-3.x - 如何让 Visual Studio Code 与安装在 WSL 上的 python 一起工作

python - 在 tkinter 脚本中使用 pyperclip 保存到剪贴板时进行编码

python - Pandas 条形图 : Add marker to distinguish 0 and NaN

python - 如何编写恢复 cwd 的装饰器?

python - 如何优化这些嵌套循环?

python-3.x - 无法构建 pyarrow(对于 python 3.7),错误消息为 ERROR : Could not build wheels for pyarrow which use PEP 517

python - 如果脚本退出,Pyperclip 不会持续存在

python - Python IDLE似乎无法在python 36中导入Pyperclip?