简体   繁体   English

如何从代码python3.7.1安装模块

[英]How to install module from code python3.7.1

I am trying to install modules with python我正在尝试使用 python 安装模块

This is what I have tried:这是我试过的:

def install(package):
    os.system("python  -m pip install " + package)
install("winsound")

But I got an error:但是我得到一个错误:

ERROR: Could not find a version that satisfies the requirement winsound(from versions: none)

turns out the error was caused by some of the modules coming with python. 事实证明错误是由python附带的一些模块引起的。 (i swear winsound didnt come but whatever) (我发誓winound没有来,但无论如何)

The error is raised as you are trying to install modules from Standard Python Library.当您尝试从标准 Python 库安装模块时会出现错误。

You can read more about them from here: https://docs.python.org/3/library/您可以从这里阅读更多关于它们的信息: https://docs.python.org/3/library/

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

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