I recently installed armbian focal to a tinker board, and was attempting to install the discord python package. It's running a pre installed python 3.8.5 version, but I've only seen errors with installing the discord package when the python version is 3.9. I've also successfully installed the discord package on windows python 3.8.7, which means there is some difference I'm not aware of between windows python 3.8 and linux python 3.8, or I'm just missing some package to help me install discord.py, possibly because it was preinstalled (lightweight).
I can see that the program "Could not build wheels for multidict or yarl" but I'm not sure how to go about fixing the problem. I have searched for various versions of this question, but I only found people using python 3.9 which is a known error.
Here is the full output from the attempted install, the error makes up most of it. Has anyone else run into the same problem? I'd love some guidance on how to successfully install discord.py.
Collecting discord
Using cached discord-1.0.1-py3-none-any.whl (1.1 kB)
Collecting discord.py>=1.0.1
Using cached discord.py-1.5.1-py3-none-any.whl (701 kB)
Processing /root/.cache/pip/wheels/2d/6d/bb/486f8c893f1dcc917860a5b3e2f2ca286c398f7d548ffc649c/aiohttp-3.6.3-py3-none-any.whl
Requirement already satisfied: chardet<4.0,>=2.0 in /usr/lib/python3/dist-packages (from aiohttp<3.7.0,>=3.6.0->discord.py>=1.0.1->discord) (3.0.4)
Collecting multidict<5.0,>=4.5
Using cached multidict-4.7.6.tar.gz (50 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... done
Collecting yarl<1.6.0,>=1.0
Using cached yarl-1.5.1.tar.gz (173 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... done
Collecting async-timeout<4.0,>=3.0
Using cached async_timeout-3.0.1-py3-none-any.whl (8.2 kB)
Collecting attrs>=17.3.0
Using cached attrs-20.3.0-py2.py3-none-any.whl (49 kB)
Requirement already satisfied: idna>=2.0 in /usr/lib/python3/dist-packages (from yarl<1.6.0,>=1.0->aiohttp<3.7.0,>=3.6.0->discord.py>=1.0.1->discord) (2.8)
Building wheels for collected packages: multidict, yarl
Building wheel for multidict (PEP 517) ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 /tmp/tmpkkp4jqll build_wheel /tmp/tmpfgkdfx0m
cwd: /tmp/pip-install-j7e2t_uk/multidict
Complete output (47 lines):
**********************
* Accellerated build *
**********************
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-armv7l-3.8
creating build/lib.linux-armv7l-3.8/multidict
copying multidict/_multidict_py.py -> build/lib.linux-armv7l-3.8/multidict
copying multidict/_multidict_base.py -> build/lib.linux-armv7l-3.8/multidict
copying multidict/_compat.py -> build/lib.linux-armv7l-3.8/multidict
copying multidict/_abc.py -> build/lib.linux-armv7l-3.8/multidict
copying multidict/__init__.py -> build/lib.linux-armv7l-3.8/multidict
running egg_info
writing multidict.egg-info/PKG-INFO
writing dependency_links to multidict.egg-info/dependency_links.txt
writing top-level names to multidict.egg-info/top_level.txt
reading manifest file 'multidict.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files found matching 'multidict/_multidict.html'
warning: no previously-included files found matching 'multidict/*.so'
warning: no previously-included files found matching 'multidict/*.pyd'
warning: no previously-included files found matching 'multidict/*.pyd'
no previously-included directories found matching 'docs/_build'
writing manifest file 'multidict.egg-info/SOURCES.txt'
copying multidict/__init__.pyi -> build/lib.linux-armv7l-3.8/multidict
copying multidict/_multidict.c -> build/lib.linux-armv7l-3.8/multidict
copying multidict/py.typed -> build/lib.linux-armv7l-3.8/multidict
creating build/lib.linux-armv7l-3.8/multidict/_multilib
copying multidict/_multilib/defs.h -> build/lib.linux-armv7l-3.8/multidict/_multilib
copying multidict/_multilib/dict.h -> build/lib.linux-armv7l-3.8/multidict/_multilib
copying multidict/_multilib/istr.h -> build/lib.linux-armv7l-3.8/multidict/_multilib
copying multidict/_multilib/iter.h -> build/lib.linux-armv7l-3.8/multidict/_multilib
copying multidict/_multilib/pair_list.h -> build/lib.linux-armv7l-3.8/multidict/_multilib
copying multidict/_multilib/views.h -> build/lib.linux-armv7l-3.8/multidict/_multilib
running build_ext
building 'multidict._multidict' extension
creating build/temp.linux-armv7l-3.8
creating build/temp.linux-armv7l-3.8/multidict
arm-linux-gnueabihf-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.8 -c multidict/_multidict.c -o build/temp.linux-armv7l-3.8/multidict/_multidict.o -O2 -std=c99 -Wall -Wsign-compare -Wconversion -fno-strict-aliasing -pedantic
multidict/_multidict.c:1:10: fatal error: Python.h: No such file or directory
1 | #include "Python.h"
| ^~~~~~~~~~
compilation terminated.
error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for multidict
Building wheel for yarl (PEP 517) ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 /tmp/tmps5xafkze build_wheel /tmp/tmp_pdfqzao
cwd: /tmp/pip-install-j7e2t_uk/yarl
Complete output (42 lines):
**********************
* Accellerated build *
**********************
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-armv7l-3.8
creating build/lib.linux-armv7l-3.8/yarl
copying yarl/_url.py -> build/lib.linux-armv7l-3.8/yarl
copying yarl/_quoting_py.py -> build/lib.linux-armv7l-3.8/yarl
copying yarl/_quoting.py -> build/lib.linux-armv7l-3.8/yarl
copying yarl/__init__.py -> build/lib.linux-armv7l-3.8/yarl
running egg_info
writing yarl.egg-info/PKG-INFO
writing dependency_links to yarl.egg-info/dependency_links.txt
writing requirements to yarl.egg-info/requires.txt
writing top-level names to yarl.egg-info/top_level.txt
reading manifest file 'yarl.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.cache' found anywhere in distribution
warning: no previously-included files found matching 'yarl/*.html'
warning: no previously-included files found matching 'yarl/*.so'
warning: no previously-included files found matching 'yarl/*.pyd'
no previously-included directories found matching 'docs/_build'
writing manifest file 'yarl.egg-info/SOURCES.txt'
copying yarl/__init__.pyi -> build/lib.linux-armv7l-3.8/yarl
copying yarl/_quoting_c.c -> build/lib.linux-armv7l-3.8/yarl
copying yarl/_quoting_c.pyi -> build/lib.linux-armv7l-3.8/yarl
copying yarl/_quoting_c.pyx -> build/lib.linux-armv7l-3.8/yarl
copying yarl/py.typed -> build/lib.linux-armv7l-3.8/yarl
running build_ext
building 'yarl._quoting_c' extension
creating build/temp.linux-armv7l-3.8
creating build/temp.linux-armv7l-3.8/yarl
arm-linux-gnueabihf-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.8 -c yarl/_quoting_c.c -o build/temp.linux-armv7l-3.8/yarl/_quoting_c.o
yarl/_quoting_c.c:4:10: fatal error: Python.h: No such file or directory
4 | #include "Python.h"
| ^~~~~~~~~~
compilation terminated.
error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for yarl
Failed to build multidict yarl
ERROR: Could not build wheels for multidict, yarl which use PEP 517 and cannot be installed directly```
Turns out I was missing the python3-dev
package, which was not included in armbian's preinstalled python.
To install the python3-dev
package, simply run:
sudo apt install python3-dev
Thanks to @CoderCharmander!