Skip to content

reenor/py-practice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

General setting up on MacOS

Zsh installation

It's recommended to use Zsh over Bash. Fortunately, Zsh is the default shell in my MacOs.

To check your account's default shell, simply run the following command:

echo $SHELL

GCC installation

Python install will require a GCC installation, and Xcode includes command line development tools such as gcc and friends, so we need to install Xcode as follows:

xcode-select --install

Homebrew installation

A package manager is missing in MacOS unlike in Linux. Homebrew fills this void.

To install Homebrew, run the following command:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

For more details, refer to this

Git and VS Code installation

brew install git
brew install --cask visual-studio-code
brew doctor

Setting up for the Python development environment

Pyenv installation

This tool lets us switch easily between multiple versions of Python in our machine.

  1. To install it, let's 'brew' as follows:
brew install pyenv
  1. Configure your shell's environment for Pyenv as follows (zsh for me):
echo '\neval "$(pyenv init --path)"' >> ~/.zprofile
echo '\neval "$(pyenv init -)"' >> ~/.zshrc

For more details, refer to this

  1. Restart terminal windows for changes to take effect

Python installation

  1. Now let's install the latest Python version (3.10.2 as of this writting) using the pyenv tool
pyenv install 3.10.2
  1. And then switch current Python version to 3.10.2 as follows:
pyenv global 3.10.2

To verify if the current Python version is 3.10.2 or not, run the following command: pyenv version

  1. To fix brew doctor's warning that is "config" scripts exist outside your system or Homebrew directories, add the following line into ~/.zshrc:
alias brew='env PATH="${PATH//$(pyenv root)\/shims:/}" brew'

For more details, refer to this

Setting up for this project only

  1. Navigate to the directory of this project and then create a new python virtual environment named venv-py-practice
cd ~/Projects/py-practice
python -m venv venv-py-practice
  1. In order to use this environment, we have to 'activate' it, to do this, run the following:
source ./venv-py-practice/bin/activate

For more details, refer to this

  1. Install all packages that the project needs according to the configuration file requirements.txt
pip install -r requirements.txt

For more details, refer to this

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages