Skip to content

Commit 4739dab

Browse files
authored
[FLINK-23632][docs] Fix the setup-pyflink-virtual-env.sh link
1 parent 11259ef commit 4739dab

File tree

3 files changed

+55
-2
lines changed

3 files changed

+55
-2
lines changed

docs/content.zh/docs/dev/python/faq.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ under the License.
3232

3333
## 准备Python虚拟环境
3434

35-
您可以下载[便捷脚本]({% link downloads/setup-pyflink-virtual-env.sh %}),以准备可在Mac OS和大多数Linux发行版上使用的Python虚拟环境包(virtual env zip)。
35+
您可以下载[便捷脚本](/downloads/setup-pyflink-virtual-env.sh),以准备可在Mac OS和大多数Linux发行版上使用的Python虚拟环境包(virtual env zip)。
3636
您可以指定PyFlink的版本,来生成对应的PyFlink版本所需的Python虚拟环境,否则将安装最新版本的PyFlink所对应的Python虚拟环境。
3737

3838
{{< stable >}}

docs/content/docs/dev/python/faq.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ This page describes the solutions to some common questions for PyFlink users.
3030

3131
## Preparing Python Virtual Environment
3232

33-
You can download a [convenience script]({% link downloads/setup-pyflink-virtual-env.sh %}) to prepare a Python virtual env zip which can be used on Mac OS and most Linux distributions.
33+
You can download a [convenience script](/downloads/setup-pyflink-virtual-env.sh) to prepare a Python virtual env zip which can be used on Mac OS and most Linux distributions.
3434
You can specify the PyFlink version to generate a Python virtual environment required for the corresponding PyFlink version, otherwise the most recent version will be installed.
3535

3636
{{< stable >}}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#!/usr/bin/env bash
2+
# Licensed to the Apache Software Foundation (ASF) under one or more
3+
# contributor license agreements. See the NOTICE file distributed with
4+
# this work for additional information regarding copyright ownership.
5+
# The ASF licenses this file to You under the Apache License, Version 2.0
6+
# (the "License"); you may not use this file except in compliance with
7+
# the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
set -e
17+
# download miniconda.sh
18+
if [[ `uname -s` == "Darwin" ]]; then
19+
if [[ `uname -m` == "arm64" ]]; then
20+
wget "https://repo.anaconda.com/miniconda/Miniconda3-py310_23.5.2-0-MacOSX-arm64.sh" -O "miniconda.sh"
21+
else
22+
wget "https://repo.anaconda.com/miniconda/Miniconda3-py310_23.5.2-0-MacOSX-x86_64.sh" -O "miniconda.sh"
23+
fi
24+
else
25+
wget "https://repo.anaconda.com/miniconda/Miniconda3-py310_23.5.2-0-Linux-x86_64.sh" -O "miniconda.sh"
26+
fi
27+
28+
# add the execution permission
29+
chmod +x miniconda.sh
30+
31+
# create python virtual environment
32+
./miniconda.sh -b -p venv
33+
34+
# activate the conda python virtual environment
35+
source venv/bin/activate ""
36+
37+
# install PyFlink dependency
38+
if [[ $1 = "" ]]; then
39+
# install the latest version of pyflink
40+
pip install apache-flink
41+
else
42+
# install the specified version of pyflink
43+
pip install "apache-flink==$1"
44+
fi
45+
46+
# deactivate the conda python virtual environment
47+
conda deactivate
48+
49+
# remove the cached packages
50+
rm -rf venv/pkgs
51+
52+
# package the prepared conda python virtual environment
53+
zip -r venv.zip venv

0 commit comments

Comments
 (0)