jessedp/pihole5-list-tool

Error while installing on DietPi

ViperTK opened this issue · 3 comments

Forms suck. But they can help a ton. Going free-form below is okay if you're certain you're providing all of the relevant information (or things aren't applicable)

Environment

Describe the system on which this issue occurred:

pihole5-list-tool 0.6.0

OS DietPi 8.3

Python 3.7.3 or 2.7.18 both same issue with pip or pip3

Using Docker? N

Issue Details

Get errors while trying to install the tool. Please see the logs below.

============================================

root@DietPi:~ sudo pip install pihole5-list-tool --upgrade
Collecting pihole5-list-tool
Using cached https://files.pythonhosted.org/packages/e0/4a/3e554deccec452a3eaa76d28f8612ec88d2c99a08f40a2b014ffbae74de0/pihole5_list_tool-0.6.0-py2.py3-none-any.whl
Collecting terminaltables (from pihole5-list-tool)
Using cached https://files.pythonhosted.org/packages/c4/fb/ea621e0a19733e01fe4005d46087d383693c0f4a8f824b47d8d4122c87e0/terminaltables-3.1.10-py2.py3-none-any.whl
Requirement already satisfied, skipping upgrade: ansicolors in /usr/local/lib/python3.7/dist-packages (from pihole5-list-tool) (1.1.8)
Collecting requests (from pihole5-list-tool)
Using cached https://files.pythonhosted.org/packages/2d/61/08076519c80041bc0ffa1a8af0cbd3bf3e2b62af10435d269a9d0f40564d/requests-2.27.1-py2.py3-none-any.whl
Collecting PyInquirer (from pihole5-list-tool)
Using cached https://files.pythonhosted.org/packages/fb/4c/434b7c454010a284b49d6f1d446fe8dc5960415613d8c0225b9e2efb6724/PyInquirer-1.0.3.tar.gz
Collecting charset-normalizer~=2.0.0; python_version >= "3" (from requests->pihole5-list-tool)
Using cached https://files.pythonhosted.org/packages/06/b3/24afc8868eba069a7f03650ac750a778862dc34941a4bebeb58706715726/charset_normalizer-2.0.12-py3-none-any.whl
Collecting certifi>=2017.4.17 (from requests->pihole5-list-tool)
Using cached https://files.pythonhosted.org/packages/37/45/946c02767aabb873146011e665728b680884cd8fe70dde973c640e45b775/certifi-2021.10.8-py2.py3-none-any.whl
Collecting urllib3<1.27,>=1.21.1 (from requests->pihole5-list-tool)
Using cached https://files.pythonhosted.org/packages/ec/03/062e6444ce4baf1eac17a6a0ebfe36bb1ad05e1df0e20b110de59c278498/urllib3-1.26.9-py2.py3-none-any.whl
Collecting idna<4,>=2.5; python_version >= "3" (from requests->pihole5-list-tool)
Using cached https://files.pythonhosted.org/packages/04/a2/d918dcd22354d8958fe113e1a3630137e0fc8b44859ade3063982eacd2a4/idna-3.3-py3-none-any.whl
Requirement already satisfied, skipping upgrade: prompt_toolkit==1.0.14 in /usr/local/lib/python3.7/dist-packages (from PyInquirer->pihole5-list-tool) (1.0.14)
Requirement already satisfied, skipping upgrade: Pygments>=2.2.0 in /usr/local/lib/python3.7/dist-packages (from PyInquirer->pihole5-list-tool) (2.12.0)
Collecting regex>=2016.11.21 (from PyInquirer->pihole5-list-tool)
Using cached https://files.pythonhosted.org/packages/b6/d9/b6971b194833ee2eccf4591f9097833b65e669cce0f8fc0ff2a118238f63/regex-2022.4.24.tar.gz
Requirement already satisfied, skipping upgrade: wcwidth in /usr/local/lib/python3.7/dist-packages (from prompt_toolkit==1.0.14->PyInquirer->pihole5-list-tool) (0.2.5)
Requirement already satisfied, skipping upgrade: six>=1.9.0 in /usr/local/lib/python3.7/dist-packages (from prompt_toolkit==1.0.14->PyInquirer->pihole5-list-tool) (1.16.0)
Building wheels for collected packages: PyInquirer, regex
Running setup.py bdist_wheel for PyInquirer ... error
Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-install-sp65idtw/PyInquirer/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" bdist_wheel -d /tmp/pip-wheel-6usmq1zj --python-tag cp37:
/usr/local/lib/python3.7/dist-packages/setuptools/dist.py:760: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead
% (opt, underscore_opt)
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: -c --help [cmd1 cmd2 ...]
or: -c --help-commands
or: -c cmd --help

error: invalid command 'bdist_wheel'


Failed building wheel for PyInquirer
Running setup.py clean for PyInquirer
Running setup.py bdist_wheel for regex ... error
Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-install-sp65idtw/regex/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" bdist_wheel -d /tmp/pip-wheel-bg9azt6_ --python-tag cp37:
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: -c --help [cmd1 cmd2 ...]
or: -c --help-commands
or: -c cmd --help

error: invalid command 'bdist_wheel'


Failed building wheel for regex
Running setup.py clean for regex
Failed to build PyInquirer regex
Installing collected packages: terminaltables, charset-normalizer, certifi, urllib3, idna, requests, regex, PyInquirer, pihole5-list-tool
Running setup.py install for regex ... error
Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-install-sp65idtw/regex/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-record-y9am9g5r/install-record.txt --single-version-externally-managed --compile:
running install
/usr/local/lib/python3.7/dist-packages/setuptools/command/install.py:37: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
setuptools.SetuptoolsDeprecationWarning,
running build
running build_py
creating build
creating build/lib.linux-aarch64-cpython-37
creating build/lib.linux-aarch64-cpython-37/regex
copying regex_3/init.py -> build/lib.linux-aarch64-cpython-37/regex
copying regex_3/regex.py -> build/lib.linux-aarch64-cpython-37/regex
copying regex_3/_regex_core.py -> build/lib.linux-aarch64-cpython-37/regex
copying regex_3/test_regex.py -> build/lib.linux-aarch64-cpython-37/regex
running build_ext
building 'regex._regex' extension
creating build/temp.linux-aarch64-cpython-37
creating build/temp.linux-aarch64-cpython-37/regex_3
aarch64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python3.7m -c regex_3/_regex.c -o build/temp.linux-aarch64-cpython-37/regex_3/_regex.o
regex_3/_regex.c:50:10: fatal error: Python.h: No such file or directory
#include "Python.h"
^~~~~~~~~~
compilation terminated.
error: command '/usr/bin/aarch64-linux-gnu-gcc' failed with exit code 1

----------------------------------------

Command "/usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-install-sp65idtw/regex/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-record-y9am9g5r/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-sp65idtw/regex/

error: invalid command 'bdist_wheel' makes it look like the wheel python package is not installed, I suppose DietPi may not include it by default.

Can you try pip3 install wheel and then install this again?

(among others, this agrees https://stackoverflow.com/questions/65273035/how-to-fix-error-invalid-command-bdist-wheel )

cool & thanks for the quick response. so installing wheel separately seemed to have fixed the error partly but seems regex install is still failing. I tried pip3 install regex separately as well, and it still failed with same error. any thoughts?

root@DietPi:# sudo pip3 install pihole5-list-tool --upgrade
Collecting pihole5-list-tool
Using cached https://files.pythonhosted.org/packages/e0/4a/3e554deccec452a3eaa76d28f8612ec88d2c99a08f40a2b014ffbae74de0/pihole5_list_tool-0.6.0-py2.py3-none-any.whl
Collecting PyInquirer (from pihole5-list-tool)
Requirement already satisfied, skipping upgrade: terminaltables in /usr/local/lib/python3.7/dist-packages (from pihole5-list-tool) (3.1.10)
Requirement already satisfied, skipping upgrade: requests in /usr/local/lib/python3.7/dist-packages (from pihole5-list-tool) (2.27.1)
Requirement already satisfied, skipping upgrade: ansicolors in /usr/local/lib/python3.7/dist-packages (from pihole5-list-tool) (1.1.8)
Collecting regex>=2016.11.21 (from PyInquirer->pihole5-list-tool)
Using cached https://files.pythonhosted.org/packages/b6/d9/b6971b194833ee2eccf4591f9097833b65e669cce0f8fc0ff2a118238f63/regex-2022.4.24.tar.gz
Requirement already satisfied, skipping upgrade: prompt-toolkit==1.0.14 in /usr/local/lib/python3.7/dist-packages (from PyInquirer->pihole5-list-tool) (1.0.14)
Requirement already satisfied, skipping upgrade: Pygments>=2.2.0 in /usr/local/lib/python3.7/dist-packages (from PyInquirer->pihole5-list-tool) (2.12.0)
Requirement already satisfied, skipping upgrade: charset-normalizer
=2.0.0; python_version >= "3" in /usr/local/lib/python3.7/dist-packages (from requests->pihole5-list-tool) (2.0.12)
Requirement already satisfied, skipping upgrade: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.7/dist-packages (from requests->pihole5-list-tool) (1.26.9)
Requirement already satisfied, skipping upgrade: idna<4,>=2.5; python_version >= "3" in /usr/local/lib/python3.7/dist-packages (from requests->pihole5-list-tool) (3.3)
Requirement already satisfied, skipping upgrade: certifi>=2017.4.17 in /usr/local/lib/python3.7/dist-packages (from requests->pihole5-list-tool) (2021.10.8)
Requirement already satisfied, skipping upgrade: wcwidth in /usr/local/lib/python3.7/dist-packages (from prompt-toolkit==1.0.14->PyInquirer->pihole5-list-tool) (0.2.5)
Requirement already satisfied, skipping upgrade: six>=1.9.0 in /usr/local/lib/python3.7/dist-packages (from prompt-toolkit==1.0.14->PyInquirer->pihole5-list-tool) (1.16.0)
Building wheels for collected packages: regex
Running setup.py bdist_wheel for regex ... error
Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-install-04nadgff/regex/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" bdist_wheel -d /tmp/pip-wheel-0hrteq3p --python-tag cp37:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-aarch64-cpython-37
creating build/lib.linux-aarch64-cpython-37/regex
copying regex_3/init.py -> build/lib.linux-aarch64-cpython-37/regex
copying regex_3/regex.py -> build/lib.linux-aarch64-cpython-37/regex
copying regex_3/_regex_core.py -> build/lib.linux-aarch64-cpython-37/regex
copying regex_3/test_regex.py -> build/lib.linux-aarch64-cpython-37/regex
running build_ext
building 'regex._regex' extension
creating build/temp.linux-aarch64-cpython-37
creating build/temp.linux-aarch64-cpython-37/regex_3
aarch64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python3.7m -c regex_3/_regex.c -o build/temp.linux-aarch64-cpython-37/regex_3/_regex.o
regex_3/_regex.c:50:10: fatal error: Python.h: No such file or directory
#include "Python.h"
^~~~~~~~~~
compilation terminated.
error: command '/usr/bin/aarch64-linux-gnu-gcc' failed with exit code 1


Failed building wheel for regex
Running setup.py clean for regex
Failed to build regex
Installing collected packages: regex, PyInquirer, pihole5-list-tool
Running setup.py install for regex ... error
Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-install-04nadgff/regex/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-record-0hdxf_mr/install-record.txt --single-version-externally-managed --compile:
running install
/usr/local/lib/python3.7/dist-packages/setuptools/command/install.py:37: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
setuptools.SetuptoolsDeprecationWarning,
running build
running build_py
creating build
creating build/lib.linux-aarch64-cpython-37
creating build/lib.linux-aarch64-cpython-37/regex
copying regex_3/init.py -> build/lib.linux-aarch64-cpython-37/regex
copying regex_3/regex.py -> build/lib.linux-aarch64-cpython-37/regex
copying regex_3/_regex_core.py -> build/lib.linux-aarch64-cpython-37/regex
copying regex_3/test_regex.py -> build/lib.linux-aarch64-cpython-37/regex
running build_ext
building 'regex._regex' extension
creating build/temp.linux-aarch64-cpython-37
creating build/temp.linux-aarch64-cpython-37/regex_3
aarch64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python3.7m -c regex_3/_regex.c -o build/temp.linux-aarch64-cpython-37/regex_3/_regex.o
regex_3/_regex.c:50:10: fatal error: Python.h: No such file or directory
#include "Python.h"
^~~~~~~~~~
compilation terminated.
error: command '/usr/bin/aarch64-linux-gnu-gcc' failed with exit code 1

----------------------------------------

Command "/usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-install-04nadgff/regex/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-record-0hdxf_mr/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-04nadgff/regex/

Just an update: I followed the steps here and that may have fixed the issue.

https://stackoverflow.com/questions/53744668/failed-building-wheel-for-regex-while-installing-pip-package
specifically just this command - sudo apt-get install python3 python3-pip ipython3 build-essential python-dev python3-dev