How to install PyAlink on Ubuntu 22.04

环境准备

准备conda python环境

关于如何安装conda环境,可以参阅我此前整理的如下文章:

这里简要说明一下,Minconda是轻量级版conda,Anaconda是全量级conda,不同的是预装的python库文件不同。

创建项目虚拟环境

conda create -n lanzhou python=3.8 pip=20.0.2

激活虚拟环境

conda activate lanzhou

细节

lwk@qwfys:~$ conda create -n lanzhou python=3.8 pip=20.0.2
Channels:
 - defaults
Platform: linux-64
Collecting package metadata (repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /home/lwk/miniconda3/envs/lanzhou

  added / updated specs:
    - pip=20.0.2
    - python=3.8


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    pip-20.0.2                 |           py38_3         1.7 MB  defaults
    ------------------------------------------------------------
                                           Total:         1.7 MB

The following NEW packages will be INSTALLED:

  _libgcc_mutex      anaconda/pkgs/main/linux-64::_libgcc_mutex-0.1-main 
  _openmp_mutex      anaconda/pkgs/main/linux-64::_openmp_mutex-5.1-1_gnu 
  ca-certificates    anaconda/pkgs/main/linux-64::ca-certificates-2024.3.11-h06a4308_0 
  ld_impl_linux-64   anaconda/pkgs/main/linux-64::ld_impl_linux-64-2.38-h1181459_1 
  libffi             anaconda/pkgs/main/linux-64::libffi-3.4.4-h6a678d5_0 
  libgcc-ng          anaconda/pkgs/main/linux-64::libgcc-ng-11.2.0-h1234567_1 
  libgomp            anaconda/pkgs/main/linux-64::libgomp-11.2.0-h1234567_1 
  libstdcxx-ng       anaconda/pkgs/main/linux-64::libstdcxx-ng-11.2.0-h1234567_1 
  ncurses            anaconda/pkgs/main/linux-64::ncurses-6.4-h6a678d5_0 
  openssl            anaconda/pkgs/main/linux-64::openssl-3.0.13-h7f8727e_0 
  pip                anaconda/pkgs/main/linux-64::pip-20.0.2-py38_3 
  python             anaconda/pkgs/main/linux-64::python-3.8.19-h955ad1f_0 
  readline           anaconda/pkgs/main/linux-64::readline-8.2-h5eee18b_0 
  setuptools         anaconda/pkgs/main/linux-64::setuptools-68.2.2-py38h06a4308_0 
  sqlite             anaconda/pkgs/main/linux-64::sqlite-3.41.2-h5eee18b_0 
  tk                 anaconda/pkgs/main/linux-64::tk-8.6.12-h1ccaba5_0 
  wheel              anaconda/pkgs/main/linux-64::wheel-0.41.2-py38h06a4308_0 
  xz                 anaconda/pkgs/main/linux-64::xz-5.4.6-h5eee18b_0 
  zlib               anaconda/pkgs/main/linux-64::zlib-1.2.13-h5eee18b_0 


Proceed ([y]/n)? y


Downloading and Extracting Packages:
                                                                                                                                                                                              
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
#     $ conda activate lanzhou
#
# To deactivate an active environment, use
#
#     $ conda deactivate

lwk@qwfys:~$ conda activate lanzhou
(lanzhou) lwk@qwfys:~$

安装

通常来说,在conda环境下,安装python包,首选用命令conda install python_package_name[=|<|>|~version]安装相关包,但是有一些包没有提供conda形式的包,这个时候,我们就不得不采用命令pip install python_package_name[=|<|>|~version] 来安装相关的python包了。

对于PyAlink来说,由于官方没有提供conda形式的发行包,只提供了pip形式的发行包,所以,我们需要用pip命令来安装。

脚本

Alink教程(Python版) / 第1.2.1节 PyAlink快速开始中详细介绍了关于pyalink的安装,这里需要补充一下,按照这一节的介绍安装的时候,会出现卡顿,尤其是采用pip install pyalinkpip install pyalink==1.6.2安装时,会出现所依赖的包apache-flink 1.12.0~1.12.4找不到的问题,经我亲自到pip官网 / apache-flink历史页面查看,发现包apache-flink 1.12.0~1.12.4都处于下架状态,如下图所示。

在这里插入图片描述
经我反复尝试,发现安装注意事项部分**Flink 1.9: [链接](https://alink-release.oss-cn-beijing.aliyuncs.com/v1.4.0/pyalink_flink_1.9-1.4.0-py3-none-any.whl) (MD5: fc143df37d15d6bd3b0733fef8969ef1)**,如下图所示,给出的链接对应的文件pyalink_flink_1.9-1.4.0-py3-none-any.whl`借助pip可以安装成功。

在这里插入图片描述
我们知道,命令

pip install pyalink_flink_1.9-1.4.0-py3-none-any.whl

与命令

pip install pyalink-flink-1.9==1.4.0

效果是相同的,故而有下述安装脚本。

pip install pyalink-flink-1.9==1.4.0

细节

(lanzhou) lwk@qwfys:~$ pip install pyalink-flink-1.9==1.4.0
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple/
Requirement already satisfied: pip in ./miniconda3/envs/lanzhou/lib/python3.8/site-packages (20.0.2)
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.tuna.tsinghua.edu.cn', port=443): Read timed out. (read timeout=15)")': /simple/install/
Collecting install
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/4d/c8/8cbca135f9e167810756ea2bc34b028501936675fcbd7dadccf752fa4622/install-1.3.5-py3-none-any.whl (3.2 kB)
Collecting pyalink-flink-1.9==1.4.0
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/81/5b/033b5f0d1edc6d43c400daf9974c5f4a40e283f1c9a2595bbd9e9d919b12/pyalink_flink_1.9-1.4.0-py3-none-any.whl (58.3 MB)
     |████████████████████████████████| 58.3 MB 117 kB/s 
Collecting Rx
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/e2/a9/efeaeca4928a9a56d04d609b5730994d610c82cf4d9dd7aa173e6ef4233e/Rx-3.2.0-py3-none-any.whl (199 kB)
Collecting pandas<1.0.0,>=0.24.0
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/7b/fd/41698f20fd297cef2dc43a72a8ca42d149eaf7d954f1fb2bd3fc366a658d/pandas-0.25.3-cp38-cp38-manylinux1_x86_64.whl (10.4 MB)
Collecting requests
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/70/8e/0e2d847013cb52cd35b38c009bb167a1a26b2ce6cd6965bf26b47bc0bf44/requests-2.31.0-py3-none-any.whl (62 kB)
Processing ./.cache/pip/wheels/9f/d9/e4/084cf8d1674c3d449683c5c3b8d5baf77b5b9de1899517a430/apache_flink-1.9.3-py2.py3-none-any.whl
Collecting tqdm
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/2a/14/e75e52d521442e2fcc9f1df3c5e456aead034203d4797867980de558ab34/tqdm-4.66.2-py3-none-any.whl (78 kB)
Collecting deprecation
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/02/c3/253a89ee03fc9b9682f1541728eb66db7db22148cd94f89ab22528cd1e1b/deprecation-2.1.0-py2.py3-none-any.whl (11 kB)
Collecting jupyter
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/83/df/0f5dd132200728a86190397e1ea87cd76244e42d39ec5e88efd25b2abd7e/jupyter-1.0.0-py2.py3-none-any.whl (2.7 kB)
Collecting cloudpickle==1.2.2
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/c1/49/334e279caa3231255725c8e860fa93e72083567625573421db8875846c14/cloudpickle-1.2.2-py2.py3-none-any.whl (25 kB)
Collecting py4j==0.10.8.1
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/04/de/2d314a921ef4c20b283e1de94e0780273678caac901564df06b948e4ba9b/py4j-0.10.8.1-py2.py3-none-any.whl (196 kB)
Collecting pytz>=2017.2
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/9c/3d/a121f284241f08268b21359bd425f7d4825cffc5ac5cd0e1b3d82ffd2b10/pytz-2024.1-py2.py3-none-any.whl (505 kB)
Collecting numpy>=1.13.3
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/98/5d/5738903efe0ecb73e51eb44feafba32bdba2081263d40c5043568ff60faf/numpy-1.24.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.3 MB)
Collecting python-dateutil>=2.6.1
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/ec/57/56b9bcc3c9c6a792fcbaf139543cee77261f3651ca9da0c93f5c1221264b/python_dateutil-2.9.0.post0-py2.py3-none-any.whl (229 kB)
Collecting idna<4,>=2.5
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/c2/e7/a82b05cf63a603df6e68d59ae6a68bf5064484a0718ea5033660af4b54a9/idna-3.6-py3-none-any.whl (61 kB)
Collecting charset-normalizer<4,>=2
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/3d/09/d82fe4a34c5f0585f9ea1df090e2a71eb9bb1e469723053e1ee9f57c16f3/charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (141 kB)
Collecting certifi>=2017.4.17
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/ba/06/a07f096c664aeb9f01624f858c3add0a4e913d6c96257acb4fce61e7de14/certifi-2024.2.2-py3-none-any.whl (163 kB)
Collecting urllib3<3,>=1.21.1
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/a2/73/a68704750a7679d0b6d3ad7aa8d4da8e14e151ae82e6fee774e6e0d05ec8/urllib3-2.2.1-py3-none-any.whl (121 kB)
Collecting packaging
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/49/df/1fceb2f8900f8639e278b056416d49134fb8d84c5942ffaa01ad34782422/packaging-24.0-py3-none-any.whl (53 kB)
Collecting ipywidgets
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/70/1a/7edeedb1c089d63ccd8bd5c0612334774e90cf9337de9fe6c82d90081791/ipywidgets-8.1.2-py3-none-any.whl (139 kB)
Collecting nbconvert
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/23/8a/8d67cbd984739247e4b205c1143e2f71b25b4f71e180fe70f7cb2cf02633/nbconvert-7.16.3-py3-none-any.whl (257 kB)
Collecting notebook
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/61/06/b4f53cf193765140f0b27094683dfae1b656d9f7264831ace7699420c1c7/notebook-7.1.2-py3-none-any.whl (5.0 MB)
Collecting qtconsole
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/d5/21/0887c50fa5bca7bfde29f65999a6ac234617f2a007b6b387aa4dc0ca36a8/qtconsole-5.5.1-py3-none-any.whl (123 kB)
Collecting jupyter-console
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/ca/77/71d78d58f15c22db16328a476426f7ac4a60d3a5a7ba3b9627ee2f7903d4/jupyter_console-6.6.3-py3-none-any.whl (24 kB)
Collecting ipykernel
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/4b/45/00ceed1948457b6e469e4d44e5ecadc5b0f24fd4f610dd9e7b89f1993128/ipykernel-6.29.3-py3-none-any.whl (117 kB)
Collecting six>=1.5
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/d9/5a/e7c31adbe875f2abbb91bd84cf2dc52d792b5a01506781dbcf25c91daf11/six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting comm>=0.1.3
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/e6/75/49e5bfe642f71f272236b5b2d2691cf915a7283cc0ceda56357b61daa538/comm-0.2.2-py3-none-any.whl (7.2 kB)
Collecting traitlets>=4.3.1
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/7c/c4/366a09036c07f46eb8c9b2af39c97f502ef24f11f2a6e4d763655d9f2708/traitlets-5.14.2-py3-none-any.whl (85 kB)
Collecting ipython>=6.1.0
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/8d/97/8fe103906cd81bc42d3b0175b5534a9f67dccae47d6451131cf8d0d70bb2/ipython-8.12.3-py3-none-any.whl (798 kB)
Collecting widgetsnbextension~=4.0.10
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/99/bc/82a8c3985209ca7c0a61b383c80e015fd92e74f8ba0ec1af98f9d6ca8dce/widgetsnbextension-4.0.10-py3-none-any.whl (2.3 MB)
Collecting jupyterlab-widgets~=3.0.10
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/24/da/db1cb0387a7e4086780aff137987ee924e953d7f91b2a870f994b9b1eeb8/jupyterlab_widgets-3.0.10-py3-none-any.whl (215 kB)
Collecting pandocfilters>=1.4.1
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/ef/af/4fbc8cab944db5d21b7e2a5b8e9211a03a79852b1157e2c102fcc61ac440/pandocfilters-1.5.1-py2.py3-none-any.whl (8.7 kB)
Collecting jupyter-core>=4.7
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/c9/fb/108ecd1fe961941959ad0ee4e12ee7b8b1477247f30b1fdfd83ceaf017f0/jupyter_core-5.7.2-py3-none-any.whl (28 kB)
Collecting jinja2>=3.0
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/30/6d/6de6be2d02603ab56e72997708809e8a5b0fbfee080735109b40a3564843/Jinja2-3.1.3-py3-none-any.whl (133 kB)
Collecting markupsafe>=2.0
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/c7/bd/50319665ce81bb10e90d1cf76f9e1aa269ea6f7fa30ab4521f14d122a3df/MarkupSafe-2.1.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (26 kB)
Collecting nbformat>=5.7
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/b0/4c/20b6c8b6d7cc17b0481eb49c18f23b76f913ab3e6580a57515cd9727ca43/nbformat-5.10.3-py3-none-any.whl (78 kB)
Collecting jupyterlab-pygments
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/b1/dd/ead9d8ea85bf202d90cc513b533f9c363121c7792674f78e0d8a854b63b4/jupyterlab_pygments-0.3.0-py3-none-any.whl (15 kB)
Collecting bleach!=5.0.0
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/ea/63/da7237f805089ecc28a3f36bca6a21c31fcbc2eb380f3b8f1be3312abd14/bleach-6.1.0-py3-none-any.whl (162 kB)
Collecting beautifulsoup4
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/b1/fe/e8c672695b37eecc5cbf43e1d0638d88d66ba3a44c4d321c796f4e59167f/beautifulsoup4-4.12.3-py3-none-any.whl (147 kB)
Collecting nbclient>=0.5.0
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/66/e8/00517a23d3eeaed0513e718fbc94aab26eaa1758f5690fc8578839791c79/nbclient-0.10.0-py3-none-any.whl (25 kB)
Collecting importlib-metadata>=3.6; python_version < "3.10"
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/2d/0a/679461c511447ffaf176567d5c496d1de27cbe34a87df6677d7171b2fbd4/importlib_metadata-7.1.0-py3-none-any.whl (24 kB)
Collecting mistune<4,>=2.0.3
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/f0/74/c95adcdf032956d9ef6c89a9b8a5152bf73915f8c633f3e3d88d06bd699c/mistune-3.0.2-py3-none-any.whl (47 kB)
Collecting pygments>=2.4.1
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/97/9c/372fef8377a6e340b1704768d20daaded98bf13282b5327beb2e2fe2c7ef/pygments-2.17.2-py3-none-any.whl (1.2 MB)
Collecting tinycss2
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/da/99/fd23634d6962c2791fb8cb6ccae1f05dcbfc39bce36bba8b1c9a8d92eae8/tinycss2-1.2.1-py3-none-any.whl (21 kB)
Collecting defusedxml
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/07/6c/aa3f2f849e01cb6a001cd8554a88d4c77c5c1a31c95bdf1cf9301e6d9ef4/defusedxml-0.7.1-py2.py3-none-any.whl (25 kB)
Collecting jupyterlab<4.2,>=4.1.1
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/b4/bb/1f9f7ddf04cfe26b21aab739ec905bbafa401642614ac9c9d26cf13cb7a3/jupyterlab-4.1.5-py3-none-any.whl (11.4 MB)
Collecting tornado>=6.2.0
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/9f/12/11d0a757bb67278d3380d41955ae98527d5ad18330b2edbdc8de222b569b/tornado-6.4-cp38-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (435 kB)
Collecting jupyter-server<3,>=2.4.0
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/95/85/483b8e09a897d1bc2194646d30d4ce6ae166106e91ecbd11d6b6d9ccfc36/jupyter_server-2.13.0-py3-none-any.whl (383 kB)
Collecting jupyterlab-server<3,>=2.22.1
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/6a/2c/ea4fdd7d4bb72106419fff1fcda7c111bd905b00afed3d8efc1a6d6e4538/jupyterlab_server-2.25.4-py3-none-any.whl (58 kB)
Collecting notebook-shim<0.3,>=0.2
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/f9/33/bd5b9137445ea4b680023eb0469b2bb969d61303dedb2aac6560ff3d14a1/notebook_shim-0.2.4-py3-none-any.whl (13 kB)
Collecting pyzmq>=17.1
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/8e/2c/8599c59a053e7480567d4916b1dfb47c803fabe4e6d05f5fe3c65ead4e3a/pyzmq-25.1.2-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (1.1 MB)
Collecting jupyter-client>=4.1
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/75/6d/d7b55b9c1ac802ab066b3e5015e90faab1fffbbd67a2af498ffc6cc81c97/jupyter_client-8.6.1-py3-none-any.whl (105 kB)
Collecting qtpy>=2.4.0
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/7e/a9/2146d5117ad8a81185331e0809a6b48933c10171f5bac253c6df9fce991c/QtPy-2.4.1-py3-none-any.whl (93 kB)
Collecting prompt-toolkit>=3.0.30
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/ee/fd/ca7bf3869e7caa7a037e23078539467b433a4e01eebd93f77180ab927766/prompt_toolkit-3.0.43-py3-none-any.whl (386 kB)
Collecting debugpy>=1.6.5
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/36/e0/ebfc388bd6891ee3fb55a5ab99f6da76db28c5a6f3f6dec12d69e4184a9c/debugpy-1.8.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1 MB)
Collecting matplotlib-inline>=0.1
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/f2/51/c34d7a1d528efaae3d8ddb18ef45a41f284eacf9e514523b191b7d0872cc/matplotlib_inline-0.1.6-py3-none-any.whl (9.4 kB)
Collecting psutil
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/c5/4f/0e22aaa246f96d6ac87fe5ebb9c5a693fbe8877f537a1022527c47ca43c5/psutil-5.9.8-cp36-abi3-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (288 kB)
Collecting nest-asyncio
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/a0/c4/c2971a3ba4c6103a3d10c4b0f24f461ddc027f0f09763220cf35ca1401b3/nest_asyncio-1.6.0-py3-none-any.whl (5.2 kB)
Collecting typing-extensions; python_version < "3.10"
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/f9/de/dc04a3ea60b22624b51c703a84bbe0184abcd1d0b9bc8074b5d6b7ab90bb/typing_extensions-4.10.0-py3-none-any.whl (33 kB)
Collecting pexpect>4.3; sys_platform != "win32"
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/9e/c3/059298687310d527a58bb01f3b1965787ee3b40dce76752eda8b44e9a2c5/pexpect-4.9.0-py2.py3-none-any.whl (63 kB)
Collecting backcall
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/4c/1c/ff6546b6c12603d8dd1070aa3c3d273ad4c07f5771689a7b69a550e8c951/backcall-0.2.0-py2.py3-none-any.whl (11 kB)
Collecting stack-data
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/f1/7b/ce1eafaf1a76852e2ec9b22edecf1daa58175c090266e9f6c64afcd81d91/stack_data-0.6.3-py3-none-any.whl (24 kB)
Collecting pickleshare
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/9a/41/220f49aaea88bc6fa6cba8d05ecf24676326156c23b991e80b3f2fc24c77/pickleshare-0.7.5-py2.py3-none-any.whl (6.9 kB)
Collecting jedi>=0.16
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/20/9f/bc63f0f0737ad7a60800bfd472a4836661adae21f9c2535f3957b1e54ceb/jedi-0.19.1-py2.py3-none-any.whl (1.6 MB)
Collecting decorator
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/d5/50/83c593b07763e1161326b3b8c6686f0f4b0f24d5526546bee538c89837d6/decorator-5.1.1-py3-none-any.whl (9.1 kB)
Collecting platformdirs>=2.5
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/55/72/4898c44ee9ea6f43396fbc23d9bfaf3d06e01b83698bdf2e4c919deceb7c/platformdirs-4.2.0-py3-none-any.whl (17 kB)
Collecting jsonschema>=2.6
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/39/9d/b035d024c62c85f2e2d4806a59ca7b8520307f34e0932fbc8cc75fe7b2d9/jsonschema-4.21.1-py3-none-any.whl (85 kB)
Collecting fastjsonschema
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/9c/b9/79691036d4a8f9857e74d1728b23f34f583b81350a27492edda58d5604e1/fastjsonschema-2.19.1-py3-none-any.whl (23 kB)
Collecting webencodings
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/f4/24/2a3e3df732393fed8b3ebf2ec078f05546de641fe1b667ee316ec1dcf3b7/webencodings-0.5.1-py2.py3-none-any.whl (11 kB)
Collecting soupsieve>1.2
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/4c/f3/038b302fdfbe3be7da016777069f26ceefe11a681055ea1f7817546508e3/soupsieve-2.5-py3-none-any.whl (36 kB)
Collecting zipp>=0.5
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/c2/0a/ba9d0ee9536d3ef73a3448e931776e658b36f128d344e175bc32b092a8bf/zipp-3.18.1-py3-none-any.whl (8.2 kB)
Collecting async-lru>=1.0.0
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/fa/9f/3c3503693386c4b0f245eaf5ca6198e3b28879ca0a40bde6b0e319793453/async_lru-2.0.4-py3-none-any.whl (6.1 kB)
Collecting httpx>=0.25.0
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/41/7b/ddacf6dcebb42466abd03f368782142baa82e08fc0c1f8eaa05b4bae87d5/httpx-0.27.0-py3-none-any.whl (75 kB)
Collecting tomli; python_version < "3.11"
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/97/75/10a9ebee3fd790d20926a90a2547f0bf78f371b2f13aa822c759680ca7b9/tomli-2.0.1-py3-none-any.whl (12 kB)
Collecting importlib-resources>=1.4; python_version < "3.9"
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/75/06/4df55e1b7b112d183f65db9503bff189e97179b256e1ea450a3c365241e0/importlib_resources-6.4.0-py3-none-any.whl (38 kB)
Collecting jupyter-lsp>=2.0.0
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/33/1b/9d4925e2afcf66729fbe5d3db2907ebd546a8c5d1e43a41e44bcaa1a19e0/jupyter_lsp-2.2.4-py3-none-any.whl (69 kB)
Collecting anyio>=3.1.0
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/14/fd/2f20c40b45e4fb4324834aea24bd4afdf1143390242c0b33774da0e2e34f/anyio-4.3.0-py3-none-any.whl (85 kB)
Collecting jupyter-events>=0.9.0
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/a5/94/059180ea70a9a326e1815176b2370da56376da347a796f8c4f0b830208ef/jupyter_events-0.10.0-py3-none-any.whl (18 kB)
Collecting jupyter-server-terminals
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/07/2d/2b32cdbe8d2a602f697a649798554e4f072115438e92249624e532e8aca6/jupyter_server_terminals-0.5.3-py3-none-any.whl (13 kB)
Collecting send2trash>=1.8.2
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/a9/78/e4df1e080ed790acf3a704edf521006dd96b9841bd2e2a462c0d255e0565/Send2Trash-1.8.2-py3-none-any.whl (18 kB)
Collecting terminado>=0.8.3
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/6a/9e/2064975477fdc887e47ad42157e214526dcad8f317a948dee17e1659a62f/terminado-0.18.1-py3-none-any.whl (14 kB)
Collecting prometheus-client
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/c7/98/745b810d822103adca2df8decd4c0bbe839ba7ad3511af3f0d09692fc0f0/prometheus_client-0.20.0-py3-none-any.whl (54 kB)
Collecting overrides
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/2c/ab/fc8290c6a4c722e5514d80f62b2dc4c4df1a68a41d1364e625c35990fcf3/overrides-7.7.0-py3-none-any.whl (17 kB)
Collecting websocket-client
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/1e/70/1e88138a9afbed1d37093b85f0bebc3011623c4f47c166431599fe9d6c93/websocket_client-1.7.0-py3-none-any.whl (58 kB)
Collecting argon2-cffi
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/a4/6a/e8a041599e78b6b3752da48000b14c8d1e8a04ded09c88c714ba047f34f5/argon2_cffi-23.1.0-py3-none-any.whl (15 kB)
Collecting babel>=2.10
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/0d/35/4196b21041e29a42dc4f05866d0c94fa26c9da88ce12c38c2265e42c82fb/Babel-2.14.0-py3-none-any.whl (11.0 MB)
Collecting json5>=0.9.0
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/26/2f/f93ccd68858c0005445fbdad053417b7eaab87aaf31bd2b506a9005d0dfd/json5-0.9.24-py3-none-any.whl (30 kB)
Collecting wcwidth
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/fd/84/fd2ba7aafacbad3c4201d395674fc6348826569da3c0937e75505ead3528/wcwidth-0.2.13-py2.py3-none-any.whl (34 kB)
Collecting ptyprocess>=0.5
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/22/a6/858897256d0deac81a172289110f31629fc4cee19b6f01283303e18c8db3/ptyprocess-0.7.0-py2.py3-none-any.whl (13 kB)
Collecting executing>=1.2.0
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/80/03/6ea8b1b2a5ab40a7a60dc464d3daa7aa546e0a74d74a9f8ff551ea7905db/executing-2.0.1-py2.py3-none-any.whl (24 kB)
Collecting asttokens>=2.1.0
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/45/86/4736ac618d82a20d87d2f92ae19441ebc7ac9e7a581d7e58bbe79233b24a/asttokens-2.4.1-py2.py3-none-any.whl (27 kB)
Collecting pure-eval
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/2b/27/77f9d5684e6bce929f5cfe18d6cfbe5133013c06cb2fbf5933670e60761d/pure_eval-0.2.2-py3-none-any.whl (11 kB)
Collecting parso<0.9.0,>=0.8.3
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/05/63/8011bd08a4111858f79d2b09aad86638490d62fbf881c44e434a6dfca87b/parso-0.8.3-py2.py3-none-any.whl (100 kB)
Collecting referencing>=0.28.4
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/42/8e/ae1de7b12223986e949bdb886c004de7c304b6fa94de5b87c926c1099656/referencing-0.34.0-py3-none-any.whl (26 kB)
Collecting rpds-py>=0.7.1
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/f7/48/46fbb24679e5b4703f4754a01b588606f8ffb0917d1b742f701b4e7c799e/rpds_py-0.18.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB)
Collecting jsonschema-specifications>=2023.03.6
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/ee/07/44bd408781594c4d0a027666ef27fab1e441b109dc3b76b4f836f8fd04fe/jsonschema_specifications-2023.12.1-py3-none-any.whl (18 kB)
Collecting pkgutil-resolve-name>=1.3.10; python_version < "3.9"
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/c9/5c/3d4882ba113fd55bdba9326c1e4c62a15e674a2501de4869e6bd6301f87e/pkgutil_resolve_name-1.3.10-py3-none-any.whl (4.7 kB)
Collecting attrs>=22.2.0
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/e0/44/827b2a91a5816512fcaf3cc4ebc465ccd5d598c45cefa6703fcf4a79018f/attrs-23.2.0-py3-none-any.whl (60 kB)
Collecting sniffio
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/e9/44/75a9c9421471a6c4805dbf2356f7c181a29c1879239abab1ea2cc8f38b40/sniffio-1.3.1-py3-none-any.whl (10 kB)
Collecting httpcore==1.*
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/2c/93/13f25f2f78646bab97aee7680821e30bd85b2ff0fc45d5fdf5393b79716d/httpcore-1.0.4-py3-none-any.whl (77 kB)
Collecting exceptiongroup>=1.0.2; python_version < "3.11"
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/b8/9a/5028fd52db10e600f1c4674441b968cf2ea4959085bfb5b99fb1250e5f68/exceptiongroup-1.2.0-py3-none-any.whl (16 kB)
Collecting pyyaml>=5.3
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/c8/6b/6600ac24725c7388255b2f5add93f91e58a5d7efaf4af244fdbcc11a541b/PyYAML-6.0.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (736 kB)
Collecting rfc3339-validator
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/7b/44/4e421b96b67b2daff264473f7465db72fbdf36a07e05494f50300cc7b0c6/rfc3339_validator-0.1.4-py2.py3-none-any.whl (3.5 kB)
Collecting rfc3986-validator>=0.1.1
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/9e/51/17023c0f8f1869d8806b979a2bffa3f861f26a3f1a66b094288323fba52f/rfc3986_validator-0.1.1-py2.py3-none-any.whl (4.2 kB)
Collecting python-json-logger>=2.0.4
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/35/a6/145655273568ee78a581e734cf35beb9e33a370b29c5d3c8fee3744de29f/python_json_logger-2.0.7-py3-none-any.whl (8.1 kB)
Collecting argon2-cffi-bindings
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/ec/f7/378254e6dd7ae6f31fe40c8649eea7d4832a42243acaf0f1fff9083b2bed/argon2_cffi_bindings-21.2.0-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (86 kB)
Collecting h11<0.15,>=0.13
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/95/04/ff642e65ad6b90db43e668d70ffb6736436c7ce41fcc549f4e9472234127/h11-0.14.0-py3-none-any.whl (58 kB)
Collecting cffi>=1.0.1
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/f1/c9/326611aa83e16b13b6db4dbb73b5455c668159a003c4c2f0c3bcb2ddabaf/cffi-1.16.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (444 kB)
Collecting pycparser
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/62/d5/5f610ebe421e85889f2e55e33b7f9a6795bd982198517d912eb1c76e1a53/pycparser-2.21-py2.py3-none-any.whl (118 kB)
Installing collected packages: install, Rx, pytz, numpy, six, python-dateutil, pandas, idna, charset-normalizer, certifi, urllib3, requests, py4j, apache-flink, tqdm, packaging, deprecation, traitlets, comm, typing-extensions, pygments, ptyprocess, pexpect, backcall, executing, asttokens, pure-eval, stack-data, pickleshare, wcwidth, prompt-toolkit, parso, jedi, decorator, matplotlib-inline, ipython, widgetsnbextension, jupyterlab-widgets, ipywidgets, pandocfilters, platformdirs, jupyter-core, markupsafe, jinja2, attrs, rpds-py, referencing, zipp, importlib-resources, jsonschema-specifications, pkgutil-resolve-name, jsonschema, fastjsonschema, nbformat, jupyterlab-pygments, webencodings, bleach, soupsieve, beautifulsoup4, pyzmq, tornado, importlib-metadata, jupyter-client, nbclient, mistune, tinycss2, defusedxml, nbconvert, async-lru, sniffio, exceptiongroup, anyio, h11, httpcore, httpx, babel, json5, pyyaml, rfc3339-validator, rfc3986-validator, python-json-logger, jupyter-events, terminado, jupyter-server-terminals, send2trash, prometheus-client, overrides, websocket-client, pycparser, cffi, argon2-cffi-bindings, argon2-cffi, jupyter-server, jupyterlab-server, tomli, notebook-shim, jupyter-lsp, debugpy, psutil, nest-asyncio, ipykernel, jupyterlab, notebook, qtpy, qtconsole, jupyter-console, jupyter, cloudpickle, pyalink-flink-1.9
Successfully installed Rx-3.2.0 anyio-4.3.0 apache-flink-1.9.3 argon2-cffi-23.1.0 argon2-cffi-bindings-21.2.0 asttokens-2.4.1 async-lru-2.0.4 attrs-23.2.0 babel-2.14.0 backcall-0.2.0 beautifulsoup4-4.12.3 bleach-6.1.0 certifi-2024.2.2 cffi-1.16.0 charset-normalizer-3.3.2 cloudpickle-1.2.2 comm-0.2.2 debugpy-1.8.1 decorator-5.1.1 defusedxml-0.7.1 deprecation-2.1.0 exceptiongroup-1.2.0 executing-2.0.1 fastjsonschema-2.19.1 h11-0.14.0 httpcore-1.0.4 httpx-0.27.0 idna-3.6 importlib-metadata-7.1.0 importlib-resources-6.4.0 install-1.3.5 ipykernel-6.29.3 ipython-8.12.3 ipywidgets-8.1.2 jedi-0.19.1 jinja2-3.1.3 json5-0.9.24 jsonschema-4.21.1 jsonschema-specifications-2023.12.1 jupyter-1.0.0 jupyter-client-8.6.1 jupyter-console-6.6.3 jupyter-core-5.7.2 jupyter-events-0.10.0 jupyter-lsp-2.2.4 jupyter-server-2.13.0 jupyter-server-terminals-0.5.3 jupyterlab-4.1.5 jupyterlab-pygments-0.3.0 jupyterlab-server-2.25.4 jupyterlab-widgets-3.0.10 markupsafe-2.1.5 matplotlib-inline-0.1.6 mistune-3.0.2 nbclient-0.10.0 nbconvert-7.16.3 nbformat-5.10.3 nest-asyncio-1.6.0 notebook-7.1.2 notebook-shim-0.2.4 numpy-1.24.4 overrides-7.7.0 packaging-24.0 pandas-0.25.3 pandocfilters-1.5.1 parso-0.8.3 pexpect-4.9.0 pickleshare-0.7.5 pkgutil-resolve-name-1.3.10 platformdirs-4.2.0 prometheus-client-0.20.0 prompt-toolkit-3.0.43 psutil-5.9.8 ptyprocess-0.7.0 pure-eval-0.2.2 py4j-0.10.8.1 pyalink-flink-1.9-1.4.0 pycparser-2.21 pygments-2.17.2 python-dateutil-2.9.0.post0 python-json-logger-2.0.7 pytz-2024.1 pyyaml-6.0.1 pyzmq-25.1.2 qtconsole-5.5.1 qtpy-2.4.1 referencing-0.34.0 requests-2.31.0 rfc3339-validator-0.1.4 rfc3986-validator-0.1.1 rpds-py-0.18.0 send2trash-1.8.2 six-1.16.0 sniffio-1.3.1 soupsieve-2.5 stack-data-0.6.3 terminado-0.18.1 tinycss2-1.2.1 tomli-2.0.1 tornado-6.4 tqdm-4.66.2 traitlets-5.14.2 typing-extensions-4.10.0 urllib3-2.2.1 wcwidth-0.2.13 webencodings-0.5.1 websocket-client-1.7.0 widgetsnbextension-4.0.10 zipp-3.18.1
(lanzhou) lwk@qwfys:~$

初始化plugin

接下来,我们参照命令download_pyalink_dep_jars安装pyalink依赖的相关jar文件,命令如下

download_pyalink_dep_jars -d

细节

(lanzhou) lwk@qwfys:~$ download_pyalink_dep_jars
/home/lwk/miniconda3/envs/lanzhou/lib/python3.8/site-packages/pandas/util/testing.py:27: FutureWarning: In the future `np.bool` will be defined as the corresponding NumPy scalar.
  import pandas._libs.testing as _testing
Traceback (most recent call last):
  File "/home/lwk/miniconda3/envs/lanzhou/bin/download_pyalink_dep_jars", line 5, in <module>
    from pyalink.alink.download_pyalink_dep_jars import main
  File "/home/lwk/miniconda3/envs/lanzhou/lib/python3.8/site-packages/pyalink/alink/__init__.py", line 4, in <module>
    from .batch import *
  File "/home/lwk/miniconda3/envs/lanzhou/lib/python3.8/site-packages/pyalink/alink/batch/__init__.py", line 1, in <module>
    from .base import BatchOperator
  File "/home/lwk/miniconda3/envs/lanzhou/lib/python3.8/site-packages/pyalink/alink/batch/base.py", line 2, in <module>
    from .lazy.lazy_evaluation import pipe_j_lazy_to_py_callbacks
  File "/home/lwk/miniconda3/envs/lanzhou/lib/python3.8/site-packages/pyalink/alink/batch/lazy/lazy_evaluation.py", line 6, in <module>
    from ...common.types.conversion.java_method_call import call_java_method
  File "/home/lwk/miniconda3/envs/lanzhou/lib/python3.8/site-packages/pyalink/alink/common/types/__init__.py", line 1, in <module>
    from .file_system.file_system import *
  File "/home/lwk/miniconda3/envs/lanzhou/lib/python3.8/site-packages/pyalink/alink/common/types/file_system/file_system.py", line 3, in <module>
    from .fs_data_stream import InputStreamWrapper
  File "/home/lwk/miniconda3/envs/lanzhou/lib/python3.8/site-packages/pyalink/alink/common/types/file_system/fs_data_stream.py", line 1, in <module>
    from ..bases.j_obj_wrapper import JavaObjectWrapperWithFunc
  File "/home/lwk/miniconda3/envs/lanzhou/lib/python3.8/site-packages/pyalink/alink/common/types/bases/j_obj_wrapper.py", line 5, in <module>
    from ..conversion.java_method_call import auto_convert_java_type
  File "/home/lwk/miniconda3/envs/lanzhou/lib/python3.8/site-packages/pyalink/alink/common/types/conversion/java_method_call.py", line 3, in <module>
    from .type_converters import py_obj_to_j_obj, j_value_to_py_value, py_list_to_j_array
  File "/home/lwk/miniconda3/envs/lanzhou/lib/python3.8/site-packages/pyalink/alink/common/types/conversion/type_converters.py", line 5, in <module>
    import pandas as pd
  File "/home/lwk/miniconda3/envs/lanzhou/lib/python3.8/site-packages/pandas/__init__.py", line 182, in <module>
    import pandas.testing
  File "/home/lwk/miniconda3/envs/lanzhou/lib/python3.8/site-packages/pandas/testing.py", line 7, in <module>
    from pandas.util.testing import (
  File "/home/lwk/miniconda3/envs/lanzhou/lib/python3.8/site-packages/pandas/util/testing.py", line 27, in <module>
    import pandas._libs.testing as _testing
  File "pandas/_libs/testing.pyx", line 10, in init pandas._libs.testing
  File "/home/lwk/miniconda3/envs/lanzhou/lib/python3.8/site-packages/numpy/__init__.py", line 305, in __getattr__
    raise AttributeError(__former_attrs__[attr])
AttributeError: module 'numpy' has no attribute 'bool'.
`np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
(lanzhou) lwk@qwfys:~$

这里之所以出现错误主要是numpy从1.24.0开始调整了api,移除了np.bool_属性,具体的修复办法就是将numpy版本号降回1.23.x中,我们这里取1.23.x中的最新版本1.23.5,用如下命令即可调整:

pip install numpy==1.23.5

numpy版本调整到1.23.5以后,再继续用命令download_pyalink_dep_jars -d安装,就没有问题了。

启动jupyter lab

jupyter lab

在这里插入图片描述

新建Python 3 的 Notebook,导入 pyalink 包:

from pyalink.alink import *

使用方法创建本地运行环境:

useLocalEnv(parallelism=1, flinkHome=None, config=None)

返回如下结果:

JVM listening on 127.0.0.1:35933
MLEnv(benv=<pyflink.dataset.execution_environment.ExecutionEnvironment object at 0x7f30c963a880>, btenv=<pyflink.table.table_environment.BatchTableEnvironment object at 0x7f30c94dd520>, senv=<pyflink.datastream.stream_execution_environment.StreamExecutionEnvironment object at 0x7f30f2cd9040>, stenv=<pyflink.table.table_environment.StreamTableEnvironment object at 0x7f30c927ee80>)

这里,我们看到初始化运行环境成功。

在这里插入图片描述

参考文献

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

qwfys200

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值