nanoPi NEO install, python3.5.2 and pip 20.0.02

What is the problem?
trying to install octoprint 1.4.0 to ubuntu 16.04 LTS
What did you already try to solve it?

I've installed python, virtualenv and pip and tried to follow the "Installing Manually" instructions at OctoPrint.org - Download & Setup OctoPrint

Using python2.7 it appears to fail when it gets to "setuptools" and given the ticking clock on python2 I'd rather use python3 anyway.

Used update-alternatives to change the default python to 3.5.2 and updated pip to 20.0.2 and pip install now fails to find the package at all: 'pip -p /usr/bin/python3 install octoprint' returns "ERROR: Could not find a version that satisfies the requirement octoprint (from versions: none) ERROR: No matching distribution found for octoprint" even though "pip search octoprint" returns a line "OctoPrint (1.4.0) - The snappy web interface for your 3D printer" I also tried 'pip install OctoPrint' with the same results.

I also downloaded the 1.4.0.zip file from github and extracted it to /oprint/oprint/OctoPrint-1.4.0. When I activate a virtualenv into the OctoPrint-1.4.0. If I cd into that dir and run 'pip install .' I get an error "Processing /oprint/oprint/OctoPrint-1.4.0 ERROR: Package 'OctoPrint' requires a different Python: 3.5.2 not in '>=2.7.9, !=3.0., !=3.1., !=3.2., !=3.3., !=3.4., !=3.5., <4'

3.5.2 is not included in 3.5*? My regex knowledge but be getting rusty.

Additional information about your setup (OctoPrint version, OctoPi version, printer, firmware, browser, operating system, ... as much data as possible)

NanoPi Neo quad-core ARM 1.2GHz with 512MB RAM and Ubuntu Core 16.04LTS. I won't be using a webcam and have seen mention of others using this for OctoPrint.

Any help for this newbie would be appreciated...

Python 3.5.2 is not supported. You need Python 3.6 or later.

Installing python3.6.10 made a difference.

'pip install octoprint' reported these along the way:
"ERROR: Failed building wheel for regex"
"ERROR: Failed building wheel for netifaces"
"ERROR: Failed building wheel for psutil"

and then later failed hard when it couldn't find regex:

Blockquote
ERROR: Command errored out with exit status 1:
command: /oprint/oprint/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-o_b50f5w/regex/setup.py'"'"'; file='"'"'/tmp/pip-install-o_b50f5w/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-108fdwlm/install-record.txt --single-version-externally-managed --compile --install-headers /oprint/oprint/include/site/python3.6/regex
cwd: /tmp/pip-install-o_b50f5w/regex/
Complete output (18 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-armv7l-3.6
creating build/lib.linux-armv7l-3.6/regex
copying regex_3/init.py -> build/lib.linux-armv7l-3.6/regex
copying regex_3/regex.py -> build/lib.linux-armv7l-3.6/regex
copying regex_3/_regex_core.py -> build/lib.linux-armv7l-3.6/regex
copying regex_3/test_regex.py -> build/lib.linux-armv7l-3.6/regex
running build_ext
building 'regex._regex' extension
creating build/temp.linux-armv7l-3.6
creating build/temp.linux-armv7l-3.6/regex_3
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.6m -I/oprint/oprint/include/python3.6m -c regex_3/_regex.c -o build/temp.linux-armv7l-3.6/regex_3/_regex.o
regex_3/_regex.c:48:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /oprint/oprint/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-o_b50f5w/regex/setup.py'"'"'; file='"'"'/tmp/pip-install-o_b50f5w/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-108fdwlm/install-record.txt --single-version-externally-managed --compile --install-headers /oprint/oprint/include/site/python3.6/regex Check the logs for full command output.

Blockquote

BTW, can't find the logs mentioned. Even after:
root@oprint:/oprint/oprint# updatedb
root@oprint:/oprint/oprint# locate octoprint
root@oprint:/oprint/oprint#

nothing in /var/log and if I run pip install octoprint while I have journalctl -f running nothing related appears...

more info:
realized I hadn't installed python3.6-venv when I installed python3.6 but after doing that and logging out & back in got the same results, failed to build wheels for those three packages and then the install failed when it tried to use regex.

also realized that after a fresh start I'd failed to upgrade pip but at v20 I get the same errors on the same three packages

should I be running some different pip for python3.6? can't find anything in apt-cache search that seems likely beyond python3-pip (I have that)

Gah. Also needed to install python3.6-dev

'pip install octoprint' now completes without errors.

1 Like