WordOps / WordOps

Install and manage a high performance WordPress stack with a few keystrokes

Home Page:https://wordops.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cannot import name 'distro' after upgrade to latest version

gresakg opened this issue · comments

The problem is what I get from running any wo command. Se bellow wo info.
This occured after upgrading to latest version witn sudo wo update There were no errors during the update.

System Information

$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 10 (buster)
Release: 10
Codename: buster

$ wo info
Traceback (most recent call last):
File "/usr/local/bin/wo", line 8, in
sys.exit(main())
File "/opt/wo/lib/python3.7/site-packages/wo/cli/main.py", line 93, in main
with app:
File "/opt/wo/lib/python3.7/site-packages/cement/core/foundation.py", line 1501, in enter
self.setup()
File "/opt/wo/lib/python3.7/site-packages/cement/core/foundation.py", line 835, in setup
import(self._meta.bootstrap, globals(), locals(), [], 0)
File "/opt/wo/lib/python3.7/site-packages/wo/cli/bootstrap.py", line 7, in
from wo.cli.controllers.base import WOBaseController
File "/opt/wo/lib/python3.7/site-packages/wo/cli/controllers/base.py", line 5, in
from wo.core.variables import WOVar
File "/opt/wo/lib/python3.7/site-packages/wo/core/variables.py", line 10, in
from distro import distro, linux_distribution
ImportError: cannot import name 'distro' from 'distro' (/opt/wo/lib/python3.7/site-packages/distro.py)

$ sudo nginx -V
nginx version: nginx/1.22.0 (WordOps Nginx-wo)
built with OpenSSL 1.1.1d 10 Sep 2019 (running with OpenSSL 1.1.1n 15 Mar 2022)
TLS SNI support enabled
configure arguments: --with-cc-opt='-g -O2 -fdebug-prefix-map=/usr/src/packages/BUILD=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -flto -ffat-lto-objects -Wdate-time -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-z,relro -fPIC -flto -ffat-lto-objects' --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --build='WordOps Nginx-wo' --with-debug --with-pcre-jit --with-file-aio --with-threads --with-http_ssl_module --with-http_v2_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-openssl-opt='zlib enable-ec_nistp_64_gcc_128 enable-tls1_3 no-ssl3-method -fPIC' --with-http_addition_module --with-http_geoip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_sub_module --with-http_xslt_module --without-http_memcached_module --add-module=/usr/src/packages/BUILD/debian/modules/headers-more-nginx-module --add-module=/usr/src/packages/BUILD/debian/modules/nginx-auth-pam --add-module=/usr/src/packages/BUILD/debian/modules/nginx-cache-purge --add-module=/usr/src/packages/BUILD/debian/modules/nginx-echo --add-module=/usr/src/packages/BUILD/debian/modules/nginx-upstream-fair --add-module=/usr/src/packages/BUILD/debian/modules/ngx_http_substitutions_filter_module --add-module=/usr/src/packages/BUILD/debian/modules/memc-nginx-module --add-module=/usr/src/packages/BUILD/debian/modules/srcache-nginx-module --add-module=/usr/src/packages/BUILD/debian/modules/HttpRedisModule --add-module=/usr/src/packages/BUILD/debian/modules/redis2-nginx-module --add-module=/usr/src/packages/BUILD/debian/modules/ngx_devel_kit --add-module=/usr/src/packages/BUILD/debian/modules/set-misc-nginx-module --add-module=/usr/src/packages/BUILD/debian/modules/nginx-module-vts --add-module=/usr/src/packages/BUILD/debian/modules/ngx_brotli
$ sudo wo -v
Traceback (most recent call last):
File "/usr/local/bin/wo", line 8, in
sys.exit(main())
File "/opt/wo/lib/python3.7/site-packages/wo/cli/main.py", line 93, in main
with app:
File "/opt/wo/lib/python3.7/site-packages/cement/core/foundation.py", line 1501, in enter
self.setup()
File "/opt/wo/lib/python3.7/site-packages/cement/core/foundation.py", line 835, in setup
import(self._meta.bootstrap, globals(), locals(), [], 0)
File "/opt/wo/lib/python3.7/site-packages/wo/cli/bootstrap.py", line 7, in
from wo.cli.controllers.base import WOBaseController
File "/opt/wo/lib/python3.7/site-packages/wo/cli/controllers/base.py", line 5, in
from wo.core.variables import WOVar
File "/opt/wo/lib/python3.7/site-packages/wo/core/variables.py", line 10, in
from distro import distro, linux_distribution
ImportError: cannot import name 'distro' from 'distro' (/opt/wo/lib/python3.7/site-packages/distro.py)

$ wp cli info --allow-root
OS: Linux 4.19.0-25-amd64 #1 SMP Debian 4.19.289-2 (2023-08-08) x86_64
Shell: /bin/bash
PHP binary: /usr/bin/php7.4
PHP version: 7.4.30
php.ini used: /etc/php/7.4/cli/php.ini
MySQL binary: /usr/bin/mysql
MySQL version: mysql Ver 15.1 Distrib 10.5.17-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
SQL modes: STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
WP-CLI root dir: phar://wp-cli.phar/vendor/wp-cli/wp-cli
WP-CLI vendor dir: phar://wp-cli.phar/vendor
WP_CLI phar path: /home/gregor
WP-CLI packages dir: /home/gregor/.wp-cli/packages/
WP-CLI cache dir: /home/gregor/.wp-cli/cache
WP-CLI global config:
WP-CLI project config:
WP-CLI version: 2.10.0

$ curl -sL git.io/fjAp3 | sudo -E bash -

Here the link to provide in your github issue : https://transfer.vtbox.net/EJc3AM/wordops.txt

Same here

Hello, I'm trying to reproduce your issue and to find a way to fix it.

Hello @gresakg @allenvino1,
if the issue persist, can you try to run /opt/wo/bin/pip install -U wordops --upgrade-strategy=eager ?
Let me know if there are errors running this command.

Sorry guys I did find the solution that worked for me, but couldn't post it here right away and then forgot. This was my solution:

`
source /opt/wo/bin/activate

pip install -U distro

deactivate
`

@gresakg Thanks! Worked for me also but had to do sudo before the following commands

A fix will be available in the next WordOps release.