PalisadoesFoundation / switchmap-ng

A Python 3 inventory system that tabulates the status of network ports.
Apache License 2.0
16 stars 7 forks source link

ImportError: cannot import name Markup from flask #160

Open lavitiy opened 11 months ago

lavitiy commented 11 months ago

Since Flask is using Jinja2 for quite some time, they removed the re-export of Markup with the 3.0.0 release

lavitiy commented 11 months ago

19:12 $ maintenance/install.py Do you want switchmap-ng to start automatically after a reboot?: (Y, N) n OK - Python version 3.10. OK - Python pip3 executable found. OK - Python module "setuptools" is installed. OK - Python pip3 executable found. OK - Python module "PyYAML" is installed. OK - Created configuration file /home/gramazeka/switchmap-ng/switchmap-ng/etc/config.yaml. OK - Installing required pip3 packages from requirements.txt file. 2023-10-31 19:13:19,431962 - gramazeka - STATUS - [1127] Could not start daemon switchmap-ng-api. 2023-10-31 19:13:19,432095 - gramazeka - STATUS - [1001] Failed to start daemon switchmap-ng-api. 2023-10-31 19:13:19,972491 - gramazeka - STATUS - [1127] Could not start daemon switchmap-ng-poller. 2023-10-31 19:13:19,972631 - gramazeka - STATUS - [1001] Failed to start daemon switchmap-ng-poller.


1) Edit file /home/gramazeka/switchmap-ng/switchmap-ng/etc/config.yaml with correct SNMP parameters and then restart the daemons. 2) You can restart switchmap-ng daemons with these commands: $ bin/switchmap-ng-cil restart api $ bin/switchmap-ng-cli restart poller 3) Switchmap-NG will not automatically restart after a reboot. You need to re-install as the "root" user for this to occur.

19:28 $ bin/switchmap-ng-cli restart poller Traceback (most recent call last): File "/home/gramazeka/switchmap-ng/switchmap-ng/bin/switchmap-ng-cli", line 24, in from switchmap.cli import cli File "/home/gramazeka/switchmap-ng/switchmap-ng/switchmap/cli/cli.py", line 15, in from switchmap.cli import show, start, test, stop, restart File "/home/gramazeka/switchmap-ng/switchmap-ng/switchmap/cli/show.py", line 16, in from switchmap.main.agent import Agent, AgentAPI, AgentDaemon File "/home/gramazeka/switchmap-ng/switchmap-ng/switchmap/main/agent.py", line 29, in from switchmap.www import API File "/home/gramazeka/switchmap-ng/switchmap-ng/switchmap/www/init.py", line 14, in from switchmap.www.routes.api.devices import API_DEVICES File "/home/gramazeka/switchmap-ng/switchmap-ng/switchmap/www/routes/api/devices.py", line 12, in from switchmap.www.pages import device File "/home/gramazeka/switchmap-ng/switchmap-ng/switchmap/www/pages/device.py", line 10, in from flask_table import Table, Col File "/home/gramazeka/.local/lib/python3.10/site-packages/flask_table/init.py", line 1, in from .table import Table, create_table File "/home/gramazeka/.local/lib/python3.10/site-packages/flask_table/table.py", line 5, in from flask import Markup ImportError: cannot import name 'Markup' from 'flask' (/home/gramazeka/.local/lib/python3.10/site-packages/flask/init.py)

19:25 $ uname -a Linux-VirtualBox 6.2.0-35-generic #35~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Oct 6 10:23:26 UTC 2 x86_64 x86_64 x86_64 GNU/Linux 19:25 $ cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=22.04 DISTRIB_CODENAME=jammy DISTRIB_DESCRIPTION="Ubuntu 22.04.3 LTS"

maxferrario-msf commented 4 months ago

I have the same error, and the same OS (Ubuntu 22.04.3 LTS). The only (minor?) difference is that in my case the error message refers to the file lib/python3.10/dist-packages/flask/init.py