Skip to content

julioaranajr/01_Python_PythonEnv_Labs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Learning Python

Prepare pyenv

PYTHON_VERSION="3.10.5"

brew install pyenv
pyenv install $PYTHON_VERSION
pyenv global $PYTHON_VERSION

Open your .zshrc file and add the lines below at the end of the file.

code ~/.zshrc

or, use vi

vi ~/.zshrc

Copy and paste the following lines:

# Python - pyenv
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init --path)"
if command -v pyenv 1>/dev/null 2>&1; then
  eval "$(pyenv init -)"
fi

You should now close your terminal exit and re-open it.

Check python and pip

which python
which pip

Some Utilities of pyenv

List of existing version installed on your mac:

pyenv versions

Set a new version of python on your mac:

pyenv global $PYTHON_VERSION

Your First Python Program

Create a new file

code hello.py

Edit your file with visual studio and write this line:

print("Hello World")

Run the script hello.py in your terminal

python hello.py

Running

Screenshot

About

# Learning Python - Config Python Environment and Examples

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages