superset db upgrade报错记录

这篇具有很好参考价值的文章主要介绍了superset db upgrade报错记录。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

报错1

(superset) [hyj@hadoop102 ~]$ superset db upgrade
    from markupsafe import soft_unicode
ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/opt/module/miniconda3/envs/superset/lib/python3.7/site-packages/markupsafe/__init__.py)

解决方法:

  1. 查看markupsafe这个包是否存在
(superset) [hyj@hadoop102 ~]$ pip show markupsafe
Name: MarkupSafe
Version: 2.1.2
  1. 下载2.0.1版本的markupsafe (pip会帮我们卸载之前版本的并下载2.0.1版本的markupsafe)
(superset) [hyj@hadoop102 ~]$ pip install markupsafe==2.0.1

报错2

(superset) [hyj@hadoop102 ~]$ superset db upgrade
    for ep in importlib_metadata.entry_points().get(namespace, [])
AttributeError: 'EntryPoints' object has no attribute 'get'

解决方法:

(superset) [hyj@hadoop102 ~]$ pip install importlib-metadata==4.13.0

报错3

(superset) [hyj@hadoop102 ~]$ superset db upgrade
 from typing import List, Optional, TypedDict, Union
ImportError: cannot import name 'TypedDict' from 'typing' (/opt/module/miniconda3/envs/superset/lib/python3.7/typing.py)

  • 这个错误通常是由于Python版本过低导致的,因为 TypedDict 是在Python3.8中引入的。
  • 如果你使用的是Python3.7或更早的版本,那么就会出现这个问题。
  • 要解决这个问题,可以将Python版本升级到3.8或者更高的版本。另外,你也可以使用第三方库typing_extensions来实现类似的功能。
(superset) [hyj@hadoop102 ~]$ python -V
Python 3.7.13
(superset) [hyj@hadoop102 ~]$ conda deactivate
(base) [hyj@hadoop102 ~]$ conda info --envs
# conda environments:
#
base                  *  /opt/module/miniconda3
superset                 /opt/module/miniconda3/envs/superset

(base) [hyj@hadoop102 ~]$ conda remove -n superset --all
(base) [hyj@hadoop102 ~]$ conda create --name superset python=3.8
(base) [hyj@hadoop102 ~]$  conda activate superset

参考链接:ImportError: cannot import name ‘TypedDict’ from ‘typing’

报错4

(superset) [hyj@hadoop102 ~]$ superset db upgrade
re.compile(r"'(''|\\\\|\\|[^'])*'", sqlparse.keywords.FLAGS).match,
AttributeError: module 'sqlparse.keywords' has no attribute 'FLAGS'

解决方法:

(superset) [hyj@hadoop102 ~]$ pip install sqlparse=='0.4.3'

报错5

(superset) [hyj@hadoop102 ~]$ superset db upgrade
Error: Could not locate a Flask application. 
You did not provide the "FLASK_APP" environment variable, and a "wsgi.py" or "app.py" module was not found in the current directory.

解决方法:

(superset) [hyj@hadoop102 ~]$  export FLASK_APP=superset

报错6

(superset) [hyj@hadoop102 ~]$ superset db upgrade
--------------------------------------------------------------------------------
                                    WARNING
--------------------------------------------------------------------------------
A Default SECRET_KEY was detected, please use superset_config.py to override it.
Use a strong complex alphanumeric string and use a tool to help you generate 
a sufficiently random sequence, ex: openssl rand -base64 42
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Refusing to start due to insecure SECRET_KEY

解决方法:

  1. 进入到miniconda3的安装路径下的envs/superset/lib/python3.8/目录
(superset) [hyj@hadoop102 ~]$ cd /opt/module/miniconda3/envs/superset/lib/python3.8/
  1. 创建superset_config.py
(superset) [hyj@hadoop102 python3.8]$ vim superset_config.py
  1. 添加如下内容
# Superset specific config
# SS 相关的配置
# 行数限制 5000 行
ROW_LIMIT = 5000
 
# 网站服务器端口 8088
SUPERSET_WEBSERVER_PORT = 8088
 
# Flask App Builder configuration
# Your App secret key will be used for securely signing the session cookie
# and encrypting sensitive information on the database
# Make sure you are changing this key for your deployment with a strong key.
# You can generate a strong key using `openssl rand -base64 42`
# Flask 应用构建器配置
# 应用密钥用来保护会话 cookie 的安全签名
# 并且用来加密数据库中的敏感信息
# 请确保在你的部署环境选择一个强密钥
# 可以使用命令 openssl rand -base64 42 来生成一个强密钥
 
SECRET_KEY = "ZT2uRVAMPKpVkHM/QA1QiQlMuUgAi7LLo160AHA99aihEjp03m1HR6Kg" 
 
# The SQLAlchemy connection string to your database backend
# This connection defines the path to the database that stores your
# superset metadata (slices, connections, tables, dashboards, ...).
# Note that the connection information to connect to the datasources
# you want to explore are managed directly in the web UI
# SQLAlchemy 数据库连接信息
# 这个连接信息定义了 SS 元数据库的路径(切片、连接、表、数据面板等等)
# 注意:需要探索的数据源连接及数据库连接直接通过网页界面进行管理
#SQLALCHEMY_DATABASE_URI = 'sqlite:path/to/superset.db'
 
# Flask-WTF flag for CSRF
# 跨域请求攻击标识
WTF_CSRF_ENABLED = True
 
# Add endpoints that need to be exempt from CSRF protection
# CSRF 白名单
WTF_CSRF_EXEMPT_LIST = []
 
# A CSRF token that expires in 1 year
# CSFR 令牌过期时间 1 年
WTF_CSRF_TIME_LIMIT = 60 * 60 * 24 * 365
 
# Set this API key to enable Mapbox visualizations
# 接口密钥用来启用 Mapbox 可视化
MAPBOX_API_KEY = ''
  • 用命令 openssl rand -base64 42 来生成一个强密钥
  • [hyj@hadoop102 ~]$ openssl rand -base64 42
    4xPjBius42o5Y/pbgRmkjKZ3im5CeHcRXM93TWm+FboEJOll0XMMgDRW
  • 所以SECRET_KEY =“4xPjBius42o5Y/pbgRmkjKZ3im5CeHcRXM93TWm+FboEJOll0XMMgDRW”

原文链接:Linux安装miniconda3

成功了

(superset) [hyj@hadoop102 ~]$ superset db upgrade

一连报了6个错,终于成功了。superset db upgrade报错记录文章来源地址https://www.toymoban.com/news/detail-486302.html

到了这里,关于superset db upgrade报错记录的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • upgrade pip报错:def read(rel_path: str) -> str: syntaxerror

    命令行执行以下命令就可以大功告成! 最后大功告成:

    2024年02月11日
    浏览(27)
  • websocket 线上环境报错:Handshake failed due to invalid Upgrade header: null

    一、问题描述: 公司有个项目用到了websocket,在本地环境测试没有问题,因为公司后台websocket是微服务搭建,我们需要nginx进行一层代理,结果出现如下错误 Handshake failed due to invalid Upgrade header: null 二、问题解决 1、首先找到自己nginx的配置文件—配置下面代码 —— nginx重启

    2024年02月11日
    浏览(38)
  • superset连接Apache Spark SQL(hive)过程中的各种报错解决

    我的博客原文:superset连接Apache Spark SQL(hive)过程中的各种报错解决 我们用的是Apache Spark SQL,所以首先需要安装下pyhive Apache Spark SQL连接的格式  安装包下载完成,可以测试是否可以连接hive了。 因为驱动不匹配导致的,返回重新下载依赖包 连接数据库的时候一直报无法连

    2024年04月14日
    浏览(27)
  • DB2 db2move 报错:SQL3107

    db2 get db cfg  df echo slang zh_CN.GBK ,zh_CN.UTF-8 db2set export LANG=zh_CN.GBK db2move HPDATADB export db2set -all db2set 变量=value db2set db2codepage=1386 db2set db2country=86 db2set db2comm=tcpip DB2 CODEPAGE --代码页查询列表 客户端: db2codepage=1386(简体中文) db2country=86(中国) db2comm=tcpip 服务器端: db2codepage=1386(简体

    2024年02月02日
    浏览(29)
  • Vue项目npm run dev 启动报错TypeError: Cannot read property ‘upgrade‘ of undefined

    vue项目启动报错 TypeError: Cannot read property \\\'upgrade\\\' of undefined  由于我的vue.config.js文件 里面的代理target为空导致的  修改: 结果就可以正常运行了   参考原文: vue项目运行时报Cannot read property ‘upgrade’ of undefined错误_cannot read property \\\'upgrade\\\' of undefined_超帅不是很帅的博客-CSD

    2024年02月14日
    浏览(43)
  • 报错:Client does not support authentication protocol requested by server; consider upgrading MySQL cli

    原因:mysql版本问题。 mysql8 之前的版本中加密规则是mysql_native_password,而在mysql8之后,加密规则是caching_sha2_password,所以可以需要 改变mysql的加密规则 1. 打开cmd窗口,登录mysql; mysql -u root -h 127.0.0.1 -P3306 -p - -u 后面root 为自己数据库的用户名 - -h 后面为 (mysql服务所在地址),我自

    2023年04月20日
    浏览(31)
  • nginx代理websocket无法链接到服务,服务端报错:Handshake failed due to invalid Upgrade header: null

    1、使用nginx代理websocket 2、websocket无法成功连接到服务端 3、服务端报错 4、nginx日志正常,没有发现与该websocket地址有关的报错 1、前端表现如下 1、协议是否使用有误,从上面的截图可以看出,websocket使用的是 wss ,那么nginx代理时,使用的协议是否是 https 检查结果:nginx代理

    2024年02月02日
    浏览(37)
  • 【报错】django.db.migrations.exceptions.NodeNotFoundError:

    从别处下载的Django源码在搭建的过程中遇到的错误 django.db.migrations.exceptions.NodeNotFoundError: Migration users.0001_initial dependencies reference nonexistent parent node (‘auth’, ‘0012_alter_user_first_name_max_length’) 依赖项引用不存在的父节点; 我遇到的是因为少编译迁移了一个app,从而导致另个一

    2024年02月09日
    浏览(38)
  • 打开虚拟机报错:虚拟机使用的是此版本 VMware Workstation 不支持的硬件版本。 模块“Upgrade”启动失败。 未能启动虚拟机。

    打开以前配置的虚拟机,发现版本不兼容,报错: 虚拟机使用的是此版本 VMware Workstation 不支持的硬件版本。 模块“Upgrade”启动失败。 未能启动虚拟机。 打开目录所在位置: 用编辑器打开.vmx文件: 若对于VMware16.x版本: 更改虚拟机的.vmx文件中的 virtualHW.version = “19” 改成

    2024年02月11日
    浏览(29)
  • ClickHouse报错:Code: 210. DB::NetException: Connection refused (localhost:9000)

    TNND,我是真的服了,估计玩阿里云集群的兄弟,都会遇到这个个问题。 首先我们来看启动信息: 从上面看,完全看不出问题,别信网上说的什么 端口占用、进程没关 直接开日志 我们截取ERROR日志信息 提取关键信息: 他说连接不上这个端口,好了,我们一般到这就是去查看

    2024年02月11日
    浏览(29)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包