FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
setup-python-amazon-linux/install-python.sh at main · bf-rbrown/setup-python-amazon-linux · GitHub
bf-rbrown
/
setup-python-amazon-linux
Public
forked from
kishaningithub/setup-python-amazon-linux
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
setup-python-amazon-linux
/
install-python.sh
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
37 lines (31 loc) · 1.34 KB
Breadcrumbs
setup-python-amazon-linux
/
install-python.sh
Copy path
File metadata and controls
executable file
·
37 lines (31 loc) · 1.34 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!
/usr/bin/env bash
set
-euo pipefail
function
set_aliases()
{
ln -sf
"
${python_installation_dir}
/bin/python3
"
"
${python_installation_dir}
/bin/python
"
ln -sf
"
${python_installation_dir}
/bin/pip3
"
"
${python_installation_dir}
/bin/pip
"
}
#
Reference - https://realpython.com/installing-python/#how-to-build-python-from-source-code
function
setup_python()
{
python_version=
"
$1
"
python_installation_dir=
"
$2
"
mkdir -p
"
${python_installation_dir}
"
temp_dir=
$(
mktemp -d
)
pushd
"
${temp_dir}
"
>
/dev/null
wget
"
https://www.python.org/ftp/python/
${python_version}
/Python-
${python_version}
.tgz
"
tar -zxf
"
Python-
${python_version}
.tgz
"
pushd
"
Python-
${python_version}
"
>
/dev/null
#
- Have not added --enable-optimizations flag because that shoots up the build time by ~5 minutes
#
- Ref for openssl
#
- https://gist.github.com/wizardbeard/d5b641d1fadbaba755823e16eab4dda1#file-python-3-9-slim-dockerfile-L17
#
- https://stackoverflow.com/a/29169795/3316017
#
- https://stackoverflow.com/a/75880038/3316017
export
OPENSSL_LIBS=/usr/lib64/libssl.so
./configure --prefix=
"
${python_installation_dir}
"
--enable-shared --with-openssl=/usr --with-openssl-rpath=/usr/lib64
make -j
"
$(
nproc
)
"
make install
popd
>
/dev/null
popd
rm -rf
"
${temp_dir}
"
set_aliases
}
setup_python
"
$1
"
"
$2
"
Back
|
FazBrowse Home
|
New Git URL