Python Installation Office & Personal
Download Python
Python Installation Office & Personal

Download Python
https://www.python.org/downloads/
🔧 Step 1. Extract the Source
Open your terminal, cd into your Downloads folder, then run:
tar -xf Python-3.12.5.tar.xz
cd Python-3.12.5
🔧 Step 2. Install Build Dependencies
On macOS, you need Xcode tools + some libraries. Run:
xcode-select --install
brew install zlib xz bzip2 sqlite3 gdbm
🔧 Step 3. Configure Build
In the extracted Python folder:
./configure --enable-optimizations --with-openssl=$(brew --prefix openssl)
--enable-optimizations→ enables PGO/LTO → faster Python.--with-openssl→ ensures SSL works forpip install.
🔧 Step 4. Build & Install
This step compiles Python (takes a few minutes):
make -j$(sysctl -n hw.logicalcpu)
sudo make altinstall
⚠️ Use **altinstall** instead of install → avoids overwriting macOS’s system Python.
Example:
python3.12will be available.- But the system’s
python3(used by macOS) won’t be touched.
🔧 Step 5. Verify
Check version:
python3.12 --version
You should see:
Python 3.12.5
🔧 Step 6. Setup Virtual Environment
Create a project folder:
mkdir ~/llm-playground && cd ~/llm-playground
python3.12 -m venv .venv
source .venv/bin/activate
Now (venv) should show in your terminal.
🔧 Step 7. Install AI Packages
Inside your activated venv:
pip install --upgrade pip
pip install transformers torch accelerate
pip install langchain llama-index openai
pip install fastapi uvicorn[standard]
pip install sentence-transformers
✅ Done!
You now have a fresh local Python build (from source!) and are ready to run AI code.
🛠 Install Python Without sudo — For Office Laptop
1. Configure to Install Under Your Home
When you run ./configure, tell it to install into a folder inside your home directory, e.g. ~/python:
./configure --prefix=$HOME/python3.12 --enable-optimizations --with-openssl=$(brew --prefix openssl)
--prefix=$HOME/python3.12→ this will install Python binaries into your home (safe, no root needed).- If you don’t want to install Python in your home directory and prefer another location (for ex:
/opt/python3.12), use the following command./configure --prefix=/opt/python3.12 --enable-optimizations --with-openssl=$(brew --prefix openssl)
2. Build Python
make -j$(sysctl -n hw.logicalcpu)
This compiles Python.
3. Install Into Your Home Directory
Instead of sudo make altinstall, just run:
make altinstall
It will copy Python into $HOME/python3.12/bin/python3.12.
4. Update Your PATH
Edit your shell config (~/.zshrc if you use zsh, ~/.bashrc if bash):
export PATH="$HOME/python3.12/bin:$PATH"
Reload:
source ~/.zshrc # or source ~/.bashrc
5. Verify
python3.12 --version
Should show:
Python 3.12.x
🚀 Next: Create Virtual Environments
Now you can make a project folder and virtual environment (no root needed):
mkdir ~/llm-playground && cd ~/llm-playground
python3.12 -m venv .venv
source .venv/bin/activate
Then install AI libraries normally:
pip install --upgrade pip
pip install transformers torch accelerate langchain llama-index fastapi uvicorn[standard] sentence-transformers
✅ This way, everything stays inside your home directory, no sudo, and your office IT Admin won’t block it.
메타데이터
- post_id
- b1fdc41a8fff
- slug
- python-installation-office-personal-b1fdc41a8fff
- url
- https://medium.com/@sujithramanathan18/python-installation-office-personal-b1fdc41a8fff
- canonical_url
- https://medium.com/@sujithramanathan18/python-installation-office-personal-b1fdc41a8fff
- author_url
- https://medium.com/@sujithramanathan18
- status
- ok
- fetched_at
- 2026-07-18 14:34:04