简体   繁体   English

无法使用 Win+R 命令运行包含第三方模块的 python 脚本

[英]Not being able to run my python scripts that contain third-party modules using Win+R command

I am trying to run my code using Win+R .我正在尝试使用Win+R运行我的代码。 I am able to run a python script without using third-party modules.我能够在不使用第三方模块的情况下运行 python 脚本。 But when I use some third-party module in my code it shows this error:但是当我在我的代码中使用一些第三方模块时,它会显示这个错误:

Traceback (most recent call last):
File "C:\Users\pkgar\Desktop\Newfolder\pw.py", line 6, in <module>
    import sys,pyperclip
ModuleNotFoundError: No module named 'pyperclip'

Edit: I am able to run the code in VS code, but I am just curious how to run the code using Win+R command.It is running perfectly using Win+R command when I don't use pyperclip module at all.编辑:我能够在 VS 代码中运行代码,但我只是好奇如何使用 Win+R 命令运行代码。当我根本不使用 pyperclip 模块时,它使用 Win+R 命令运行完美。

you haven't installed pyperclip yet.你还没有安装 pyperclip。

you can install it using pip install pyperclip on your cmd.您可以使用pip install pyperclip在您的 cmd 上安装它。

check this out看一下这个

https://pypi.org/project/pyperclip/ https://pypi.org/project/pyperclip/

and olso if pip itself hasn't installed yet use如果 pip 本身尚未安装,则还可以使用

https://pip.pypa.io/en/stable/installing/ https://pip.pypa.io/en/stable/installing/

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

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