安装Anaconda
网上都推荐用虚拟环境,所以安装了Anaconda。
百度Anaconda,下载对应版本,安装。
配置Anaconda下载源
修改用户名文件夹下'.condarc'文件,我习惯用notepad++打开类似文件。
删除所有内容,将以下内容粘贴:
ssl_verify: true
channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
show_channel_urls: true
tips:修改包下载源是为了防止创建虚拟环境出错。
环境配置
在环境配置上坑很多,我遇到了各式各样的,幸好有百度。
安装、配置VC++14环境
下载链接:https://pan.baidu.com/s/11gJPbaLjvc6cDMpecI4q2A
提取码:bq0h
安装
配置虚拟环境
一般来讲以上步骤进行过后就可以成功创建虚拟环境了。输入以下命令:
conda create -n superset python=3.7
> conda create -n superset python=3.7
Solving environment: done
## Package Plan ##
environment location: D:\ProgramData\Anaconda3\envs\superset
added / updated specs:
- python=3.7
The following packages will be downloaded:
package | build
---------------------------|-----------------
vs2015_runtime-14.0.25420 | 0 2.0 MB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
certifi-2019.3.9 | py37_0 149 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
openssl-1.1.1b | hfa6e2cd_2 4.8 MB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
wheel-0.33.1 | py37_0 52 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
sqlite-3.26.0 | hfa6e2cd_1001 958 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
ca-certificates-2019.3.9 | hecc5488_0 184 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
wincertstore-0.2 | py37_1002 13 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
pip-19.0.3 | py37_0 1.8 MB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
setuptools-41.0.0 | py37_0 644 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
python-3.7.3 | hb12ca83_0 17.8 MB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
vc-14 | 0 703 B https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
------------------------------------------------------------
Total: 28.3 MB
The following NEW packages will be INSTALLED:
ca-certificates: 2019.3.9-hecc5488_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
certifi: 2019.3.9-py37_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
openssl: 1.1.1b-hfa6e2cd_2 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
pip: 19.0.3-py37_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
python: 3.7.3-hb12ca83_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
setuptools: 41.0.0-py37_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
sqlite: 3.26.0-hfa6e2cd_1001 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
vc: 14-0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
vs2015_runtime: 14.0.25420-0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
wheel: 0.33.1-py37_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
wincertstore: 0.2-py37_1002 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
Proceed ([y]/n)? y
Downloading and Extracting Packages
vs2015_runtime-14.0. | 2.0 MB | ############################################################################ | 100%
certifi-2019.3.9 | 149 KB | ############################################################################ | 100%
openssl-1.1.1b | 4.8 MB | ############################################################################ | 100%
wheel-0.33.1 | 52 KB | ############################################################################ | 100%
sqlite-3.26.0 | 958 KB | ############################################################################ | 100%
ca-certificates-2019 | 184 KB | ############################################################################ | 100%
wincertstore-0.2 | 13 KB | ############################################################################ | 100%
pip-19.0.3 | 1.8 MB | ############################################################################ | 100%
setuptools-41.0.0 | 644 KB | ############################################################################ | 100%
python-3.7.3 | 17.8 MB | ############################################################################ | 100%
vc-14 | 703 B | ############################################################################ | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use:
# > activate superset
#
# To deactivate an active environment, use:
# > deactivate
#
# * for power-users using bash, you must source
#
激活虚拟环境
>activate superset
(superset) D:\Program Files (x86)\cmder>
安装、初始化superset
安装superset
>pip install superset -i https://pypi.douban.com/simple
Looking in indexes: https://pypi.douban.com/simple
Collecting superset
Collecting cryptography (from superset)
Downloading https://pypi.doubanio.com/packages/00/39/088ba8da28dd77582219d4b77263d5aedac37c5c1c31f75859f241b9fcd2/cryptography-2.6.1-cp37-cp37m-win_amd64.whl (1.5MB)
100% |████████████████████████████████| 1.5MB 4.1MB/s
Collecting colorama==0.3.9 (from superset)
Using cached https://pypi.doubanio.com/packages/db/c8/7dcf9dbcb22429512708fe3a547f8b6101c0d02137acbd892505aee57adf/colorama-0.3.9-py2.py3-none-any.whl
Collecting flask-compress (from superset)
Collecting geopy (from superset)
Downloading https://pypi.doubanio.com/packages/75/3e/80bc987e1635ba9e7455b95e233b296c17f3d3bf3d4760fa67cdfc840e84/geopy-1.19.0-py2.py3-none-any.whl (100kB)
100% |████████████████████████████████| 102kB 3.1MB/s
Collecting simplejson>=3.15.0 (from superset)
Collecting tableschema (from superset)
Downloading https://pypi.doubanio.com/packages/82/09/b5a0dd6c8d393f2099afeb899579ad87b09ef24bdb8e21440bda9017ad4e/tableschema-1.3.3-py2.py3-none-any.whl (55kB)
100% |████████████████████████████████| 61kB 4.1MB/s
Collecting sqlalchemy (from superset)
Downloading https://pypi.doubanio.com/packages/2a/9b/9b8aa2d5dbe2e4052cb4c84b8cf5e31686943f24b0565f436439bdc343b5/SQLAlchemy-1.3.2.tar.gz (5.9MB)
100% |████████████████████████████████| 5.9MB 12.8MB/s
Collecting markdown>=3.0 (from superset)
Downloading https://pypi.doubanio.com/packages/f5/e4/d8c18f2555add57ff21bf25af36d827145896a07607486cc79a2aea641af/Markdown-3.1-py2.py3-none-any.whl (87kB)
100% |████████████████████████████████| 92kB 7.1MB/s
Collecting idna (from superset)
Downloading https://pypi.doubanio.com/packages/14/2c/cd551d81dbe15200be1cf41cd03869a46fe7226e7450af7a6545bfc474c9/idna-2.8-py2.py3-none-any.whl (58kB)
100% |████████████████████████████████| 61kB 2.7MB/s
Collecting pathlib2 (from superset)
Downloading https://pypi.doubanio.com/packages/2a/46/c696dcf1c7aad917b39b875acdc5451975e3a9b4890dca8329983201c97a/pathlib2-2.3.3-py2.py3-none-any.whl
Collecting pyhive>=0.4.0 (from superset)
Collecting pandas>=0.18.0 (from superset)
Downloading https://pypi.doubanio.com/packages/61/c7/f943fceb712579bc538700e2c157dc4972e16abfe29bd4969149bad98c74/pandas-0.24.2-cp37-cp37m-win_amd64.whl (9.0MB)
100% |████████████████████████████████| 9.0MB 9.3MB/s
Collecting click==6.7 (from superset)
Using cached https://pypi.doubanio.com/packages/34/c1/8806f99713ddb993c5366c362b2f908f18269f8d792aff1abfd700775a77/click-6.7-py2.py3-none-any.whl
Collecting python-dateutil (from superset)
Downloading https://pypi.doubanio.com/packages/41/17/c62faccbfbd163c7f57f3844689e3a78bae1f403648a6afb1d0866d87fbb/python_dateutil-2.8.0-py2.py3-none-any.whl (226kB)
100% |████████████████████████████████| 235kB 10.2MB/s
Collecting flask-caching (from superset)
Downloading https://pypi.doubanio.com/packages/ea/63/54830e532e4fc507360ff88ded0f78e5ca227e2b6ff9b1ae23e4029ba1a2/Flask_Caching-1.7.0-py2.py3-none-any.whl
Collecting humanize (from superset)
Collecting flask-appbuilder>=1.12.1 (from superset)
Collecting unidecode>=0.04.21 (from superset)
Downloading https://pypi.doubanio.com/packages/31/39/53096f9217b057cb049fe872b7fc7ce799a1a89b76cf917d9639e7a558b5/Unidecode-1.0.23-py2.py3-none-any.whl (237kB)
100% |████████████████████████████████| 245kB 9.3MB/s
Collecting flask<1.0.0 (from superset)
Downloading https://pypi.doubanio.com/packages/2e/48/f1936dadac2326b3d73f2fe0a964a87d16be16eb9d7fc56f09c1bea3d17c/Flask-0.12.4-py2.py3-none-any.whl (81kB)
100% |████████████████████████████████| 81kB 3.9MB/s
Collecting python-geohash (from superset)
Downloading https://pypi.doubanio.com/packages/9c/e2/1a3507af7c8f91f8a4975d651d4aeb6a846dfdf74713954186ade4205850/python-geohash-0.8.5.tar.gz
Collecting thrift-sasl>=0.2.1 (from superset)
Collecting polyline (from superset)
Using cached https://pypi.doubanio.com/packages/c1/d0/58a19ca3fbe880145d200518fcd97d176cae07b9677db330f4881954d5f5/polyline-1.3.2-py2.py3-none-any.whl
Collecting contextlib2 (from superset)
Downloading https://pypi.doubanio.com/packages/a2/71/8273a7eeed0aff6a854237ab5453bc9aa67deb49df4832801c21f0ff3782/contextlib2-0.5.5-py2.py3-none-any.whl
Collecting sqlalchemy-utils (from superset)
Collecting flower (from superset)
Collecting flask-migrate (from superset)
Downloading https://pypi.doubanio.com/packages/07/6a/53695aab4c7cf7b230e46a5e4f06e0c9719c01a51223590fd75804439a01/Flask_Migrate-2.4.0-py2.py3-none-any.whl
Collecting flask-wtf (from superset)
Downloading https://pypi.doubanio.com/packages/60/3a/58c629472d10539ae5167dc7c1fecfa95dd7d0b7864623931e3776438a24/Flask_WTF-0.14.2-py2.py3-none-any.whl
Collecting pydruid>=0.4.3 (from superset)
Collecting pyyaml>=3.11 (from superset)
Downloading https://pypi.doubanio.com/packages/b6/74/c3e15707516f80192059dde32c9d78f00a88c9f3c4d1efd76cbc8d5b0a20/PyYAML-5.1-cp37-cp37m-win_amd64.whl (215kB)
100% |████████████████████████████████| 225kB 6.4MB/s
Collecting celery>=4.2.0 (from superset)
Downloading https://pypi.doubanio.com/packages/5c/a1/a3dd9d8bfa09156ec2cba37f90accf35c0f4ecc3980d96cb4fb99e56504b/celery-4.3.0-py2.py3-none-any.whl (413kB)
100% |████████████████████████████████| 419kB 11.4MB/s
Collecting gunicorn (from superset)
Downloading https://pypi.doubanio.com/packages/8c/da/b8dd8deb741bff556db53902d4706774c8e1e67265f69528c14c003644e6/gunicorn-19.9.0-py2.py3-none-any.whl (112kB)
100% |████████████████████████████████| 122kB 10.2MB/s
Collecting thrift>=0.9.3 (from superset)
Collecting botocore<1.8.0,>=1.7.0 (from superset)
Downloading https://pypi.doubanio.com/packages/78/07/88ef02fca320ff8f61a5c8f46739f72e715f8745c9ddbf59fc5dba43db1a/botocore-1.7.48-py2.py3-none-any.whl (3.7MB)
100% |████████████████████████████████| 3.7MB 6.0MB/s
Collecting parsedatetime (from superset)
Collecting boto3==1.4.7 (from superset)
Using cached https://pypi.doubanio.com/packages/e0/7c/ed4ddcaa65dadba5992fba71b0cd221181f189dd87ac975d25d33c190a61/boto3-1.4.7-py2.py3-none-any.whl
Collecting unicodecsv (from superset)
Collecting sqlparse (from superset)
Downloading https://pypi.doubanio.com/packages/ef/53/900f7d2a54557c6a37886585a91336520e5539e3ae2423ff1102daf4f3a7/sqlparse-0.3.0-py2.py3-none-any.whl
Collecting future<0.17,>=0.16.0 (from superset)
Collecting requests (from superset)
Downloading https://pypi.doubanio.com/packages/7d/e3/20f3d364d6c8e5d2353c72a67778eb189176f08e873c9900e10c0287b84b/requests-2.21.0-py2.py3-none-any.whl (57kB)
100% |████████████████████████████████| 61kB 2.2MB/s
Collecting isodate (from superset)
Downloading https://pypi.doubanio.com/packages/9b/9f/b36f7774ff5ea8e428fdcfc4bb332c39ee5b9362ddd3d40d9516a55221b2/isodate-0.6.0-py2.py3-none-any.whl (45kB)
100% |████████████████████████████████| 51kB 3.9MB/s
Collecting bleach (from superset)
Downloading https://pypi.doubanio.com/packages/ab/05/27e1466475e816d3001efb6e0a85a819be17411420494a1e602c36f8299d/bleach-3.1.0-py2.py3-none-any.whl (157kB)
100% |████████████████████████████████| 163kB 7.9MB/s
Collecting asn1crypto>=0.21.0 (from cryptography->superset)
Downloading https://pypi.doubanio.com/packages/ea/cd/35485615f45f30a510576f1a56d1e0a7ad7bd8ab5ed7cdc600ef7cd06222/asn1crypto-0.24.0-py2.py3-none-any.whl (101kB)
100% |████████████████████████████████| 102kB 7.9MB/s
Collecting six>=1.4.1 (from cryptography->superset)
Downloading https://pypi.doubanio.com/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Collecting cffi!=1.11.3,>=1.8 (from cryptography->superset)
Downloading https://pypi.doubanio.com/packages/18/dd/3936f31df9d4c6e07d7dbbee2bda3ebde49c20e0ff9364c753601cd4b4bd/cffi-1.12.2-cp37-cp37m-win_amd64.whl (170kB)
100% |████████████████████████████████| 174kB 7.3MB/s
Collecting geographiclib<2,>=1.49 (from geopy->superset)
Collecting rfc3986<2.0,>=1.1.0 (from tableschema->superset)
Downloading https://pypi.doubanio.com/packages/e1/59/1d547e9e5e1bf8074951067c3d6b31a2e29fd5b49bd7d32e53ff0da6406c/rfc3986-1.2.0-py2.py3-none-any.whl
Collecting jsonschema<3.0,>=2.5 (from tableschema->superset)
Downloading https://pypi.doubanio.com/packages/77/de/47e35a97b2b05c2fadbec67d44cfcdcd09b8086951b331d82de90d2912da/jsonschema-2.6.0-py2.py3-none-any.whl
Collecting tabulator<2.0,>=1.3 (from tableschema->superset)
Downloading https://pypi.doubanio.com/packages/e2/ba/4ddcb032e268553a74e51c3603c60fbc856e3b1e25f43c0df6e4ef1582d8/tabulator-1.19.0-py2.py3-none-any.whl (51kB)
100% |████████████████████████████████| 61kB 3.6MB/s
Requirement already satisfied: setuptools>=36 in d:\programdata\anaconda3\envs\superset\lib\site-packages (from markdown>=3.0->superset) (41.0.0)
Collecting pytz>=2011k (from pandas>=0.18.0->superset)
Downloading https://pypi.doubanio.com/packages/61/28/1d3920e4d1d50b19bc5d24398a7cd85cc7b9a75a490570d5a30c57622d34/pytz-2018.9-py2.py3-none-any.whl (510kB)
100% |████████████████████████████████| 512kB 6.4MB/s
Collecting numpy>=1.12.0 (from pandas>=0.18.0->superset)
Downloading https://pypi.doubanio.com/packages/3a/3c/515afabfe4f29bfc0a67037efaf518c33d0076b32d22ba865241cee295c4/numpy-1.16.2-cp37-cp37m-win_amd64.whl (11.9MB)
100% |████████████████████████████████| 11.9MB 6.4MB/s
Collecting Flask-OpenID<2,>=1.2.5 (from flask-appbuilder>=1.12.1->superset)
Collecting PyJWT>=1.7.1 (from flask-appbuilder>=1.12.1->superset)
Downloading https://pypi.doubanio.com/packages/87/8b/6a9f14b5f781697e51259d81657e6048fd31a113229cf346880bb7545565/PyJWT-1.7.1-py2.py3-none-any.whl
Collecting Flask-Login<0.5,>=0.3 (from flask-appbuilder>=1.12.1->superset)
Collecting Flask-Babel<1,>=0.11.1 (from flask-appbuilder>=1.12.1->superset)
Collecting Flask-SQLAlchemy<3,>=2.3 (from flask-appbuilder>=1.12.1->superset)
Using cached https://pypi.doubanio.com/packages/a1/44/294fb7f6bf49cc7224417cd0637018db9fee0729b4fe166e43e2bbb1f1c8/Flask_SQLAlchemy-2.3.2-py2.py3-none-any.whl
Collecting itsdangerous>=0.21 (from flask<1.0.0->superset)
Downloading https://pypi.doubanio.com/packages/76/ae/44b03b253d6fade317f32c24d100b3b35c2239807046a4c953c7b89fa49e/itsdangerous-1.1.0-py2.py3-none-any.whl
Collecting Jinja2>=2.4 (from flask<1.0.0->superset)
Downloading https://pypi.doubanio.com/packages/1d/e7/fd8b501e7a6dfe492a433deb7b9d833d39ca74916fa8bc63dd1a4947a671/Jinja2-2.10.1-py2.py3-none-any.whl (124kB)
100% |████████████████████████████████| 133kB 9.3MB/s
Collecting Werkzeug>=0.7 (from flask<1.0.0->superset)
Downloading https://pypi.doubanio.com/packages/18/79/84f02539cc181cdbf5ff5a41b9f52cae870b6f632767e43ba6ac70132e92/Werkzeug-0.15.2-py2.py3-none-any.whl (328kB)
100% |████████████████████████████████| 337kB 6.0MB/s
Collecting pure-sasl>=0.3.0 (from thrift-sasl>=0.2.1->superset)
Collecting babel<3.0.0,>=1.0 (from flower->superset)
Downloading https://pypi.doubanio.com/packages/b8/ad/c6f60602d3ee3d92fbed87675b6fb6a6f9a38c223343ababdb44ba201f10/Babel-2.6.0-py2.py3-none-any.whl (8.1MB)
100% |████████████████████████████████| 8.1MB 10.2MB/s
Collecting tornado<6.0.0,>=4.2.0 (from flower->superset)
Downloading https://pypi.doubanio.com/packages/d7/d5/99aff77c15da335e3dbf30254b304a526494dca8e51b4b47419772e35a4e/tornado-5.1.1-cp37-cp37m-win_amd64.whl (455kB)
100% |████████████████████████████████| 460kB 9.3MB/s
Collecting alembic>=0.7 (from flask-migrate->superset)
Collecting WTForms (from flask-wtf->superset)
Downloading https://pypi.doubanio.com/packages/9f/c8/dac5dce9908df1d9d48ec0e26e2a250839fa36ea2c602cc4f85ccfeb5c65/WTForms-2.2.1-py2.py3-none-any.whl (166kB)
100% |████████████████████████████████| 174kB 6.4MB/s
Collecting billiard<4.0,>=3.6.0 (from celery>=4.2.0->superset)
Downloading https://pypi.doubanio.com/packages/3c/a0/5a01bed569cf1af8fcdd4294590acb980a2788d1594f4ccd678b6fea8644/billiard-3.6.0.0.tar.gz (151kB)
100% |████████████████████████████████| 153kB 5.7MB/s
Collecting kombu<5.0,>=4.4.0 (from celery>=4.2.0->superset)
Downloading https://pypi.doubanio.com/packages/b7/af/1914e93314f1b98756d5c5e366193124a0ffaab0e6d0e51e0f6f65fa851d/kombu-4.5.0-py2.py3-none-any.whl (185kB)
100% |████████████████████████████████| 194kB 10.2MB/s
Collecting vine>=1.3.0 (from celery>=4.2.0->superset)
Downloading https://pypi.doubanio.com/packages/7f/60/82c03047396126c8331ceb64da1dc52d4f1317209f32e8fe286d0c07365a/vine-1.3.0-py2.py3-none-any.whl
Collecting jmespath<1.0.0,>=0.7.1 (from botocore<1.8.0,>=1.7.0->superset)
Downloading https://pypi.doubanio.com/packages/83/94/7179c3832a6d45b266ddb2aac329e101367fbdb11f425f13771d27f225bb/jmespath-0.9.4-py2.py3-none-any.whl
Collecting docutils>=0.10 (from botocore<1.8.0,>=1.7.0->superset)
Downloading https://pypi.doubanio.com/packages/36/fa/08e9e6e0e3cbd1d362c3bbee8d01d0aedb2155c4ac112b19ef3cae8eed8d/docutils-0.14-py3-none-any.whl (543kB)
100% |████████████████████████████████| 552kB 6.8MB/s
Collecting s3transfer<0.2.0,>=0.1.10 (from boto3==1.4.7->superset)
Using cached https://pypi.doubanio.com/packages/d7/14/2a0004d487464d120c9fb85313a75cd3d71a7506955be458eebfe19a6b1d/s3transfer-0.1.13-py2.py3-none-any.whl
Collecting urllib3<1.25,>=1.21.1 (from requests->superset)
Downloading https://pypi.doubanio.com/packages/62/00/ee1d7de624db8ba7090d1226aebefab96a2c71cd5cfa7629d6ad3f61b79e/urllib3-1.24.1-py2.py3-none-any.whl (118kB)
100% |████████████████████████████████| 122kB 7.3MB/s
Requirement already satisfied: certifi>=2017.4.17 in d:\programdata\anaconda3\envs\superset\lib\site-packages (from requests->superset) (2019.3.9)
Collecting chardet<3.1.0,>=3.0.2 (from requests->superset)
Using cached https://pypi.doubanio.com/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl
Collecting webencodings (from bleach->superset)
Downloading https://pypi.doubanio.com/packages/f4/24/2a3e3df732393fed8b3ebf2ec078f05546de641fe1b667ee316ec1dcf3b7/webencodings-0.5.1-py2.py3-none-any.whl
Collecting pycparser (from cffi!=1.11.3,>=1.8->cryptography->superset)
Collecting openpyxl<2.5,>=2.4 (from tabulator<2.0,>=1.3->tableschema->superset)
Collecting xlrd<2.0,>=1.0 (from tabulator<2.0,>=1.3->tableschema->superset)
Downloading https://pypi.doubanio.com/packages/b0/16/63576a1a001752e34bf8ea62e367997530dc553b689356b9879339cf45a4/xlrd-1.2.0-py2.py3-none-any.whl (103kB)
100% |████████████████████████████████| 112kB 9.3MB/s
Collecting jsonlines<2.0,>=1.1 (from tabulator<2.0,>=1.3->tableschema->superset)
Downloading https://pypi.doubanio.com/packages/4f/9a/ab96291470e305504aa4b7a2e0ec132e930da89eb3ca7a82fbe03167c131/jsonlines-1.2.0-py2.py3-none-any.whl
Collecting linear-tsv<2.0,>=1.0 (from tabulator<2.0,>=1.3->tableschema->superset)
Collecting ijson<3.0,>=2.0 (from tabulator<2.0,>=1.3->tableschema->superset)
Using cached https://pypi.doubanio.com/packages/7f/e9/8508c5f4987ba238a2b169e582c1f70a47272b22a2f1fb06b9318201bb9e/ijson-2.3-py2.py3-none-any.whl
Collecting cchardet<3.0,>=1.0 (from tabulator<2.0,>=1.3->tableschema->superset)
Downloading https://pypi.doubanio.com/packages/71/f8/561914ee99a16a215a7aaa50ae53bf3c04ec40bf074cdda77aebf9861a36/cchardet-2.1.4-cp37-cp37m-win_amd64.whl (92kB)
100% |████████████████████████████████| 102kB 4.3MB/s
Collecting python3-openid>=2.0 (from Flask-OpenID<2,>=1.2.5->flask-appbuilder>=1.12.1->superset)
Downloading https://pypi.doubanio.com/packages/bd/de/52c5699f52dcee3037db587196dcaf63ffedf5fbeba3183afe9b21a3a89f/python3_openid-3.1.0-py3-none-any.whl (130kB)
100% |████████████████████████████████| 133kB 4.9MB/s
Collecting MarkupSafe>=0.23 (from Jinja2>=2.4->flask<1.0.0->superset)
Downloading https://pypi.doubanio.com/packages/65/c6/2399700d236d1dd681af8aebff1725558cddfd6e43d7a5184a675f4711f5/MarkupSafe-1.1.1-cp37-cp37m-win_amd64.whl
Collecting python-editor>=0.3 (from alembic>=0.7->flask-migrate->superset)
Downloading https://pypi.doubanio.com/packages/c6/d3/201fc3abe391bbae6606e6f1d598c15d367033332bd54352b12f35513717/python_editor-1.0.4-py3-none-any.whl
Collecting Mako (from alembic>=0.7->flask-migrate->superset)
Collecting amqp<3.0,>=2.4.0 (from kombu<5.0,>=4.4.0->celery>=4.2.0->superset)
Downloading https://pypi.doubanio.com/packages/42/ec/cbbaa8f75be8cbd019afb9d63258e2bdc95242f8c46a54bb90db5fef03bd/amqp-2.4.2-py2.py3-none-any.whl (49kB)
100% |████████████████████████████████| 51kB 2.4MB/s
Collecting et-xmlfile (from openpyxl<2.5,>=2.4->tabulator<2.0,>=1.3->tableschema->superset)
Collecting jdcal (from openpyxl<2.5,>=2.4->tabulator<2.0,>=1.3->tableschema->superset)
Downloading https://pypi.doubanio.com/packages/a0/38/dcf83532480f25284f3ef13f8ed63e03c58a65c9d3ba2a6a894ed9497207/jdcal-1.4-py2.py3-none-any.whl
Collecting defusedxml (from python3-openid>=2.0->Flask-OpenID<2,>=1.2.5->flask-appbuilder>=1.12.1->superset)
Downloading https://pypi.doubanio.com/packages/87/1c/17f3e3935a913dfe2a5ca85fa5ccbef366bfd82eb318b1f75dadbf0affca/defusedxml-0.5.0-py2.py3-none-any.whl
Building wheels for collected packages: sqlalchemy, python-geohash, billiard
Building wheel for sqlalchemy (setup.py) ... done
Stored in directory: C:\Users\fanke\AppData\Local\pip\Cache\wheels\fe\56\38\b17bae00bb1bc421538c2c55466cea6b07c9330617c30eaee6
Building wheel for python-geohash (setup.py) ... done
Stored in directory: C:\Users\fanke\AppData\Local\pip\Cache\wheels\8e\0d\19\2e054c45396a0f8d90ae1d4a02cb3487ab2cf82a44430ce516
Building wheel for billiard (setup.py) ... done
Stored in directory: C:\Users\fanke\AppData\Local\pip\Cache\wheels\d8\e6\de\f371db848ddfeaf654a7efb3b1c92b94c9664284036b774101
Successfully built sqlalchemy python-geohash billiard
Installing collected packages: asn1crypto, six, pycparser, cffi, cryptography, colorama, itsdangerous, MarkupSafe, Jinja2, Werkzeug, click, flask, flask-compress, geographiclib, geopy, simplejson, unicodecsv, rfc3986, python-dateutil, jsonschema, isodate, urllib3, chardet, idna, requests, et-xmlfile, jdcal, openpyxl, xlrd, sqlalchemy, jsonlines, linear-tsv, ijson, cchardet, tabulator, tableschema, markdown, pathlib2, future, pyhive, pytz, numpy, pandas, flask-caching, humanize, defusedxml, python3-openid, Flask-OpenID, PyJWT, WTForms, flask-wtf, Flask-Login, babel, Flask-Babel, Flask-SQLAlchemy, flask-appbuilder, unidecode, python-geohash, thrift, pure-sasl, thrift-sasl, polyline, contextlib2, sqlalchemy-utils, billiard, vine, amqp, kombu, celery, tornado, flower, python-editor, Mako, alembic, flask-migrate, pydruid, pyyaml, gunicorn, jmespath, docutils, botocore, parsedatetime, s3transfer, boto3, sqlparse, webencodings, bleach, superset
Successfully installed Flask-Babel-0.12.2 Flask-Login-0.4.1 Flask-OpenID-1.2.5 Flask-SQLAlchemy-2.3.2 Jinja2-2.10.1 Mako-1.0.8 MarkupSafe-1.1.1 PyJWT-1.7.1 WTForms-2.2.1 Werkzeug-0.15.2 alembic-1.0.8 amqp-2.4.2 asn1crypto-0.24.0 babel-2.6.0 billiard-3.6.0.0 bleach-3.1.0 boto3-1.4.7 botocore-1.7.48 cchardet-2.1.4 celery-4.3.0 cffi-1.12.2 chardet-3.0.4 click-6.7 colorama-0.3.9 contextlib2-0.5.5 cryptography-2.6.1 defusedxml-0.5.0 docutils-0.14 et-xmlfile-1.0.1 flask-0.12.4 flask-appbuilder-1.12.5 flask-caching-1.7.0 flask-compress-1.4.0 flask-migrate-2.4.0 flask-wtf-0.14.2 flower-0.9.3 future-0.16.0 geographiclib-1.49 geopy-1.19.0 gunicorn-19.9.0 humanize-0.5.1 idna-2.8 ijson-2.3 isodate-0.6.0 itsdangerous-1.1.0 jdcal-1.4 jmespath-0.9.4 jsonlines-1.2.0 jsonschema-2.6.0 kombu-4.5.0 linear-tsv-1.1.0 markdown-3.1 numpy-1.16.2 openpyxl-2.4.11 pandas-0.24.2 parsedatetime-2.4 pathlib2-2.3.3 polyline-1.3.2 pure-sasl-0.6.1 pycparser-2.19 pydruid-0.5.2 pyhive-0.6.1 python-dateutil-2.8.0 python-editor-1.0.4 python-geohash-0.8.5 python3-openid-3.1.0 pytz-2018.9 pyyaml-5.1 requests-2.21.0 rfc3986-1.2.0 s3transfer-0.1.13 simplejson-3.16.0 six-1.12.0 sqlalchemy-1.3.2 sqlalchemy-utils-0.33.11 sqlparse-0.3.0 superset-0.28.1 tableschema-1.3.3 tabulator-1.19.0 thrift-0.11.0 thrift-sasl-0.3.0 tornado-5.1.1 unicodecsv-0.14.1 unidecode-1.0.23 urllib3-1.24.1 vine-1.3.0 webencodings-0.5.1 xlrd-1.2.0
初始化superset
官方步骤如下,但是完全扯淡,全是坑。
# 创建管理员账号
fabmanager create-admin --app superset
# 初始化数据库
superset db upgrade
# 载入案例数据
superset load_examples
# 初始化角色和权限
superset init
# 启动服务,端口号 8088,使用 -p 更改端口号
superset runserver
1.第一步出现的问题
>fabmanager create-admin --app superset
Username [admin]: fankenan
User first name [admin]: fan
User last name [user]: kenan
Email [admin@fab.org]: fankenan@126.com
Password:
Repeat for confirmation:
Was unable to import superset Error: cannot import name '_maybe_box_datetimelike' from 'pandas.core.common'
(d:\programdata\anaconda3\envs\superset\lib\site-packages\pandas\core\common.py)
解决方法:
找到上面第九行的路径中的文件,搜索'maybe_box_datetimelike',在最前面加上'_',保存后,重新运行命令:
>fabmanager create-admin --app superset
Username [admin]: 1
User first name [admin]: 1
User last name [user]: 1
Email [admin@fab.org]: a@b.com
Password:
Repeat for confirmation:
Recognized Database Authentications.
2019-04-08 22:14:16,437:ERROR:flask_appbuilder.security.sqla.manager:Error adding new user to database. (sqlite3.IntegrityError) UNIQUE constraint failed: ab_user.email
[SQL: INSERT INTO ab_user (first_name, last_name, username, password, active, email, last_login, login_count, fail_login_count, created_on, changed_on, created_by_fk, changed_by_fk) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]
[parameters: ('1', '1', '1', 'pbkdf2:sha256:150000$60Pb5zvk$4c95de37734363679b5b0d74da82765e97bbebf3a2b63c390e45a6beab73f57c', 1, 'a@b.com', None, None, None, '2019-04-08 22:14:16.437471', '2019-04-08 22:14:16.437471', None, None)]
(Background on this error at: http://sqlalche.me/e/gkpj)
No user created an error occured
2.第二步出现的问题:
>superset db upgrade
'superset' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
解决方法:cd到superset的bin目录后运行。
(superset) d:\ProgramData\Anaconda3\envs\superset\Lib\site-packages\superset\bin>
命令前加'python',后几个命令一样。
>python superset db upgrade
INFO [alembic.runtime.migration] Context impl SQLiteImpl.
INFO [alembic.runtime.migration] Will assume transactional DDL.
INFO [alembic.runtime.migration] Running upgrade bddc498dd179 -> 4451805bbaa1, remove double percents
Traceback (most recent call last):
File "superset", line 15, in <module>
cli()
File "D:\ProgramData\Anaconda3\envs\superset\lib\site-packages\click\core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "D:\ProgramData\Anaconda3\envs\superset\lib\site-packages\flask\cli.py", line 380, in main
return AppGroup.main(self, *args, **kwargs)
File "D:\ProgramData\Anaconda3\envs\superset\lib\site-packages\click\core.py", line 697, in main
rv = self.invoke(ctx)
File "D:\ProgramData\Anaconda3\envs\superset\lib\site-packages\click\core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "D:\ProgramData\Anaconda3\envs\superset\lib\site-packages\click\core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "D:\ProgramData\Anaconda3\envs\superset\lib\site-packages\click\core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "D:\ProgramData\Anaconda3\envs\superset\lib\site-packages\click\core.py", line 535, in invoke
return callback(*args, **kwargs)
File "D:\ProgramData\Anaconda3\envs\superset\lib\site-packages\click\decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "D:\ProgramData\Anaconda3\envs\superset\lib\site-packages\flask\cli.py", line 257, in decorator
return __ctx.invoke(f, *args, **kwargs)
File "D:\ProgramData\Anaconda3\envs\superset\lib\site-packages\click\core.py", line 535, in invoke
return callback(*args, **kwargs)
File "D:\ProgramData\Anaconda3\envs\superset\lib\site-packages\flask_migrate\cli.py", line 134, in upgrade
_upgrade(directory, revision, sql, tag, x_arg)
File "D:\ProgramData\Anaconda3\envs\superset\lib\site-packages\flask_migrate\__init__.py", line 95, in wrapped
f(*args, **kwargs)
File "D:\ProgramData\Anaconda3\envs\superset\lib\site-packages\flask_migrate\__init__.py", line 280, in upgrade
command.upgrade(config, revision, sql=sql, tag=tag)
File "D:\ProgramData\Anaconda3\envs\superset\lib\site-packages\alembic\command.py", line 276, in upgrade
script.run_env()
File "D:\ProgramData\Anaconda3\envs\superset\lib\site-packages\alembic\script\base.py", line 475, in run_env
util.load_python_file(self.dir, "env.py")
File "D:\ProgramData\Anaconda3\envs\superset\lib\site-packages\alembic\util\pyfiles.py", line 90, in load_python_file
module = load_module_py(module_id, path)
File "D:\ProgramData\Anaconda3\envs\superset\lib\site-packages\alembic\util\compat.py", line 156, in load_module_py
spec.loader.exec_module(module)
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "D:\ProgramData\Anaconda3\envs\superset\lib\site-packages\superset/migrations\env.py", line 100, in <module>
run_migrations_online()
File "D:\ProgramData\Anaconda3\envs\superset\lib\site-packages\superset/migrations\env.py", line 93, in run_migrations_online
context.run_migrations()
File "<string>", line 8, in run_migrations
File "D:\ProgramData\Anaconda3\envs\superset\lib\site-packages\alembic\runtime\environment.py", line 839, in run_migrations
self.get_context().run_migrations(**kw)
File "D:\ProgramData\Anaconda3\envs\superset\lib\site-packages\alembic\runtime\migration.py", line 361, in run_migrations
step.migration_fn(**kw)
File "D:\ProgramData\Anaconda3\envs\superset\lib\site-packages\superset\migrations\versions\4451805bbaa1_remove_double_percents.py", line 82, in upgrade
replace('%%', '%')
File "D:\ProgramData\Anaconda3\envs\superset\lib\site-packages\superset\migrations\versions\4451805bbaa1_remove_double_percents.py", line 53, in replace
.join(Table)
File "D:\ProgramData\Anaconda3\envs\superset\lib\site-packages\sqlalchemy\orm\query.py", line 2235, in join
from_joinpoint=from_joinpoint,
File "<string>", line 2, in _join
File "D:\ProgramData\Anaconda3\envs\superset\lib\site-packages\sqlalchemy\orm\base.py", line 220, in generate
fn(self, *args[1:], **kw)
File "D:\ProgramData\Anaconda3\envs\superset\lib\site-packages\sqlalchemy\orm\query.py", line 2414, in _join
left, right, onclause, prop, create_aliases, outerjoin, full
File "D:\ProgramData\Anaconda3\envs\superset\lib\site-packages\sqlalchemy\orm\query.py", line 2437, in _join_left_to_right
) = self._join_determine_implicit_left_side(left, right, onclause)
File "D:\ProgramData\Anaconda3\envs\superset\lib\site-packages\sqlalchemy\orm\query.py", line 2568, in _join_determine_implicit_left_side
"Can't determine which FROM clause to join "
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 uninstall SQLAlchemy
Uninstalling SQLAlchemy-1.3.2:
Would remove:
d:\programdata\anaconda3\envs\superset\lib\site-packages\sqlalchemy-1.3.2.dist-info\*
d:\programdata\anaconda3\envs\superset\lib\site-packages\sqlalchemy\*
Proceed (y/n)? y
Successfully uninstalled SQLAlchemy-1.3.2
>pip install SQLAlchemy==1.2 -i https://pypi.douban.com/simple
Looking in indexes: https://pypi.douban.com/simple
Collecting SQLAlchemy==1.2
Downloading https://pypi.doubanio.com/packages/be/d1/0008f4ee8d8eaae328efbf9cc513c1bee6f6793de11ab82cb31b3045ee06/SQLAlchemy-1.2.0.tar.gz (5.5MB)
100% |████████████████████████████████| 5.5MB 6.0MB/s
Building wheels for collected packages: SQLAlchemy
Building wheel for SQLAlchemy (setup.py) ... done
Stored in directory: C:\Users\fanke\AppData\Local\pip\Cache\wheels\06\66\0d\469ed25b444a4666f93c1a1d25668c1a3e0709cee72ea355b9
Successfully built SQLAlchemy
Installing collected packages: SQLAlchemy
Successfully installed SQLAlchemy-1.2.0
然后重新初始化数据库。
>python superset db upgrade
INFO [alembic.runtime.migration] Context impl SQLiteImpl.
INFO [alembic.runtime.migration] Will assume transactional DDL.
INFO [alembic.runtime.migration] Running upgrade bddc498dd179 -> 4451805bbaa1, remove double percents
INFO [alembic.runtime.migration] Running upgrade 4451805bbaa1, 1d9e835a84f9 -> 705732c70154, empty message
INFO [alembic.runtime.migration] Running upgrade 4451805bbaa1, 1d9e835a84f9 -> fc480c87706c, empty message
INFO [alembic.runtime.migration] Running upgrade fc480c87706c -> bebcf3fed1fe, Migrate dashboard position_json data from V1 to V2
scanning dashboard (1/4) >>>>
Skip converted dash_id: 1
scanning dashboard (2/4) >>>>
Skip converted dash_id: 2
scanning dashboard (3/4) >>>>
Skip converted dash_id: 3
scanning dashboard (4/4) >>>>
Skip converted dash_id: 4
INFO [alembic.runtime.migration] Running upgrade bebcf3fed1fe, 705732c70154 -> ec1f88a35cc6, empty message
INFO [alembic.runtime.migration] Running upgrade 4451805bbaa1, 1d9e835a84f9 -> e3970889f38e, empty message
INFO [alembic.runtime.migration] Running upgrade 705732c70154, e3970889f38e -> 46ba6aaaac97, empty message
INFO [alembic.runtime.migration] Running upgrade 46ba6aaaac97, ec1f88a35cc6 -> c18bd4186f15, empty message
INFO [alembic.runtime.migration] Running upgrade c18bd4186f15 -> 7fcdcde0761c, Reduce position_json size by remove extra space and component id prefix
dash id:1 position_json size from 4931 to 2757
dash id:2 position_json size from 5701 to 3226
dash id:3 position_json size from 4009 to 2285
dash id:4 position_json size from 3016 to 1643
INFO [alembic.runtime.migration] Running upgrade 7fcdcde0761c -> 0c5070e96b57, add user attributes table
INFO [alembic.runtime.migration] Running upgrade 0c5070e96b57 -> 1a1d627ebd8e, position_json
INFO [alembic.runtime.migration] Running upgrade 1a1d627ebd8e -> 55e910a74826, add_metadata_column_to_annotation_model.py
3.前面问题只要解决,后面两个命令一般都没什么问题。
4.启动superset服务,要在最后加'-d'。
>python superset runserver -d
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Starting Superset server in DEBUG mode
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
2019-04-08 22:37:04,969:INFO:werkzeug: * Restarting with stat
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Starting Superset server in DEBUG mode
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
2019-04-08 22:37:08,855:WARNING:werkzeug: * Debugger is active!
2019-04-08 22:37:08,884:INFO:werkzeug: * Debugger PIN: 144-669-782
2019-04-08 22:37:09,803:INFO:werkzeug: * Running on http://0.0.0.0:8088/ (Press CTRL+C to quit)
最后在浏览器输入:http://localhost:8088即可访问。