prestodb / f8-2019-demo Goto Github PK
View Code? Open in Web Editor NEWA tutorial on how to get started with Presto.
License: Apache License 2.0
A tutorial on how to get started with Presto.
License: Apache License 2.0
try to run this demo on Ubuntu 20.x and got this error:
Building wheel for mysqlclient (setup.py): started
Building wheel for mysqlclient (setup.py): finished with status 'error'
ERROR: Command errored out with exit status 1:
command: /opt/conda/bin/python3.9 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-gndxy7j_/mysqlclient_143f30c58ea04d90baba5b20790db32b/setup.py'"'"'; __file__='"'"'/tmp/pip-install-gndxy7j_/mysqlclient_143f30c58ea04d90baba5b20790db32b/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-m6cspcuc
cwd: /tmp/pip-install-gndxy7j_/mysqlclient_143f30c58ea04d90baba5b20790db32b/
Complete output (40 lines):
mysql_config --version
['8.0.26']
mysql_config --libs
['-L/usr/lib/x86_64-linux-gnu', '-lmysqlclient', '-lpthread', '-ldl', '-lz', '-lssl', '-lcrypto', '-lresolv', '-lm', '-lrt']
mysql_config --cflags
['-I/usr/include/mysql']
ext_options:
library_dirs: ['/usr/lib/x86_64-linux-gnu']
libraries: ['mysqlclient', 'pthread', 'dl', 'resolv', 'm', 'rt']
extra_compile_args: ['-std=c99']
extra_link_args: []
include_dirs: ['/usr/include/mysql']
extra_objects: []
define_macros: [('version_info', "(2,0,3,'final',0)"), ('__version__', '2.0.3')]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.9
creating build/lib.linux-x86_64-3.9/MySQLdb
copying MySQLdb/__init__.py -> build/lib.linux-x86_64-3.9/MySQLdb
copying MySQLdb/_exceptions.py -> build/lib.linux-x86_64-3.9/MySQLdb
copying MySQLdb/connections.py -> build/lib.linux-x86_64-3.9/MySQLdb
copying MySQLdb/converters.py -> build/lib.linux-x86_64-3.9/MySQLdb
copying MySQLdb/cursors.py -> build/lib.linux-x86_64-3.9/MySQLdb
copying MySQLdb/release.py -> build/lib.linux-x86_64-3.9/MySQLdb
copying MySQLdb/times.py -> build/lib.linux-x86_64-3.9/MySQLdb
creating build/lib.linux-x86_64-3.9/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.linux-x86_64-3.9/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-3.9/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-3.9/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-3.9/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-3.9/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-3.9/MySQLdb/constants
running build_ext
building 'MySQLdb._mysql' extension
creating build/temp.linux-x86_64-3.9
creating build/temp.linux-x86_64-3.9/MySQLdb
gcc -pthread -B /opt/conda/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /opt/conda/include -fPIC -O2 -isystem /opt/conda/include -fPIC -Dversion_info=(2,0,3,'final',0) -D__version__=2.0.3 -I/usr/include/mysql -I/opt/conda/include/python3.9 -c MySQLdb/_mysql.c -o build/temp.linux-x86_64-3.9/MySQLdb/_mysql.o -std=c99
error: command 'gcc' failed: No such file or directory
----------------------------------------
ERROR: Failed building wheel for mysqlclient
[+] Building 7.6s (7/8)
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 37B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/jupyter/scipy-notebook:latest 0.4s
=> [internal] load build context 0.0s
=> => transferring context: 36B 0.0s
=> [1/4] FROM docker.io/jupyter/scipy-notebook:latest@sha256:528d6ffa2017d1e943293ebabc967f08c90eb6523b9029d51c01f2c58e 0.0s
=> CACHED [2/4] RUN apt-get update -y && apt-get install -qy graphviz libmysqlclient-dev mongodb-clients mysql-client w 0.0s
=> ERROR [3/4] RUN pip install presto-python-client pyhive graphviz mysqlclient mongo 7.2s
=> [3/4] RUN pip install presto-python-client pyhive graphviz mysqlclient mongo:
#6 0.639 WARNING: The directory '/home/jovyan/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag.
#6 0.810 Collecting presto-python-client
#6 0.928 Downloading presto_python_client-0.8.2-py3-none-any.whl (22 kB)
#6 0.967 Collecting pyhive
#6 0.991 Downloading PyHive-0.6.4.tar.gz (44 kB)
#6 0.996 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 44.7/44.7 KB 43.6 MB/s eta 0:00:00
#6 1.011 Preparing metadata (setup.py): started
#6 1.278 Preparing metadata (setup.py): finished with status 'done'
#6 1.343 Collecting graphviz
#6 1.374 Downloading graphviz-0.19.1-py3-none-any.whl (46 kB)
#6 1.378 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 46.3/46.3 KB 131.0 MB/s eta 0:00:00
#6 1.436 Collecting mysqlclient
#6 1.455 Downloading mysqlclient-2.1.0.tar.gz (87 kB)
#6 1.461 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 87.6/87.6 KB 24.5 MB/s eta 0:00:00
#6 1.483 Preparing metadata (setup.py): started
#6 1.805 Preparing metadata (setup.py): finished with status 'done'
#6 1.842 Collecting mongo
#6 1.866 Downloading mongo-0.2.0.tar.gz (4.6 kB)
#6 1.871 Preparing metadata (setup.py): started
#6 2.110 Preparing metadata (setup.py): finished with status 'done'
#6 2.127 Requirement already satisfied: six in /opt/conda/lib/python3.9/site-packages (from presto-python-client) (1.16.0)
#6 2.128 Requirement already satisfied: requests in /opt/conda/lib/python3.9/site-packages (from presto-python-client) (2.27.1)
#6 2.128 Requirement already satisfied: click in /opt/conda/lib/python3.9/site-packages (from presto-python-client) (8.0.3)
#6 2.179 Collecting future
#6 2.203 Downloading future-0.18.2.tar.gz (829 kB)
#6 2.256 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 829.2/829.2 KB 16.7 MB/s eta 0:00:00
#6 2.371 Preparing metadata (setup.py): started
#6 2.661 Preparing metadata (setup.py): finished with status 'done'
#6 2.664 Requirement already satisfied: python-dateutil in /opt/conda/lib/python3.9/site-packages (from pyhive) (2.8.2)
#6 3.196 Collecting pymongo
#6 3.215 Downloading pymongo-4.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (459 kB)
#6 3.230 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 460.0/460.0 KB 41.1 MB/s eta 0:00:00
#6 3.268 Requirement already satisfied: idna<4,>=2.5 in /opt/conda/lib/python3.9/site-packages (from requests->presto-python-client) (3.3)
#6 3.269 Requirement already satisfied: certifi>=2017.4.17 in /opt/conda/lib/python3.9/site-packages (from requests->presto-python-client) (2021.10.8)
#6 3.271 Requirement already satisfied: charset-normalizer~=2.0.0 in /opt/conda/lib/python3.9/site-packages (from requests->presto-python-client) (2.0.12)
#6 3.272 Requirement already satisfied: urllib3<1.27,>=1.21.1 in /opt/conda/lib/python3.9/site-packages (from requests->presto-python-client) (1.26.8)
#6 3.288 Building wheels for collected packages: pyhive, mysqlclient, mongo, future
#6 3.289 Building wheel for pyhive (setup.py): started
#6 3.674 Building wheel for pyhive (setup.py): finished with status 'done'
#6 3.675 Created wheel for pyhive: filename=PyHive-0.6.4-py3-none-any.whl size=51509 sha256=e3d24b3765b81339b22b0ca1af6e303df12a6424ae6191b958348951522e010d
#6 3.675 Stored in directory: /tmp/pip-ephem-wheel-cache-mfc3k_te/wheels/f3/08/b7/f69118bf5bc07fbdb1f7d49a8993440da731996633483b2965
#6 3.678 Building wheel for mysqlclient (setup.py): started
#6 4.012 Building wheel for mysqlclient (setup.py): finished with status 'error'
#6 4.024 error: subprocess-exited-with-error
#6 4.024
#6 4.024 × python setup.py bdist_wheel did not run successfully.
#6 4.024 │ exit code: 1
#6 4.024 ╰─> [40 lines of output]
#6 4.024 mysql_config --version
#6 4.024 ['8.0.28']
#6 4.024 mysql_config --libs
#6 4.024 ['-L/usr/lib/x86_64-linux-gnu', '-lmysqlclient', '-lpthread', '-ldl', '-lz', '-lssl', '-lcrypto', '-lresolv', '-lm', '-lrt']
#6 4.024 mysql_config --cflags
#6 4.024 ['-I/usr/include/mysql']
#6 4.024 ext_options:
#6 4.024 library_dirs: ['/usr/lib/x86_64-linux-gnu']
#6 4.024 libraries: ['mysqlclient', 'pthread', 'dl', 'resolv', 'm', 'rt']
#6 4.024 extra_compile_args: ['-std=c99']
#6 4.024 extra_link_args: []
#6 4.024 include_dirs: ['/usr/include/mysql']
#6 4.024 extra_objects: []
#6 4.024 define_macros: [('version_info', "(2,1,0,'final',0)"), ('__version__', '2.1.0')]
#6 4.024 running bdist_wheel
#6 4.024 running build
#6 4.024 running build_py
#6 4.024 creating build
#6 4.024 creating build/lib.linux-x86_64-3.9
#6 4.024 creating build/lib.linux-x86_64-3.9/MySQLdb
#6 4.024 copying MySQLdb/__init__.py -> build/lib.linux-x86_64-3.9/MySQLdb
#6 4.024 copying MySQLdb/_exceptions.py -> build/lib.linux-x86_64-3.9/MySQLdb
#6 4.024 copying MySQLdb/connections.py -> build/lib.linux-x86_64-3.9/MySQLdb
#6 4.024 copying MySQLdb/converters.py -> build/lib.linux-x86_64-3.9/MySQLdb
#6 4.024 copying MySQLdb/cursors.py -> build/lib.linux-x86_64-3.9/MySQLdb
#6 4.024 copying MySQLdb/release.py -> build/lib.linux-x86_64-3.9/MySQLdb
#6 4.024 copying MySQLdb/times.py -> build/lib.linux-x86_64-3.9/MySQLdb
#6 4.024 creating build/lib.linux-x86_64-3.9/MySQLdb/constants
#6 4.024 copying MySQLdb/constants/__init__.py -> build/lib.linux-x86_64-3.9/MySQLdb/constants
#6 4.024 copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-3.9/MySQLdb/constants
#6 4.024 copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-3.9/MySQLdb/constants
#6 4.024 copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-3.9/MySQLdb/constants
#6 4.024 copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-3.9/MySQLdb/constants
#6 4.024 copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-3.9/MySQLdb/constants
#6 4.024 running build_ext
#6 4.024 building 'MySQLdb._mysql' extension
#6 4.024 creating build/temp.linux-x86_64-3.9
#6 4.024 creating build/temp.linux-x86_64-3.9/MySQLdb
#6 4.024 gcc -pthread -B /opt/conda/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /opt/conda/include -fPIC -O2 -isystem /opt/conda/include -fPIC -Dversion_info=(2,1,0,'final',0) -D__version__=2.1.0 -I/usr/include/mysql -I/opt/conda/include/python3.9 -c MySQLdb/_mysql.c -o build/temp.linux-x86_64-3.9/MySQLdb/_mysql.o -std=c99
#6 4.024 error: command 'gcc' failed: No such file or directory
#6 4.024 [end of output]
#6 4.024
#6 4.024 note: This error originates from a subprocess, and is likely not a problem with pip.
#6 4.027 Running setup.py clean for mysqlclient
#6 4.027 ERROR: Failed building wheel for mysqlclient
#6 4.294 Building wheel for mongo (setup.py): started
#6 4.633 Building wheel for mongo (setup.py): finished with status 'done'
#6 4.634 Created wheel for mongo: filename=mongo-0.2.0-py3-none-any.whl size=4951 sha256=c546fd397b3003964663a01f8f014e76e3c3cf48281c61f3ddbf65b441eb35f5
#6 4.634 Stored in directory: /tmp/pip-ephem-wheel-cache-mfc3k_te/wheels/da/c4/f9/f5fb27468b22997d044041d1d75d282a27762bd2157903b8ca
#6 4.637 Building wheel for future (setup.py): started
#6 5.198 Building wheel for future (setup.py): finished with status 'done'
#6 5.200 Created wheel for future: filename=future-0.18.2-py3-none-any.whl size=491070 sha256=290604a47bc0c0dcc572be23dd110264dda84b389ab2454bc08c3efab548b86b
#6 5.201 Stored in directory: /tmp/pip-ephem-wheel-cache-mfc3k_te/wheels/2f/a0/d3/4030d9f80e6b3be787f19fc911b8e7aa462986a40ab1e4bb94
#6 5.205 Successfully built pyhive mongo future
#6 5.206 Failed to build mysqlclient
#6 6.153 Installing collected packages: pymongo, mysqlclient, graphviz, future, pyhive, presto-python-client, mongo
#6 6.312 Running setup.py install for mysqlclient: started
#6 6.624 Running setup.py install for mysqlclient: finished with status 'error'
#6 6.630 error: subprocess-exited-with-error
#6 6.630
#6 6.630 × Running setup.py install for mysqlclient did not run successfully.
#6 6.630 │ exit code: 1
#6 6.630 ╰─> [42 lines of output]
#6 6.630 mysql_config --version
#6 6.630 ['8.0.28']
#6 6.630 mysql_config --libs
#6 6.630 ['-L/usr/lib/x86_64-linux-gnu', '-lmysqlclient', '-lpthread', '-ldl', '-lz', '-lssl', '-lcrypto', '-lresolv', '-lm', '-lrt']
#6 6.630 mysql_config --cflags
#6 6.630 ['-I/usr/include/mysql']
#6 6.630 ext_options:
#6 6.630 library_dirs: ['/usr/lib/x86_64-linux-gnu']
#6 6.630 libraries: ['mysqlclient', 'pthread', 'dl', 'resolv', 'm', 'rt']
#6 6.630 extra_compile_args: ['-std=c99']
#6 6.630 extra_link_args: []
#6 6.630 include_dirs: ['/usr/include/mysql']
#6 6.630 extra_objects: []
#6 6.630 define_macros: [('version_info', "(2,1,0,'final',0)"), ('__version__', '2.1.0')]
#6 6.630 running install
#6 6.630 /opt/conda/lib/python3.9/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
#6 6.630 warnings.warn(
#6 6.630 running build
#6 6.630 running build_py
#6 6.630 creating build
#6 6.630 creating build/lib.linux-x86_64-3.9
#6 6.630 creating build/lib.linux-x86_64-3.9/MySQLdb
#6 6.630 copying MySQLdb/__init__.py -> build/lib.linux-x86_64-3.9/MySQLdb
#6 6.630 copying MySQLdb/_exceptions.py -> build/lib.linux-x86_64-3.9/MySQLdb
#6 6.630 copying MySQLdb/connections.py -> build/lib.linux-x86_64-3.9/MySQLdb
#6 6.630 copying MySQLdb/converters.py -> build/lib.linux-x86_64-3.9/MySQLdb
#6 6.630 copying MySQLdb/cursors.py -> build/lib.linux-x86_64-3.9/MySQLdb
#6 6.630 copying MySQLdb/release.py -> build/lib.linux-x86_64-3.9/MySQLdb
#6 6.630 copying MySQLdb/times.py -> build/lib.linux-x86_64-3.9/MySQLdb
#6 6.630 creating build/lib.linux-x86_64-3.9/MySQLdb/constants
#6 6.630 copying MySQLdb/constants/__init__.py -> build/lib.linux-x86_64-3.9/MySQLdb/constants
#6 6.630 copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-3.9/MySQLdb/constants
#6 6.630 copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-3.9/MySQLdb/constants
#6 6.630 copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-3.9/MySQLdb/constants
#6 6.630 copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-3.9/MySQLdb/constants
#6 6.630 copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-3.9/MySQLdb/constants
#6 6.630 running build_ext
#6 6.630 building 'MySQLdb._mysql' extension
#6 6.630 creating build/temp.linux-x86_64-3.9
#6 6.630 creating build/temp.linux-x86_64-3.9/MySQLdb
#6 6.630 gcc -pthread -B /opt/conda/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /opt/conda/include -fPIC -O2 -isystem /opt/conda/include -fPIC -Dversion_info=(2,1,0,'final',0) -D__version__=2.1.0 -I/usr/include/mysql -I/opt/conda/include/python3.9 -c MySQLdb/_mysql.c -o build/temp.linux-x86_64-3.9/MySQLdb/_mysql.o -std=c99
#6 6.630 error: command 'gcc' failed: No such file or directory
#6 6.630 [end of output]
#6 6.630
#6 6.630 note: This error originates from a subprocess, and is likely not a problem with pip.
#6 6.634 error: legacy-install-failure
#6 6.634
#6 6.634 × Encountered error while trying to install package.
#6 6.634 ╰─> mysqlclient
#6 6.634
#6 6.634 note: This is an issue with the package mentioned above, not pip.
#6 6.634 hint: See above for output from the failure.
executor failed running [/bin/bash -o pipefail -c pip install presto-python-client pyhive graphviz mysqlclient mongo]: exit code: 1
ERROR: Service 'jupyter' failed to build : Build failed
I added sudo in line 17 of jupyter/Dockerfile
which might not have had any effect:
RUN sudo apt-get update -y && apt-get install -qy graphviz libmysqlclient-dev mongodb-clients mysql-client wget host
Then I a new line between lines 17 and 18 and it worked after this:
RUN sudo apt-get install -y gcc
Final jupyter/Dockerfile
:
# Copyright (c) Facebook, Inc. and its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM jupyter/scipy-notebook:latest
USER root
RUN sudo apt-get update -y && apt-get install -qy graphviz libmysqlclient-dev mongodb-clients mysql-client wget host
RUN sudo apt-get install -y gcc
RUN pip install presto-python-client pyhive graphviz mysqlclient mongo
COPY f8_demo.ipynb /home/jovyan/`
Posting here in case anyone else runs into this issue.
Currently the docker-compose configuration will create a working Presto cluster with MySQL and MongoDB but it does not load the data needed by the Jupyter Notebook demo.
Hi,
I m running the image and trying to query on hive but got this error :
Query 20201118_115940_00031_erddm failed: Failed connecting to Hive metastore: [hive:9083]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.