所以我正在尝试为discord安装discord API包装器,我不确定它是否在错误的路径或什么。我试图导入不和谐的一切都给出了上面的错误。
我如何验证pip已安装,然后安装了discord:
moro@Falco123:~$ sudo apt-get install python3-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-pip is already the newest version (9.0.1-2).
0 upgraded, 0 newly installed, 0 to remove and 222 not upgraded.
moro@Falco123:~$ pip3 install -U discord.py
Collecting discord.py
Collecting aiohttp<1.1.0,>=1.0.0 (from discord.py)
Using cached aiohttp-1.0.5-cp35-cp35m-manylinux1_x86_64.whl
Collecting websockets<4.0,>=3.1 (from discord.py)
Using cached websockets-3.3-py33.py34.py35.py36-none-any.whl
Collecting chardet (from aiohttp<1.1.0,>=1.0.0->discord.py)
Using cached chardet-3.0.4-py2.py3-none-any.whl
Collecting async-timeout (from aiohttp<1.1.0,>=1.0.0->discord.py)
Using cached async_timeout-1.2.1-py3-none-any.whl
Collecting multidict>=2.0 (from aiohttp<1.1.0,>=1.0.0->discord.py)
Using cached multidict-3.1.3-cp35-cp35m-manylinux1_x86_64.whl
Installing collected packages: chardet, async-timeout, multidict, aiohttp,
websockets, discord.py
Successfully installed aiohttp-1.0.5 async-timeout-1.2.1 chardet-3.0.4
discord.py-0.16.8 multidict-3.1.3 websockets-3.3
moro@Falco123:~$ python3.6
Python 3.6.2 (default, Aug 16 2017, 16:00:27)
[GCC 6.3.0 20170406] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import discord
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'discord'
>>> exit()
我也在官方的python文档页面上尝试了这个方法,但没有:
moro@Falco123:~$ python3 -m pip install -U discord.py
/usr/local/bin/python3: No module named pip
moro@Falco123:~$ sudo python3 -m pip install -U discord.py
[sudo] password for moro:
/usr/local/bin/python3: No module named pip
主要问题是我想安装discord模块以在我的python脚本中使用。我还检查了使用&#34; help(&#39; modules&#39;)&#34;是否在任何python3模块列表中的discord。在我安装的默认ubuntu python3.5和python 3.6中。它没有列出。随意请求其他命令或信息
编辑:
moro@Falco123:/usr/bin$ pip3 -V
pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.5)
moro@Falco123:/usr/bin$
编辑:
moro@Falco123:~$ python3.6 -m pip install discord.py
/usr/local/bin/python3.6: No module named pip
moro@Falco123:~$
编辑:
我通过从官方网站下载python 3.6.2来安装python,然后我解压缩,编译它,并使用以下命令安装它:
cd Downloads/
cd Python-3.6.2/
./configure
sudo make
sudo make install
编辑:当我编译python时,我没有使用SSL编译它。对于有此问题的未来人员,请参阅此处:https://github.com/Rapptz/discord.py/issues/331 此外,当他开始安装SSL时,大约在中途添加SSL:https://www.youtube.com/watch?v=X4nPFZCf-wM