Mac下安装Superset

笔主环境

# 系统
macOS Mojave Version 10.14.2
# Python
Python 3.7.1

环境准备

  • 创建虚拟环境
conda create -n superset python=3.6
  • 激活虚拟环境
conda activate superset

准备工作完成

  • 安装依赖包
    执行如下命令
wget https://raw.githubusercontent.com/apache/incubator-superset/master/requirements.txt
pip install -r requirements.txt
# 最好使用CFLAGS=-stdlib=libc++ pip install -r requirements.txt 安装
# 能解决可能的错误, 错误详情文章下面

安装Superset

pip install superset

一般正常情况下是可以安装成功, 也有例外, 我在安装过程中遇到了如下问题

Failed building wheel for python-geohash
Failed building wheel for cchardet

Failed to build python-geohash cchardet
Installing collected packages: python-geohash, cchardet, tabulator, tableschema, superset
  Running setup.py install for python-geohash ... error
    Complete output from command /anaconda3/envs/superset/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/f6/6zqglp5165q7jr8lg2kkwq_80000gn/T/pip-install-exkh7_b5/python-geohash/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/f6/6zqglp5165q7jr8lg2kkwq_80000gn/T/pip-record-lfs5y7mf/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.7-x86_64-3.7
    copying geohash.py -> build/lib.macosx-10.7-x86_64-3.7
    copying quadtree.py -> build/lib.macosx-10.7-x86_64-3.7
    copying jpgrid.py -> build/lib.macosx-10.7-x86_64-3.7
    copying jpiarea.py -> build/lib.macosx-10.7-x86_64-3.7
    running build_ext
    building '_geohash' extension
    creating build/temp.macosx-10.7-x86_64-3.7
    creating build/temp.macosx-10.7-x86_64-3.7/src
    gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/anaconda3/envs/superset/include -arch x86_64 -I/anaconda3/envs/superset/include -arch x86_64 -I/usr/local/opt/libxml2/include -DPYTHON_MODULE=1 -I/anaconda3/envs/superset/include/python3.7m -c src/geohash.cpp -o build/temp.macosx-10.7-x86_64-3.7/src/geohash.o
    warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
    1 warning generated.
    g++ -bundle -undefined dynamic_lookup -L/anaconda3/envs/superset/lib -arch x86_64 -L/anaconda3/envs/superset/lib -arch x86_64 -L/usr/local/opt/libxml2/lib -I/usr/local/opt/libxml2/include -arch x86_64 build/temp.macosx-10.7-x86_64-3.7/src/geohash.o -o build/lib.macosx-10.7-x86_64-3.7/_geohash.cpython-37m-darwin.so
    clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]
    ld: library not found for -lstdc++
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    error: command 'g++' failed with exit status 1

    ----------------------------------------
Command "/anaconda3/envs/superset/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/f6/6zqglp5165q7jr8lg2kkwq_80000gn/T/pip-install-exkh7_b5/python-geohash/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/f6/6zqglp5165q7jr8lg2kkwq_80000gn/T/pip-record-lfs5y7mf/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/f6/6zqglp5165q7jr8lg2kkwq_80000gn/T/pip-install-exkh7_b5/python-geohash/

解决办法如下:
安装gcc最新版本

brew info gcc@7

完成之后在重新安装superset

CFLAGS=-stdlib=libc++ pip install superset

初始化Superset

可能遇到的错误:

Was unable to import superset Error: cannot import name '_maybe_box_datetimelike' 
from 'pandas.core.common' (
/anaconda3/envs/superset/lib/python3.7/site-packages/pandas/core/common.py)

解决办法: 安装较老版本的pandas

pip install --upgrade pandas==0.23.1 --force-reinstall
初始化
# Create an admin user (you will be prompted to set a username, first and last name before setting a password)
fabmanager create-admin --app superset

# Initialize the database
superset db upgrade

# Load some data to play with
superset load_examples

# Create default roles and permissions
superset init

# To start a development web server on port 8088, use -p to bind to another port
superset runserver -d
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • feisky云计算、虚拟化与Linux技术笔记posts - 1014, comments - 298, trac...
    不排版阅读 4,437评论 0 5
  • GIT分布式版本控制系统最佳实践 这篇文章来自于老男孩教育高级架构师班12期的徐亮偉同学。 首先感谢老男孩架构师班...
    meng_philip123阅读 3,859评论 4 36
  • 1.git的安装 1.1 在Windows上安装Git msysgit是Windows版的Git,从https:/...
    落魂灬阅读 12,875评论 4 54
  • 女儿灵魂拷问老父亲 爸爸:宝贝,爸爸希望你不要长大,永远都读幼儿园(舍不得小情人出嫁的心情) 女儿:什么,爸爸你希...
    颖妈育儿阅读 338评论 0 0
  • 遇到一个喜欢的人其实不难,多少爱情都开始于喜欢,结束于了解,后来明白,所谓合适的人,没有定论,大概是三观相似,兴趣...
    我自己挺好的阅读 155评论 0 0

友情链接更多精彩内容