Can't import Pyperclip

亡梦爱人 提交于 2020-02-02 06:19:20

问题


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:

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

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


回答1:


Try

pip3 install pyperclip

That installs pyperclip in python3.




回答2:


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.



来源:https://stackoverflow.com/questions/38111340/cant-import-pyperclip

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!