-
Notifications
You must be signed in to change notification settings - Fork 0
/
Building_Python3_From_Source.txt
53 lines (39 loc) · 1.97 KB
/
Building_Python3_From_Source.txt
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
########### Python 3.11.x ###############
sudo apt-get update
sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev libbz2-dev liblzma-dev tk-dev libdb-dev python3-venv python-openssl git libproj-dev libgeos-dev
sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \
xz-utils tk-dev libffi-dev lzma liblzma-dev python-openssl git libproj-dev libgeos-dev
wget https://www.python.org/ftp/python/3.11.4/Python-3.11.4.tar.xz
tar xf Python-3.11.4.tar.xz
cd Python-3.11.4
./configure --prefix=/usr/local --enable-optimizations
make -j <number of cpu cores> # To get number of cores: nproc --all or do:
make -j $(nproc)
sudo make altinstall
sudo apt-get install python3-venv
whereis python # run this to find locations of python installations
mkdir ~/envs
cd ~/envs # move to envs directory
/usr/local/bin/python3.11 -m venv bottle # create virtual environment using venv
cd bottle
source bin/activate # activate the environment
pip --version # double-check the pip version
## On Windows, you typically navigate to the Scrips folder to activate the virtual environment:
python -m venv myenv
cd myenv\Scripts
activate.bat
###### Installing Same Packages as Prior Python Version ######
pip freeze > installed.txt (on older Python version)
pip install -r installed.txt (current Python version)
### Installing Packages using pip ###
pip install <package-name>
pip install git+https://github.com/scikit-learn/scikit-learn.git
### Installing the master branch
pip install 'ibis-framework[duckdb]@git+https://github.com/ibis-project/ibis@master'
# If using miniconda3, add conda-forge channel:
conda config --add channels conda-forge
### To add environment variables to your profile
edit .profile file, then:
export <your_environment_variable_name>=<value>
To "update" the .profile file, do: source .profile