PythonTwitch 1.2入门

2024-10-01 07:13:43 发布

您现在位置:Python中文网/ 问答频道 /正文

我用Python编程已经有几个月了,但是我在为twitchapi设计Python Twitch库时遇到了困难。我已经安装了1.2版,它给出了如下说明:http://ingwinlu.github.io/python-twitch/quickstart.html#dependencies

不过,我对做这种事完全没有经验。即使只是用他们的例子

from twitch.api import v3

返回“没有名为twitch的模块”错误。。在

我从哪里开始呢?很抱歉,我的知识不足。在


Tags: fromiogithubapihttphtml编程dependencies
1条回答
网友
1楼 · 发布于 2024-10-01 07:13:43

如果调用from twitch.api import v3返回以下错误:

no module named twitch

那么您没有正确安装python twitch模块。在


首先确保您有最新版本的Python,比如来自https://www.python.org/downloads/的3.5.1

然后使用建议的选项(包括PIP)安装它(如果尚未安装)

然后转到Python\Scripts目录,例如:

C:\Users\me\AppData\Local\Programs\Python\Python35-32\Scripts>

然后运行以下命令:

pip install python-twitch

现在你应该看到这样的画面:

Collecting python-twitch
   Downloading python-twitch-1.2.0.tar.gz
Collecting six>=1.9.0 (from python-twitch)
   Downloading six-1.10.0-py2.py3-none-any.whl
Installing collected packages: six, python-twitch
   Running setup.py install for python-twitch
Successfully installed python-twitch-1.2.0 six-1.10.0\

现在重新运行测试python文件:

^{pr2}$

相关问题 更多 >