polynote 是netflix 開源的一個notebook 工具(支持scala,python,sql 。。。)
下載安裝包
https://github.com/polynote/polynote/releases
安裝python 依賴
- 基本
pip3 install jep jedi pyspark virtualenv
- 其他依賴安裝(建議為安裝)
numpy pandas
配置修改
默認配置config-template.yml
可以拷貝修改為config.yml
啟動
./polynote.py
效果
java -cp polynote.jar:polynote.jar:/Users/dalong/Downloads/polynote/deps/portable-scala-reflect_2.12-0.1.0.jar:/Users/dalong/Downloads/polynote/deps/scala-reflect-2.12.10.jar:/Users/dalong/Downloads/polynote/deps/polynote-runtime.jar:/Users/dalong/Downloads/polynote/deps/scala-collection-compat_2.12-2.1.1.jar:/Users/dalong/Downloads/polynote/deps/polynote-spark-runtime.jar:/Users/dalong/Downloads/polynote/deps/scala-compiler-2.12.10.jar:/Users/dalong/Downloads/polynote/deps/scala-library-2.12.10.jar:/Users/dalong/Downloads/polynote/deps/scala-xml_2.12-1.2.0.jar -Djava.library.path=/usr/local/lib/python3.7/site-packages/jep polynote.Main
[INFO] Loading configuration from config.yml
[INFO] Loaded configuration: PolynoteConfig(Listen(8192,127.0.0.1),Storage(tmp,notebooks,Map()),List(),List(),Map(),Map(),Behavior(true,Always,List()),Security(None),UI(/))
[WARN] Polynote allows arbitrary remote code execution, which is necessary for a notebook tool to function.
While we'll try to improve safety by adding security measures, it will never be completely safe to
run Polynote on your personal computer. For example:
- It's possible that other websites you visit could use Polynote as an attack vector. Browsing the web
while running Polynote is unsafe.
- It's possible that remote attackers could use Polynote as an attack vector. Running Polynote on a
computer that's accessible from the internet is unsafe.
- Even running Polynote inside a container doesn't guarantee safety, as there will always be
privilege escalation and container escape vulnerabilities which an attacker could leverage.
Please be diligent about checking for new releases, as they could contain fixes for critical security
flaws.
Please be mindful of the security issues that Polynote causes; consult your company's security team
before running Polynote. You are solely responsible for any breach, loss, or damage caused by running
this software insecurely.
[zio-default-async-8-795372831] INFO org.http4s.blaze.channel.nio1.NIO1SocketServerGroup - Service bound to address /127.0.0.1:8192
[zio-default-async-8-795372831] INFO org.http4s.server.blaze.BlazeServerBuilder -
_____ _ _
| __ \ | | | |
| |__) |__ | |_ _ _ __ ___ | |_ ___
| ___/ _ \| | | | | '_ \ / _ \| __/ _ \
| | | (_) | | |_| | | | | (_) | || __/
|_| \___/|_|\__, |_| |_|\___/ \__\___|
__/ |
|___/
Server running at http://127.0.0.1:8192
[zio-default-async-8-795372831] INFO org.http4s.server.blaze.BlazeServerBuilder - http4s v0.20.6 on blaze v0.14.6 started at http://127.0.0.1:8192/
訪問
地址http://localhost:8192
一個簡單的python包使用
- 界面
- 執行效果
幾個問題
- No matplotlib support: No module named 'matplotlib'
解決方法,安裝依賴
pip3 install matplotlib
- Library not loaded: /usr/local/opt/openblas
這個應該屬於我系統的問題(brew 安裝的軟件包有損壞),解決方法,刪除重新安裝
brew uninstall --ignore-dependencies openblas
brew install openblas
參考資料
https://github.com/polynote/polynote/releases
https://polynote.org/docs/01-installation.html