简体   繁体   English

我如何使用已安装的 python 模块

[英]How do i use installed python modules

I installed a module package (playsound) and I've been stuck trying to use it, I have tried opening the package from cmd but nothing worked, I dont know how to use this package, please help. I installed a module package (playsound) and I've been stuck trying to use it, I have tried opening the package from cmd but nothing worked, I dont know how to use this package, please help. edit: I have tried suggested awnsers but it didint work, here is a screenshot maybe im doing something wrong https://imgur.com/a/Zz5fR04编辑:我已经尝试过建议的遮阳篷,但它确实有效,这是一个截图,可能我做错了https://imgur.com/a/Zz5fR04

The pythonic way of downloading modules is through Pip下载模块的pythonic方式是通过Pip

Pip is already installed when you install Python. Pip 在安装 Python 时已经安装。

You can download playsound using this command in cmd:您可以在 cmd 中使用此命令下载playsound

pip install playsound

Now import the function from the module:现在从模块中导入 function:

from playsound import playsound

Then you can call the playfound function with this:然后你可以用这个调用playfound function:

playsound('/path/to/a/sound/file/you/want/to/play.mp3')

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

相关问题 如何让python识别安装在虚拟环境中的模块? - how do I get python to recognize modules installed in virtual environment? 如何获取本地安装的 Python 模块的列表? - How do I get a list of locally installed Python modules? 如何安装导入numpy、pandas等模块? 我想使用IDLE编辑/运行环境,安装了Python 3.10 - How do I install and import modules such as numpy and pandas? I want to use the IDLE editing/run environment, and I have Python 3.10 installed 如何使用python安装的模块(Dex工具) - How to use python installed modules (Dex tool) 我如何使用 brew 安装 Python 作为默认 Python? - How do I use brew installed Python as the default Python? 如何防止python解释器查看和导入未安装的模块; 不属于系统? - How do I prevent python interpreter to see and import modules that are not installed; do not belong to the system? 如何使用setuptools创建包含多个模块的python包? - How do I use setuptools to create a python package with multiple modules? 我如何实际使用 python-for-android 模块? - how do i actually use the python-for-android modules? 如何将xlib和OpenGL模块与python一起使用? - How do I use the xlib and OpenGL modules together with python? Python 模块的安装位置 - How where Python modules installed
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM