本文介绍了无法导入 Pyperclip的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 IDLE 中导入 Pyperclip 时遇到问题.
我正在运行 Windows 7(64 位).
我安装了 Python 3.5.2:C:\Python\Python35.
我打开命令提示符并在将目录更改为 C:\Python\Python35\Scripts 后键入 pip install pyperclip 启动安装.它成功安装了 Pyperclip-1.5.27.然后我去 IDLE 并输入 import pyperclip 但出现以下错误:

I am having trouble importing Pyperclip in IDLE.
I am running windows 7 (64-bit).
I have Python 3.5.2 Installed on: C:\Python\Python35.
I opened command prompt and initiated the install by typing pip install pyperclip after changing directory to C:\Python\Python35\Scripts.It successfully installed Pyperclip-1.5.27.I then went to IDLE and typed in import pyperclip but the following error is showing up:

回溯(最近一次调用最后一次):文件",第 1 行,在导入 pyperclip导入错误:没有名为pyperclip"的模块

Traceback (most recent call last): File "", line 1, in import pyperclipImportError: No module named 'pyperclip'

我试图通过在系统环境变量中将C:\Python\Python35"添加到Path"变量的末尾来解决这个问题.

I tried to fix this by adding "C:\Python\Python35" to the end of the "Path" variable, in the systems environmental variables.

推荐答案

它在错误的目录中解压了 pyperclip.我复制了整个 pyperclip 文件夹并将其放在 C:/python/python35 中,现在它可以正常工作了.对我来说似乎是一个菜鸟错误,但我花了很长时间才弄明白这一点.我希望这对未来的人有所帮助.

It unpacked pyperclip in the wrong directory. I copied the entire pyperclip folder and put it in C:/python/python35, now it works as it should. Seems like a noob mistake on my part, but it took me a long time to figure this out. I hope this helps someone in the future.

这篇关于无法导入 Pyperclip的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-05 09:22