简体   繁体   English

无法导入pyperclip模块

[英]Unable to import pyperclip module

I used pip3 install pyperclip and it successfully installed pyperclip: 我使用pip3 install pyperclip并成功安装pyperclip:

user@user:~$ pip3 install pyperclip
Collecting pyperclip
Installing collected packages: pyperclip
Successfully installed pyperclip-1.6.2

When I tried to import pyperclip in python3 it showed: 当我尝试在python3中导入pyperclip时显示:

user@user:~$ python3 Python 3.7.0 (default, Jul 11 2018, 02:16:41) 
[GCC 7.3.0] on linux Type "help", "copyright", "credits" or "license"
for more information.
>>> import pyperclip Traceback (most recent call last):   File "<stdin>", line 1, in <module> ModuleNotFoundError: No module named
'pyperclip'
>>>

I also checked in pip3 list and saw pyperclip listed there. 我还检查了pip3列表,并在那里看到了pyperclip。 I'm on Ubuntu 18.04 我在Ubuntu 18.04上

Try closing and reopening in a new shell if you did not already. 如果尚未关闭,请尝试在新的外壳中关闭并重新打开。 Do you have more than one python installation? 您是否安装了多个python? It's possible it installed for a version separate than the one you're running the import on. 可能安装的版本与运行导入的版本不同。 If that's the case, then be sure your PATH variable lists ONLY the Python version you're interested in from the command line. 如果是这种情况,请确保您的PATH变量仅从命令行列出您感兴趣的Python版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM