superset 0.35.1 druid error: name 'PyDruid' is not defined - druid

I have installed superset 0.35.1 and pydruid module. in python, i can load pydruid sucessfully.
[root#xxx superset]# python
Python 3.6.5 (default, Nov 13 2019, 15:24:35)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pydruid
However in superset, it raised below error when connect to localhost druid.
Any advice?

Related

How to configure Jupyter console ports

I'm trying to run jupyter console in a Linux docker image, and connect to from the host OS (Windows). To do this, I must specify the used ports so that docker publishes them. I cannot use --network host, since my host OS is Windows (docs). So I must know before hand which ports to publish. I have tried a few approaches, but none of them seem to work:
$ jupyter console --shell=6001 --iopub=6002 --stdin=6003 --control=6004 --hb=6005
Jupyter console 6.4.3
Python 3.7.12 | packaged by conda-forge | (default, Oct 26 2021, 06:08:53)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.31.1 -- An enhanced Interactive Python. Type '?' for help.
In [1]: %connect_info
{
"shell_port": 41847,
"iopub_port": 36575,
"stdin_port": 43621,
"control_port": 49365,
"hb_port": 41115,
"ip": "127.0.0.1",
"key": "f1c2fc92-1e1ac00bfa0797516ce51331",
"transport": "tcp",
"signature_scheme": "hmac-sha256",
"kernel_name": ""
}
And:
$ jupyter console --generate-config
Writing default config to: /root/.jupyter/jupyter_console_config.py
$ nano /root/.jupyter/jupyter_console_config.py # Configure c.ConnectionFileMixin.control_port etc.
$ jupyter console
Jupyter console 6.4.3
Python 3.7.12 | packaged by conda-forge | (default, Oct 26 2021, 06:08:53)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.31.1 -- An enhanced Interactive Python. Type '?' for help.
In [1]: %connect_info
{
"shell_port": 40717,
"iopub_port": 49261,
"stdin_port": 46105,
"control_port": 47223,
"hb_port": 44913,
"ip": "127.0.0.1",
"key": "ee31c87f-ceb16a5b2c752085b9577677",
"transport": "tcp",
"signature_scheme": "hmac-sha256",
"kernel_name": ""
}
Any suggestions are welcome. I must say I'm a Jupyter beginner, I'm not even quite sure what is the difference between starting a console and a notebook. My goal is to run a Spyder IDE on Windows but execute the code (via an IPython session) inside the docker container.
Edit 1: I tested this on a different machine, and interestingly the command line arguments seem to work!
$ jupyter console --shell=6001 --iopub=6002 --stdin=6003 --control=6004 --hb=6005
Jupyter console 6.4.0
Python 3.8.0 (default, Nov 6 2019, 21:49:08)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.19.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: %connect_info
{
"shell_port": 6001,
"iopub_port": 6002,
"stdin_port": 6003,
"control_port": 6004,
"hb_port": 6005,
"ip": "127.0.0.1",
"key": "904874f1-cd228fd7436e99d56d83ac81",
"transport": "tcp",
"signature_scheme": "hmac-sha256",
"kernel_name": ""
}
Is this just a bug in the older version of jupyter / ipython?
Edit 2: Using newer Python and Jupyter on Linux doesn't seem to fix this:
# jupyter --version
Selected Jupyter core packages...
IPython : 8.6.0
ipykernel : 6.17.0
ipywidgets : 8.0.2
jupyter_client : 7.3.4
jupyter_core : 4.11.2
jupyter_server : 1.23.0
jupyterlab : 3.5.0
nbclient : 0.7.0
nbconvert : 7.2.3
nbformat : 5.7.0
notebook : 6.5.2
qtconsole : 5.4.0
traitlets : 5.5.0
# jupyter console --shell=6001 --iopub=6002 --stdin=6003 --control=6004 --hb=6005
Jupyter console 6.4.4
Python 3.9.13 (main, Oct 13 2022, 21:15:33)
Type 'copyright', 'credits' or 'license' for more information
IPython 8.6.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: %connect_info
{
"shell_port": 42637,
"iopub_port": 58425,
"stdin_port": 38171,
"control_port": 54103,
"hb_port": 52349,
"ip": "127.0.0.1",
"key": "b73514a7-0a23b4918cf72d63f13a0577",
"transport": "tcp",
"signature_scheme": "hmac-sha256",
"kernel_name": ""
}
Edit 3, yet an other test. This time on Windows:
>jupyter --version
Selected Jupyter core packages...
IPython : 8.6.0
ipykernel : 6.17.0
ipywidgets : 8.0.2
jupyter_client : 7.3.4
jupyter_core : 4.11.2
jupyter_server : 1.23.0
jupyterlab : not installed
nbclient : 0.7.0
nbconvert : 7.2.3
nbformat : 5.7.0
notebook : 6.5.2
qtconsole : 5.4.0
traitlets : 5.5.0
>jupyter console --shell=6001 --iopub=6002 --stdin=6003 --control=6004 --hb=6005
C:\vendor\Anaconda3\envs\tpa\lib\site-packages\zmq\_future.py:679: RuntimeWarning: Proactor event loop does not implement add_reader family of methods required for zmq. Registering an additional selector thread for add_reader support via tornado. Use `asyncio.set_event_loop_policy(WindowsSelectorEventLoopPolicy())` to avoid this warning.
self._get_loop()
Jupyter console 6.4.4
Python 3.9.13 (main, Oct 13 2022, 21:23:06) [MSC v.1916 64 bit (AMD64)]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.6.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: %connect_info
{
"shell_port": 4048,
"iopub_port": 4049,
"stdin_port": 4050,
"control_port": 4052,
"hb_port": 4051,
"ip": "127.0.0.1",
"key": "463250f7-86ba2e10420dbc3869f8f2ac",
"transport": "tcp",
"signature_scheme": "hmac-sha256",
"kernel_name": ""
}
I haven't yet figured out a pattern on when the port config is respected and when it isn't. :(

AML-S905X-CC (Le Potato). How to enable and use UART on 40 pin header as TTY

I want to use the UART on the 40 pin header (pins 8 and 10) of the AML-S905X-CC (Le Potato).
I have tried a couple of O/S like Raspbian Stretch Headless and Armbian, and while the boot and work fine, there seems to be no support for the on board UART on the 40 pin header.
I am happy to use any O/S which can provide this.
Do I need to use Device Tree Overlays to enable this?
If so, where can I download the devicetree overlay package and is there a tutorial or some documentation on the process.
If not, how can I use this onboard UART?
Thanks
This is what I do
ROOT###### ARNBIAN ONLY
wget https://raw.githubusercontent.com/libre-computer-project/libretech-overlays/for-4.13.y/overlays/meson-gxl-s905x-libretech-cc-i2c-ao.dts
sudo armbian-add-overlay meson-gxl-s905x-libretech-cc-i2c-ao.dts
end ROOT #####
If Ubuntu
git clone https://github.com/libre-computer-project/libretech-wiring-tool.git
cd libretech-wiring-tool
sudo make
It works for me:
wget https://raw.githubusercontent.com/libre-computer-project/libretech-overlays/for-4.13.y/overlays/meson-gxl-s905x-libretech-cc-uarta.dts
sudo armbian-add-overlay meson-gxl-s905x-libretech-cc-uarta.dts
python3 -m serial.tools.miniterm
--- Available ports:
--- Enter port index or full name:
Never port appears, but the uarta is working in /dev/ttyAML6.
python3
Python 3.10.6 (main, Nov 14 2022, 16:10:14) [GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import serial
>>> ser = serial.Serial()
>>> ser.baud = 9600
>>> ser.port = '/dev/ttyAML6'
>>> ser.open()
>>> ser.write(str.encode('test'))
4
>>>
Serial comm over the port /dev/ttyAML6 works!

How to solve "no such file or directory" when trying to run aarch64-gnu-linux-g++ (64-bit version) on 64-bit Ubuntu Linux O/S?

The title I think says it all. Originally I though it might be a 64-bit program running on a 32-bit O/S - not the case as far as I can see.
yoctoadm#kickseed:/ntg6src/source/packages/sdk_armv8/sysroots/x86_64-oesdk-linux/usr/bin/aarch64-gnu-linux$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.6 LTS
Release: 16.04
Codename: xenial
// uname -a output
yoctoadm#kickseed:/ntg6src/source/packages/sdk_armv8/sysroots/x86_64-oesdk-linux/usr/bin/aarch64-gnu-linux$ uname -a
Linux kickseed 4.4.0-165-generic #193-Ubuntu SMP Tue Sep 17 17:42:52 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
// file aarch64-gnu-linux-g++ output
yoctoadm#kickseed:/ntg6src/source/packages/sdk_armv8/sysroots/x86_64-oesdk-linux/usr/bin/aarch64-gnu-linux$ file aarch64-gnu-linux-g++
aarch64-gnu-linux-g++: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /ntg6sdk, for GNU/Linux 2.6.32, BuildID[sha1]=0bc9f03b2a2bee373f6ec3c85527230243579763, stripped
// no such file or directory error
yoctoadm#kickseed:/ntg6src/source/packages/sdk_armv8/sysroots/x86_64-oesdk-linux/usr/bin/aarch64-gnu-linux$ ls
aarch64-gnu-linux-addr2line aarch64-gnu-linux-dwp aarch64-gnu-linux-gcc-nm aarch64-gnu-linux-gdb aarch64-gnu-linux-nm aarch64-gnu-linux-size
aarch64-gnu-linux-ar aarch64-gnu-linux-elfedit aarch64-gnu-linux-gcc-ranlib aarch64-gnu-linux-gprof aarch64-gnu-linux-objcopy aarch64-gnu-linux-strings
aarch64-gnu-linux-as aarch64-gnu-linux-g++ aarch64-gnu-linux-gcov aarch64-gnu-linux-ld aarch64-gnu-linux-objdump aarch64-gnu-linux-strip
aarch64-gnu-linux-c++filt aarch64-gnu-linux-gcc aarch64-gnu-linux-gcov-dump aarch64-gnu-linux-ld.bfd aarch64-gnu-linux-ranlib
aarch64-gnu-linux-cpp aarch64-gnu-linux-gcc-ar aarch64-gnu-linux-gcov-tool aarch64-gnu-linux-ld.gold aarch64-gnu-linux-readelf
yoctoadm#kickseed:/ntg6src/source/packages/sdk_armv8/sysroots/x86_64-oesdk-linux/usr/bin/aarch64-gnu-linux$ ./aarch64-gnu-linux-g++
bash: ./aarch64-gnu-linux-g++: No such file or directory
The environment variables weren't setup correctly. It was necessary to "source" the environment file, which exports the correct environment variables.

Moviepy v1.0.1 and v1.0.0 not able to open unicode file name on Ubuntu. But Mac works

Tried to open file with unicode name on moviepy v1.0.0 and v1.0.1. Ubuntu does not work. Mac works.
Ubuntu:
Python 3.6.2 |Continuum Analytics, Inc.| (default, Jul 20 2017, 13:51:32)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from moviepy.video.io.VideoFileClip import VideoFileClip
>>> videopath='PSY - GANGNAM STYLE(강남스타일) M V.mp4'
>>> clip = VideoFileClip(videopath)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File ".../lib/python3.6/site-packages/moviepy/video/io/VideoFileClip.py", line 91, in __init__
fps_source=fps_source)
File ".../lib/python3.6/site-packages/moviepy/video/io/ffmpeg_reader.py", line 33, in __init__
fps_source)
File ".../lib/python3.6/site-packages/moviepy/video/io/ffmpeg_reader.py", line 276, in ffmpeg_parse_infos
"path.")%filename)
OSError: MoviePy error: the file PSY - GANGNAM STYLE(강남스타일) M V.mp4 could not be found!
Please check that you entered the correct path.
ffmpeg -version
ffmpeg version 4.1.3-0york1~14.04 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.4)
Mac:
Python 3.6.7 |Anaconda, Inc.| (default, Oct 23 2018, 14:01:38)
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from moviepy.video.io.VideoFileClip import VideoFileClip
>>> videopath='PSY - GANGNAM STYLE(강남스타일) M V.mp4'
>>> clip = VideoFileClip(videopath)
>>>
ffmpeg -version
ffmpeg version 4.1.3 Copyright (c) 2000-2019 the FFmpeg developers
built with Apple LLVM version 10.0.1 (clang-1001.0.46.3)
How to make moviepy to open unicode file name on Ubuntu?
Update: The issue is name. It looks the same when copy/paste, but it seems has different encoding.
>>> videopath1
'PSY - GANGNAM STYLE(강남스타일) M V.mp4'
>>> videopath
'PSY - GANGNAM STYLE(강남스타일) M V.mp4'
>>>
>>>
>>> clip = VideoFileClip(videopath1)
>>> clip = VideoFileClip(videopath)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "../lib/python3.6/site-packages/moviepy/video/io/VideoFileClip.py", line 91, in __init__
fps_source=fps_source)
File "../lib/python3.6/site-packages/moviepy/video/io/ffmpeg_reader.py", line 33, in __init__
fps_source)
File "../lib/python3.6/site-packages/moviepy/video/io/ffmpeg_reader.py", line 276, in ffmpeg_parse_infos
"path.")%filename)
OSError: MoviePy error: the file PSY - GANGNAM STYLE(강남스타일) M V.mp4 could not be found!
Please check that you entered the correct path.
For above 2 names, if copying to clipboard, somehow they are different. Therefore, it has nothing to do with moviepy.
Encoding is the same (namely UTF-8), the difference is that videopath1 is composed and videopath is decomposed.
"PSY - GANGNAM STYLE(\x{ac15}\x{b0a8}\x{c2a4}\x{d0c0}\x{c77c}) M V.mp4"
"PSY - GANGNAM STYLE(\x{1100}\x{1161}\x{11bc}\x{1102}\x{1161}\x{11b7}\x{1109}\x{1173}\x{1110}\x{1161}\x{110b}\x{1175}\x{11af}) M V.mp4"

getpass.getpass() hangs on ipython notebook

I am using very simple code on ipython notebook for user to input password. Command hangs after user inputs the password. Here is my code sample -
import getpass
try:
p = getpass.getpass()
except Exception as error:
print('ERROR', error)
else:
print('Password entered:', p)
I tried raw_input() as well, it hangs exactly the same way.
try:
p = raw_input()
except Exception as error:
print('ERROR', error)
else:
print('Password entered:', p)
Any idea what's the solution for this.
I am running jupyter notebook on AWS server. Here are the version details -
Python 2.7.13 |
Anaconda 2.5.0 (64-bit)| (default, Dec 20 2016, 23:09:15)
GCC 4.4.7 20120313
Red Hat 4.4.7-1
IPython.__version__ '4.0.3'