Python3 pip stopped working


#1

Hi!

I have my python3 script running on an Asus RT-N18U device. Everything worked just fine for Linux OpenWrt 4.14.98. But we bought several new devices and I had to upgrade to Linux OpenWrt 4.14.105 as a package I need (kmod-usb-serial-cp210x) would no longer install on 4.14.98.

After upgrading to 4.14.105 I can no longer install python3 packages. I can't even upgrade pip.

root@OpenWrt:~# python3 -m pip install --upgrade pip
Exception:
Traceback (most recent call last):
  File "/base_command.py", line 143, in main
  File "/install.py", line 318, in run
  File "/resolve.py", line 102, in resolve
  File "/resolve.py", line 256, in _resolve_one
  File "/resolve.py", line 199, in _get_abstract_dist_for
  File "/resolve.py", line 170, in _check_skip_installed
  File "/index.py", line 572, in find_requirement
  File "/index.py", line 530, in find_all_candidates
  File "/index.py", line 675, in _get_pages
  File "/index.py", line 793, in _get_page
  File "/index.py", line 144, in _get_html_page
  File "/sessions.py", line 525, in get
  File "/download.py", line 396, in request
  File "/sessions.py", line 512, in request
  File "/sessions.py", line 622, in send
  File "/adapter.py", line 53, in send
  File "/adapters.py", line 445, in send
  File "/connectionpool.py", line 600, in urlopen
  File "/connectionpool.py", line 343, in _make_request
  File "/connectionpool.py", line 849, in _validate_conn
  File "/connection.py", line 344, in connect
  File "/ssl_.py", line 277, in create_urllib3_context
  File "/ssl.py", line 388, in __new__
ValueError: protocol configuration error

Here's the output for the websockets package:

root@OpenWrt:~# python3 -m pip install websockets
Collecting websockets
Exception:
Traceback (most recent call last):
  File "/base_command.py", line 143, in main
  File "/install.py", line 318, in run
  File "/resolve.py", line 102, in resolve
  File "/resolve.py", line 256, in _resolve_one
  File "/resolve.py", line 209, in _get_abstract_dist_for
  File "/prepare.py", line 218, in prepare_linked_requirement
  File "/req_install.py", line 164, in populate_link
  File "/index.py", line 572, in find_requirement
  File "/index.py", line 530, in find_all_candidates
  File "/index.py", line 675, in _get_pages
  File "/index.py", line 793, in _get_page
  File "/index.py", line 144, in _get_html_page
  File "/sessions.py", line 525, in get
  File "/download.py", line 396, in request
  File "/sessions.py", line 512, in request
  File "/sessions.py", line 622, in send
  File "/adapter.py", line 53, in send
  File "/adapters.py", line 445, in send
  File "/connectionpool.py", line 600, in urlopen
  File "/connectionpool.py", line 343, in _make_request
  File "/connectionpool.py", line 849, in _validate_conn
  File "/connection.py", line 344, in connect
  File "/ssl_.py", line 277, in create_urllib3_context
  File "/ssl.py", line 388, in __new__
ValueError: protocol configuration error

I installed python3 with opkg update && opkg install python3 python3-pip.

My environment is:

root@OpenWrt:~# uname -a
Linux OpenWrt 4.14.105 #0 SMP Wed Mar 13 21:43:13 2019 armv7l GNU/Linux

root@OpenWrt:~# python3
Python 3.7.2 (default, Mar 13 2019, 21:43:13) 
[GCC 7.4.0] on linux

root@OpenWrt:~# pip3 --version
pip 18.1 from /usr/lib/python3.7/site-packages/pip (python 3.7)

Any help would be greatly appreciated.


#2

Do you have a TLS cert bundle installed?


#3

Hmm... And how can I check that?


#4

opkg list-installed

There are a couple options. I happen to use ca-bundle


#5
root@R-2C-FD-A1-5F-F3-A0:~# opkg install ca-bundle
Unknown package 'ca-bundle'.

Maybe I'm missing something?

/etc/ssl/certs is empty, if that matters.

I tried looking through the list of my installed modules but grepping for tls or ssl gave me nothing.

root@R-2C-FD-A1-5F-F3-A0:~# opkg list-installed
base-files - 197-r9586-74ef848
busybox - 1.30.1-2
dnsmasq - 2.80-11
dropbear - 2017.75-9
firewall - 2019-01-02-70f8785b-2
fping - 4.1-1
fstools - 2018-12-28-af93f4b8-4
fwtool - 1
ip6tables - 1.8.2-3
iptables - 1.8.2-3
jshn - 2019-02-27-eeef7b50-1
jsonfilter - 2018-02-04-c7e938d6-1
kernel - 4.14.105-1-dcab2363a3f36331ab9d464c48f19c1d
kmod-gpio-button-hotplug - 4.14.105-2
kmod-ip6tables - 4.14.105-1
kmod-ipt-conntrack - 4.14.105-1
kmod-ipt-core - 4.14.105-1
kmod-ipt-nat - 4.14.105-1
kmod-ipt-offload - 4.14.105-1
kmod-leds-gpio - 4.14.105-1
kmod-ledtrig-default-on - 4.14.105-1
kmod-ledtrig-timer - 4.14.105-1
kmod-lib-crc-ccitt - 4.14.105-1
kmod-nf-conntrack - 4.14.105-1
kmod-nf-conntrack6 - 4.14.105-1
kmod-nf-flow - 4.14.105-1
kmod-nf-ipt - 4.14.105-1
kmod-nf-ipt6 - 4.14.105-1
kmod-nf-nat - 4.14.105-1
kmod-nf-reject - 4.14.105-1
kmod-nf-reject6 - 4.14.105-1
kmod-nls-base - 4.14.105-1
kmod-phy-bcm-ns-usb2 - 4.14.105-1
kmod-phy-bcm-ns-usb3 - 4.14.105-1
kmod-ppp - 4.14.105-1
kmod-pppoe - 4.14.105-1
kmod-pppox - 4.14.105-1
kmod-slhc - 4.14.105-1
kmod-usb-bcma - 4.14.105-1
kmod-usb-core - 4.14.105-1
kmod-usb-ehci - 4.14.105-1
kmod-usb-ledtrig-usbport - 4.14.105-1
kmod-usb-ohci - 4.14.105-1
kmod-usb2 - 4.14.105-1
kmod-usb3 - 4.14.105-1
libblobmsg-json - 2019-02-27-eeef7b50-1
libbz2-1.0 - 1.0.6-5
libc - 1.1.21-1
libdb47 - 4.7.25.4.NC-5
libffi - 3.2.1-3
libgcc1 - 7.4.0-1
libgdbm - 1.11-1
libip4tc0 - 1.8.2-3
libip6tc0 - 1.8.2-3
libjson-c2 - 0.12.1-3
libjson-script - 2019-02-27-eeef7b50-1
liblzma - 5.2.4-2
libncurses6 - 6.1-4
libnl-tiny - 0.1-5
libopenssl1.1 - 1.1.1b-3
libpthread - 1.1.21-1
librt - 1.1.21-1
libsqlite3 - 3260000-3
libubox20170601 - 2019-02-27-eeef7b50-1
libubus20170705 - 2018-10-06-221ce7e7-1
libuci20130104 - 2018-08-11-4c8b4d6e-2
libuclient20160123 - 2018-11-24-3ba74ebc-1
libuuid1 - 2.33-2
libxml2 - 2.9.9-1
libxtables12 - 1.8.2-3
logd - 2018-12-18-876c7f5b-1
mtd - 24
netifd - 2019-01-31-5cd7215a-1
nvram - 10
odhcp6c - 2019-01-11-d2e247d8-16
odhcpd-ipv6only - 2019-02-27-16c5b6c9-3
openwrt-keyring - 2018-05-18-103a32e9-1
opkg - 2019-01-31-d4ba162b-1
osafeloader - 1
oseama - 1
otrx - 1
ppp - 2.4.7.git-2018-06-23-1
ppp-mod-pppoe - 2.4.7.git-2018-06-23-1
procd - 2019-03-11-d876d1ca-1
python-pip-conf - 0.1-1
python3 - 3.7.2-6
python3-asyncio - 3.7.2-6
python3-base - 3.7.2-6
python3-cgi - 3.7.2-6
python3-cgitb - 3.7.2-6
python3-codecs - 3.7.2-6
python3-ctypes - 3.7.2-6
python3-dbm - 3.7.2-6
python3-decimal - 3.7.2-6
python3-distutils - 3.7.2-6
python3-email - 3.7.2-6
python3-gdbm - 3.7.2-6
python3-light - 3.7.2-6
python3-logging - 3.7.2-6
python3-lzma - 3.7.2-6
python3-multiprocessing - 3.7.2-6
python3-ncurses - 3.7.2-6
python3-openssl - 3.7.2-6
python3-pip - 18.1-1
python3-pydoc - 3.7.2-6
python3-setuptools - 40.6.2-1
python3-sqlite3 - 3.7.2-6
python3-unittest - 3.7.2-6
python3-urllib - 3.7.2-6
python3-xml - 3.7.2-6
swconfig - 12
terminfo - 6.1-4
ubi-utils - 2.0.2-1
ubox - 2018-12-18-876c7f5b-1
ubus - 2018-10-06-221ce7e7-1
ubusd - 2018-10-06-221ce7e7-1
uci - 2018-08-11-4c8b4d6e-2
uclient-fetch - 2018-11-24-3ba74ebc-1
uhttpd - 2018-11-28-cdfc902a-2
usign - 2015-07-04-ef641914-1
zlib - 1.2.11-2