Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependency error on Ubuntu22/python3.10 #372

Open
abhipil opened this issue Aug 30, 2022 · 6 comments
Open

Dependency error on Ubuntu22/python3.10 #372

abhipil opened this issue Aug 30, 2022 · 6 comments

Comments

@abhipil
Copy link

abhipil commented Aug 30, 2022

Steps to reproduce:

$ git clone https://github.com/AdaptiveScale/lxdui.git
$ cd lxdui
$ python3 -m venv .env
$ source .env/bin/activate
$ python3 setup.py install
$ python3 run.py start
Traceback (most recent call last):
  File "/home/user/lxdui/run.py", line 1, in <module>
    from app.cli.cli import lxdui
  File "/home/user/lxdui/app/cli/cli.py", line 6, in <module>
    from app.api import core
  File "/home/user/lxdui/app/api/core.py", line 3, in <module>
    from flask import Flask, redirect
  File "/home/user/lxdui/.env/lib/python3.10/site-packages/Flask-1.0-py3.10.egg/flask/__init__.py", line 19, in <module>
    from jinja2 import Markup, escape
ImportError: cannot import name 'Markup' from 'jinja2' (/home/user/lxdui/.env/lib/python3.10/site-packages/Jinja2-3.1.2-py3.10.egg/jinja2/__init__.py)

Here's pip freeze -

$ python3 -m pip freeze
certifi==2022.6.15
cffi==1.15.1
chardet==3.0.4
click==6.7
cryptography==37.0.4
Flask==1.0
Flask-JWT==0.3.2
Flask-Login==0.4.1
idna==2.7
itsdangerous==2.1.2
Jinja2==3.1.2
jsonschema==2.6.0
LXDUI==2.1.2
MarkupSafe==2.1.1
netaddr==0.7.19
pbr==5.10.0
psutil==5.6.6
ptyprocess==0.7.0
pycparser==2.21
PyJWT==1.4.2
pylxd==2.2.7
pyOpenSSL==17.5.0
python-dateutil==2.8.2
requests==2.20.0
requests-toolbelt==0.9.1
requests-unixsocket==0.3.0
six==1.16.0
terminado==0.8.1
tornado==5.0.2
tornado_xstatic==0.3
urllib3==1.24.3
Werkzeug==2.2.2
ws4py==0.5.1
XStatic==1.0.1
XStatic-term.js==0.0.7.0
@PeerCohere
Copy link

Same issue Ubuntu 22.04 server and skipped 3. [Optional] Create a virtual environment for testing. Skip this step if you want to install it globaly on your system.

Completely fresh install of ubuntu and LXD, specifically for testing LXD dashboards

@maarten256
Copy link

Affects me too, on Ubuntu 22.04.

@PeerCohere
Copy link

PeerCohere commented Sep 6, 2022

Don't use this in a production enviroment. The owner should mark this as a dead project if they don't want to support it for free. No shame in that, but make it clear whats to be expected.

@timonych
Copy link

timonych commented Mar 5, 2023

Hi Everyone!

I have made requirements.txt with correct dependencies for python 3.10
Have checked on OpenSUSE 15.4 and Alpine Linux 3.17 with Python 3.10 and there is no critical error.

attr==0.3.2
attrs==22.2.0
bcrypt==4.0.1
certifi==2022.12.7
cffi==1.15.1
chardet==3.0.4
charset-normalizer==3.0.1
click==8.1.3
cryptography==36.0.2
Flask==2.1.3
Flask-JWT-Extended==3.18.0
Flask-Login==0.4.1
idna==2.7
itsdangerous==2.0.1
Jinja2==3.1.2
jsonschema==2.6.0
LXDUI==2.2
MarkupSafe==2.1.2
netaddr==0.8.0
pbr==5.11.1
psutil==5.9.4
ptyprocess==0.7.0
pycparser==2.21
PyJWT==1.7.1
pylxd==2.3.1
pyOpenSSL==17.5.0
pyrsistent==0.19.3
python-dateutil==2.8.2
PyYAML==3.11
requests==2.20.0
requests-toolbelt==0.10.1
requests-unixsocket==0.3.0
six==1.16.0
terminado==0.17.1
tornado==6.2
tornado_xstatic==0.3
urllib3==1.24.3
Werkzeug==2.0.3
ws4py==0.5.1
XStatic==1.0.1
XStatic-term.js==0.0.7.0

@maarten256
Copy link

I found I could not get it to work with the requirements.txt suggested by timonych. That's more an indication of my failure to understand how this is supposed to work than anything else.

Just in case anybody stumbles across this conversation, I did finally find a way to get lxdui to work. As was mentioned by PeerCohere above, the "AdaptiveScale" version (this repo) is not maintained. However, https://github.com/gr8linux/lxdui/tree/master is (at least as recently as Jan 2023).

So I threw away my checkout of lxdui (just to make sure I started "clean") and checked out that version instead.

Suffice to say that didn't work (to my frustration); which wasn't an issue with gr8linux' version, but rather my messed-up python environment. After some digging, I found that uninstalling all packages I'd previously installed in my attempts to get lxdui to work (from various repos as well as my own stumbling around) was the way to go; that way I was able to install lxdui (from the gr8linux repo) with all the correct dependencies and it works.

I took the requirements.txt from gr8linux and created a file (pkg.txt) with just the package names, and used "pip3 uninstall" to get rid of all those:

for pkg in $(cat pkg.txt); do
echo $pkg
sudo pip3 uninstall -y $pkg
done

Then, for good measure I did the same with the packages that timonych had suggested. Then I ran sudo python3 setup.py install, followed by sudo lxdui start, and to my amazement it actually ran, without failing on something or other.

I have to say I did try the virtualenv first (which worked, and led me to believe I could also make this work outside of the venv). Now that I have it installed with sudo, I can actually install lxdui.service and have this run normally with my systems.

YMMV; this worked for me but may not for others. I did spend a few hours beating my head against the wall trying to get this sorted to my liking. Python 3.10.6 on Ubuntu 22.04.2.

@jetroni
Copy link
Contributor

jetroni commented Apr 19, 2024

Tagging #379 as it is the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants