Windows下Superset排坑記


1、mysql數據庫連接需設置配置文件——config.py

  文件路徑在:D:\...\Lib\site-packages\superset

  設置如下:

# The SQLAlchemy connection string. # SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(DATA_DIR, 'superset.db') # SQLALCHEMY_DATABASE_URI = 'mysql://myapp@localhost/myapp'
SQLALCHEMY_DATABASE_URI = 'mysql://root:root123@localhost:3306/superset?charset=utf8' #其中superset是自己的一個數據庫
# SQLALCHEMY_DATABASE_URI = 'postgresql://root:password@localhost/myapp'

 

2、在 superset 網頁中 sql語句 一直運行,無結果

  ①、在superset 網頁中,設置相關選型

 

 

 

 

  ②、勾選上圖選項后會報錯:“ signal.....”.(具體內容不記得了 ),為解決此 bug,需設置配置文件—— utils.py

 

    def __enter__(self):
        try:
            #signal.signal(signal.SIGALRM, self.handle_timeout)
            #signal.alarm(self.seconds)
            pass
        except ValueError as e:
            logging.warning("timeout can't be used in the current context")
            logging.exception(e)

    def __exit__(self, type, value, traceback):
        try:
            # signal.alarm(0)
            pass
        except ValueError as e:
            logging.warning("timeout can't be used in the current context")
            logging.exception(e)

 

 3、superset 導出CSV 編碼修改

  修改 superset/config.py
  CSV_EXPORT = {
      'encoding': 'gbk',
        }

 

BUG:AttributeError: 'NoneType' object has no attribute 'auth_type'

  出現這個問題,應該主要是版本不兼容引起的,作者更換了上述版本superset 0.28.1之后,就沒有出現這個問題

BUG:cannot import name '_maybe_box_datetimelike' from 'pandas.core.common' (g:\anaconda3\envs\superset\lib\site-packages\pandas\core\common.py)

  按照上述提示位置,修改即可,將maybe_box_datetimelike 修改成_maybe_box_datetimelike

  還需要將  .\pandas\core\frame.py  和  .\pandas\core\base.py 兩個文件中的  maybe_box_datetimelike 修改成 _maybe_box_datetimelike

BUG:'superset' 不是內部或外部命令,也不是可運行的程序或批處理文件。

  按照上面安裝步驟三執行即可,進入該目錄后,在superset命令前加個python即可

BUG:'fabmanager' 不是內部或外部命令,也不是可運行的程序或批處理文件。

  沒有安裝flask,按照步驟三按照相關包即可

BUG:sqlalchemy.exc.InvalidRequestError: Can't determine which FROM clause to join from, there are multiple FROMS which can join to this entity. Try adding an explicit ON clause to help resolve the ambiguity.

  版本問題,將sqlalchemy版本修改成1.2即可,執行pip install sqlalchemy==1.2.18

BUG:SystemExit: error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio"

  缺少windows運行環境,按照提示安裝Visual C++ 14.0即可,單Visual C++ 14.0鏈接:https://pan.baidu.com/s/17dWVVPlDiB7YziWD1uFyxw 提取碼:7hs9

BUG:Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

  pip install安裝失敗的時候,會出現這個bug,主要在於pytest-runner缺失,執行pip install --user pytest-runner即可

BUG:fabmanager is going to be deprecated in 2.2.X, you can use the same commands on the improved 'flask fab ’'

  這個是新版提示建議使用flask fab命令,我們繼續使用老版本的fabmanager即可,不必理會

BUG: ImportError :No module name 'geohash'

  無論怎么執行pip install geohash都會報上面這個bug,主要是安裝geohash的時候,會默認未大寫的Geohash,因此直接執行pip install python-geohash即可,當然也可以修改將Geohash文件名改成 geohash,geohash文件夾下的 init.py 中的 from geohash import decode_exactly, decode, encode改成 from .geohash import decode_exactly, decode, encode

 

轉載:https://www.cnblogs.com/gambler/

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM