SlideShare a Scribd company logo
1 of 36
Python
Environments!
     Epically winning at Python!

         Glen Zangirolami
         Twitter @glenbot
       http://theglenbot.com

Prepared for the 100th PyHou meetup.
Environments!
   Porque?
Environments!
       Porque?
Isolation - Python packages and even versions live in
their own little $HOME!
Environments!
       Porque?
Isolation - Python packages and even versions live in
their own little $HOME!

Permissions - Not everyone is 1337 and can be a sudoer.
Environments!
       Porque?
Isolation - Python packages and even versions live in
their own little $HOME!

Permissions - Not everyone is 1337 and can be a sudoer.

Organization - each project can maintain it’s own
requirements file of python packages and you don’t
have version overlap.
Environments!
       Porque?
Isolation - Python packages and even versions live in
their own little $HOME!

Permissions - Not everyone is 1337 and can be a sudoer.

Organization - each project can maintain it’s own
requirements file of python packages and you don’t
have version overlap.

Anti-globalization - installing stuff to the system
globally is generally not a good idea, unless it’s
something like PIP.
Ok fine. But how?
Ok fine. But how?
virtualenv

  http://pypi.python.org/pypi/virtualenv

virtualenvwrapper

  http://www.doughellmann.com/projects/
  virtualenvwrapper/

pythonbrew

  https://github.com/utahta/pythonbrew
virtualenv
virtualenv
$ easy_install pip
$ pip install virtualenv
$ virtualenv <ENV>
virtualenv
$ easy_install pip
$ pip install virtualenv
$ virtualenv <ENV>

This creates a folder <ENV> in the $PWD.

<ENV>/lib/pythonX.X/site-packages
virtualenvwrapper
virtualenvwrapper
$ pip install virtualenvwrapper
virtualenvwrapper
$ pip install virtualenvwrapper
Some simple environment vars need to go into .bashrc

export WORKON_HOME=$HOME/.virtualenv
source /usr/local/bin/virtualenvwrapper.sh
export PIP_VIRTUALENV_BASE=$WORKON_HOME
export PIP_RESPECT_VIRTUALENV=true
virtualenvwrapper
 $ pip install virtualenvwrapper
 Some simple environment vars need to go into .bashrc

 export WORKON_HOME=$HOME/.virtualenv
 source /usr/local/bin/virtualenvwrapper.sh
 export PIP_VIRTUALENV_BASE=$WORKON_HOME
 export PIP_RESPECT_VIRTUALENV=true

The last package that you should ever install
                  globally
virtualenv + virtualenvwrapper =
virtualenv + virtualenvwrapper =

       Can you guess it?
virtualenv + virtualenvwrapper =

       Can you guess it?
1up - pythonbrew
1up - pythonbrew
$ curl -kL http://xrl.us/pythonbrewinstall | bash
1up - pythonbrew
$ curl -kL http://xrl.us/pythonbrewinstall | bash
Some simple code needs to go into .bashrc

[[ -s $HOME/.pythonbrew/etc/bashrc ]] && source
$HOME/.pythonbrew/etc/bashrc
virtualenv + virtualenvwrapper + pythonbrew =
virtualenv + virtualenvwrapper + pythonbrew =

              Can you guess it?
virtualenv + virtualenvwrapper + pythonbrew =

              Can you guess it?
Using
    virtualenvwrapper
$ mkvirtualenv python-rules
$ workon python-rules
$ pip install pygett
$ deactivate
$ cdsitepackages
$ lssitepackages
$ rmvirtualenv python-rules
Using pythonbrew
$ pybrew list
$ pybrew install --force 2.7.2
$ pybrew switch 2.7.2
$ pybrew install --force 2.4.6
$ pybrew switch 2.4.6
$ pybrew venv create -p 2.7.2 python-rules
$ pybrew off
$ pybrew py awesome_script.py
Holy grail of
pythonbrew
Holy grail of
pythonbrew
Are you ready for this?
Holy grail of
  pythonbrew
    Are you ready for this?
Ok, maybe it’s not THAT epic ;)
Holy grail of
     pythonbrew
      Are you ready for this?
  Ok, maybe it’s not THAT epic ;)

$ pybrew py awesome_script.py
Holy grail of
               pythonbrew
                 Are you ready for this?
            Ok, maybe it’s not THAT epic ;)

       $ pybrew py awesome_script.py

What does this do?!?! It tests your python script against all
                 python versions! EPIC!
Let’s reiterate
Let’s reiterate
virtualenv & virtualenvwrapper allow you to
create environments and manage them with
the default system Python.
Let’s reiterate
virtualenv & virtualenvwrapper allow you to
create environments and manage them with
the default system Python.

pybrew is like virtualenv & virtualenvwrapper
had babies with a BRAWNDO ENERGY
DRINK! WIN AT PYTHON!
The EPIC end.
             Thanks for listening.

I’m Glen Zangirolami and I love developing EPIC
           Python projects that WIN.

               Twitter @glenbot
            http://theglenbot.com

More Related Content

What's hot

LicensePlist - A license list generator of all your dependencies for iOS appl...
LicensePlist - A license list generator of all your dependencies for iOS appl...LicensePlist - A license list generator of all your dependencies for iOS appl...
LicensePlist - A license list generator of all your dependencies for iOS appl...将之 小野
 
Tracking huge files with Git LFS - LinuxCon 2016
Tracking huge files with Git LFS - LinuxCon 2016Tracking huge files with Git LFS - LinuxCon 2016
Tracking huge files with Git LFS - LinuxCon 2016Tim Pettersen
 
The Scientific Filesystem
The Scientific FilesystemThe Scientific Filesystem
The Scientific FilesystemVanessa S
 
Erlang/OTP
Erlang/OTPErlang/OTP
Erlang/OTPvoluntas
 
osakapy 2014.10 LT (CI for Python Project)
osakapy 2014.10 LT (CI for Python Project)osakapy 2014.10 LT (CI for Python Project)
osakapy 2014.10 LT (CI for Python Project)Hattori Hideo
 
Introduction to ipython notebook
Introduction to ipython notebookIntroduction to ipython notebook
Introduction to ipython notebookGo Asgard
 
Tracking large game assets with Git LFS
Tracking large game assets with Git LFSTracking large game assets with Git LFS
Tracking large game assets with Git LFSTim Pettersen
 
T3DD13 - Automated deployment for TYPO3 CMS (Workshop)
T3DD13 - Automated deployment for TYPO3 CMS (Workshop)T3DD13 - Automated deployment for TYPO3 CMS (Workshop)
T3DD13 - Automated deployment for TYPO3 CMS (Workshop)Tobias Liebig
 
Java 9 – The Ultimate Feature List
Java 9 – The Ultimate Feature ListJava 9 – The Ultimate Feature List
Java 9 – The Ultimate Feature ListTakipi
 
Introduction GStreamer
Introduction GStreamerIntroduction GStreamer
Introduction GStreamerShih-Yuan Lee
 
Scalable Deployment Architectures with TYPO3 Surf, Git and Jenkins
Scalable Deployment Architectures with TYPO3 Surf, Git and JenkinsScalable Deployment Architectures with TYPO3 Surf, Git and Jenkins
Scalable Deployment Architectures with TYPO3 Surf, Git and Jenkinsmhelmich
 
Welcome to the Cheese Shop: setuptools, virtualenv and PyPUG
Welcome to the Cheese Shop: setuptools, virtualenv and PyPUGWelcome to the Cheese Shop: setuptools, virtualenv and PyPUG
Welcome to the Cheese Shop: setuptools, virtualenv and PyPUGdwvisser
 
Introduction to Gstreamer
Introduction to GstreamerIntroduction to Gstreamer
Introduction to GstreamerRand Graham
 
讓程式展現樂趣-玩出實驗精神與創造力 - PythonEdition
讓程式展現樂趣-玩出實驗精神與創造力 - PythonEdition讓程式展現樂趣-玩出實驗精神與創造力 - PythonEdition
讓程式展現樂趣-玩出實驗精神與創造力 - PythonEditionJustin Lin
 
T3CON12 Flow and TYPO3 deployment with surf
T3CON12 Flow and TYPO3 deployment with surfT3CON12 Flow and TYPO3 deployment with surf
T3CON12 Flow and TYPO3 deployment with surfTobias Liebig
 
Will iPython replace Bash?
Will iPython replace Bash?Will iPython replace Bash?
Will iPython replace Bash?Babel
 

What's hot (17)

LicensePlist - A license list generator of all your dependencies for iOS appl...
LicensePlist - A license list generator of all your dependencies for iOS appl...LicensePlist - A license list generator of all your dependencies for iOS appl...
LicensePlist - A license list generator of all your dependencies for iOS appl...
 
Tracking huge files with Git LFS - LinuxCon 2016
Tracking huge files with Git LFS - LinuxCon 2016Tracking huge files with Git LFS - LinuxCon 2016
Tracking huge files with Git LFS - LinuxCon 2016
 
The Scientific Filesystem
The Scientific FilesystemThe Scientific Filesystem
The Scientific Filesystem
 
Erlang/OTP
Erlang/OTPErlang/OTP
Erlang/OTP
 
osakapy 2014.10 LT (CI for Python Project)
osakapy 2014.10 LT (CI for Python Project)osakapy 2014.10 LT (CI for Python Project)
osakapy 2014.10 LT (CI for Python Project)
 
Git and Unity
Git and UnityGit and Unity
Git and Unity
 
Introduction to ipython notebook
Introduction to ipython notebookIntroduction to ipython notebook
Introduction to ipython notebook
 
Tracking large game assets with Git LFS
Tracking large game assets with Git LFSTracking large game assets with Git LFS
Tracking large game assets with Git LFS
 
T3DD13 - Automated deployment for TYPO3 CMS (Workshop)
T3DD13 - Automated deployment for TYPO3 CMS (Workshop)T3DD13 - Automated deployment for TYPO3 CMS (Workshop)
T3DD13 - Automated deployment for TYPO3 CMS (Workshop)
 
Java 9 – The Ultimate Feature List
Java 9 – The Ultimate Feature ListJava 9 – The Ultimate Feature List
Java 9 – The Ultimate Feature List
 
Introduction GStreamer
Introduction GStreamerIntroduction GStreamer
Introduction GStreamer
 
Scalable Deployment Architectures with TYPO3 Surf, Git and Jenkins
Scalable Deployment Architectures with TYPO3 Surf, Git and JenkinsScalable Deployment Architectures with TYPO3 Surf, Git and Jenkins
Scalable Deployment Architectures with TYPO3 Surf, Git and Jenkins
 
Welcome to the Cheese Shop: setuptools, virtualenv and PyPUG
Welcome to the Cheese Shop: setuptools, virtualenv and PyPUGWelcome to the Cheese Shop: setuptools, virtualenv and PyPUG
Welcome to the Cheese Shop: setuptools, virtualenv and PyPUG
 
Introduction to Gstreamer
Introduction to GstreamerIntroduction to Gstreamer
Introduction to Gstreamer
 
讓程式展現樂趣-玩出實驗精神與創造力 - PythonEdition
讓程式展現樂趣-玩出實驗精神與創造力 - PythonEdition讓程式展現樂趣-玩出實驗精神與創造力 - PythonEdition
讓程式展現樂趣-玩出實驗精神與創造力 - PythonEdition
 
T3CON12 Flow and TYPO3 deployment with surf
T3CON12 Flow and TYPO3 deployment with surfT3CON12 Flow and TYPO3 deployment with surf
T3CON12 Flow and TYPO3 deployment with surf
 
Will iPython replace Bash?
Will iPython replace Bash?Will iPython replace Bash?
Will iPython replace Bash?
 

Viewers also liked

Python on a chip
Python on a chipPython on a chip
Python on a chipstoggi
 
Designing Teams for Emerging Challenges
Designing Teams for Emerging ChallengesDesigning Teams for Emerging Challenges
Designing Teams for Emerging ChallengesAaron Irizarry
 
UX, ethnography and possibilities: for Libraries, Museums and Archives
UX, ethnography and possibilities: for Libraries, Museums and ArchivesUX, ethnography and possibilities: for Libraries, Museums and Archives
UX, ethnography and possibilities: for Libraries, Museums and ArchivesNed Potter
 
Visual Design with Data
Visual Design with DataVisual Design with Data
Visual Design with DataSeth Familian
 
3 Things Every Sales Team Needs to Be Thinking About in 2017
3 Things Every Sales Team Needs to Be Thinking About in 20173 Things Every Sales Team Needs to Be Thinking About in 2017
3 Things Every Sales Team Needs to Be Thinking About in 2017Drift
 
How to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheHow to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheLeslie Samuel
 

Viewers also liked (6)

Python on a chip
Python on a chipPython on a chip
Python on a chip
 
Designing Teams for Emerging Challenges
Designing Teams for Emerging ChallengesDesigning Teams for Emerging Challenges
Designing Teams for Emerging Challenges
 
UX, ethnography and possibilities: for Libraries, Museums and Archives
UX, ethnography and possibilities: for Libraries, Museums and ArchivesUX, ethnography and possibilities: for Libraries, Museums and Archives
UX, ethnography and possibilities: for Libraries, Museums and Archives
 
Visual Design with Data
Visual Design with DataVisual Design with Data
Visual Design with Data
 
3 Things Every Sales Team Needs to Be Thinking About in 2017
3 Things Every Sales Team Needs to Be Thinking About in 20173 Things Every Sales Team Needs to Be Thinking About in 2017
3 Things Every Sales Team Needs to Be Thinking About in 2017
 
How to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheHow to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your Niche
 

Similar to Python environments

Pipfile, pipenv, pip… what?!
Pipfile, pipenv, pip… what?!Pipfile, pipenv, pip… what?!
Pipfile, pipenv, pip… what?!Ivan Chernoff
 
Python Versions and Dependencies Made Easy
Python Versions and Dependencies Made EasyPython Versions and Dependencies Made Easy
Python Versions and Dependencies Made EasySebastian Witowski
 
How to create a basic website with Python on Django
How to create a basic website with Python on DjangoHow to create a basic website with Python on Django
How to create a basic website with Python on DjangoArmağan Ersöz
 
Python virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutesPython virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutesLarry Cai
 
Python packaging and dependency resolution
Python packaging and dependency resolutionPython packaging and dependency resolution
Python packaging and dependency resolutionTatiana Al-Chueyr
 
Arbeiten mit distribute, pip und virtualenv
Arbeiten mit distribute, pip und virtualenvArbeiten mit distribute, pip und virtualenv
Arbeiten mit distribute, pip und virtualenvMarkus Zapke-Gründemann
 
Packaging in Python? Don't Roll the Dice.
Packaging in Python? Don't Roll the Dice.Packaging in Python? Don't Roll the Dice.
Packaging in Python? Don't Roll the Dice.ldaws
 
Django district pip, virtualenv, virtualenv wrapper & more
Django district  pip, virtualenv, virtualenv wrapper & moreDjango district  pip, virtualenv, virtualenv wrapper & more
Django district pip, virtualenv, virtualenv wrapper & moreJacqueline Kazil
 
A quick overview of why to use and how to set up iPython notebooks for research
A quick overview of why to use and how to set up iPython notebooks for researchA quick overview of why to use and how to set up iPython notebooks for research
A quick overview of why to use and how to set up iPython notebooks for researchAdam Pah
 
Introduction to VeriFast @ Kyoto
Introduction to VeriFast @ KyotoIntroduction to VeriFast @ Kyoto
Introduction to VeriFast @ KyotoKiwamu Okabe
 
Christian Strappazzon - Presentazione Python Milano - Codemotion Milano 2017
Christian Strappazzon - Presentazione Python Milano - Codemotion Milano 2017Christian Strappazzon - Presentazione Python Milano - Codemotion Milano 2017
Christian Strappazzon - Presentazione Python Milano - Codemotion Milano 2017Codemotion
 
First python project
First python projectFirst python project
First python projectNeetu Jain
 
Testing your puppet code
Testing your puppet codeTesting your puppet code
Testing your puppet codeJulien Pivotto
 
Docker for data science
Docker for data scienceDocker for data science
Docker for data scienceCalvin Giles
 
AWS EC2 Ubuntu Instance - Step-by-Step Deployment Guide
AWS EC2 Ubuntu Instance - Step-by-Step Deployment GuideAWS EC2 Ubuntu Instance - Step-by-Step Deployment Guide
AWS EC2 Ubuntu Instance - Step-by-Step Deployment GuideRapidValue
 
Puppet for dummies - ZendCon 2011 Edition
Puppet for dummies - ZendCon 2011 EditionPuppet for dummies - ZendCon 2011 Edition
Puppet for dummies - ZendCon 2011 EditionJoshua Thijssen
 
Startup Camp - Git, Python, Django session
Startup Camp - Git, Python, Django sessionStartup Camp - Git, Python, Django session
Startup Camp - Git, Python, Django sessionJuraj Michálek
 
Arbeiten mit distribute, pip und virtualenv
Arbeiten mit distribute, pip und virtualenvArbeiten mit distribute, pip und virtualenv
Arbeiten mit distribute, pip und virtualenvMarkus Zapke-Gründemann
 
Python Dependency Management - PyconDE 2018
Python Dependency Management - PyconDE 2018Python Dependency Management - PyconDE 2018
Python Dependency Management - PyconDE 2018Patrick Muehlbauer
 

Similar to Python environments (20)

Pipfile, pipenv, pip… what?!
Pipfile, pipenv, pip… what?!Pipfile, pipenv, pip… what?!
Pipfile, pipenv, pip… what?!
 
Python Versions and Dependencies Made Easy
Python Versions and Dependencies Made EasyPython Versions and Dependencies Made Easy
Python Versions and Dependencies Made Easy
 
How to create a basic website with Python on Django
How to create a basic website with Python on DjangoHow to create a basic website with Python on Django
How to create a basic website with Python on Django
 
Python virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutesPython virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutes
 
Python packaging and dependency resolution
Python packaging and dependency resolutionPython packaging and dependency resolution
Python packaging and dependency resolution
 
Arbeiten mit distribute, pip und virtualenv
Arbeiten mit distribute, pip und virtualenvArbeiten mit distribute, pip und virtualenv
Arbeiten mit distribute, pip und virtualenv
 
Packaging in Python? Don't Roll the Dice.
Packaging in Python? Don't Roll the Dice.Packaging in Python? Don't Roll the Dice.
Packaging in Python? Don't Roll the Dice.
 
Django district pip, virtualenv, virtualenv wrapper & more
Django district  pip, virtualenv, virtualenv wrapper & moreDjango district  pip, virtualenv, virtualenv wrapper & more
Django district pip, virtualenv, virtualenv wrapper & more
 
A quick overview of why to use and how to set up iPython notebooks for research
A quick overview of why to use and how to set up iPython notebooks for researchA quick overview of why to use and how to set up iPython notebooks for research
A quick overview of why to use and how to set up iPython notebooks for research
 
Introduction to VeriFast @ Kyoto
Introduction to VeriFast @ KyotoIntroduction to VeriFast @ Kyoto
Introduction to VeriFast @ Kyoto
 
Python+gradle
Python+gradlePython+gradle
Python+gradle
 
Christian Strappazzon - Presentazione Python Milano - Codemotion Milano 2017
Christian Strappazzon - Presentazione Python Milano - Codemotion Milano 2017Christian Strappazzon - Presentazione Python Milano - Codemotion Milano 2017
Christian Strappazzon - Presentazione Python Milano - Codemotion Milano 2017
 
First python project
First python projectFirst python project
First python project
 
Testing your puppet code
Testing your puppet codeTesting your puppet code
Testing your puppet code
 
Docker for data science
Docker for data scienceDocker for data science
Docker for data science
 
AWS EC2 Ubuntu Instance - Step-by-Step Deployment Guide
AWS EC2 Ubuntu Instance - Step-by-Step Deployment GuideAWS EC2 Ubuntu Instance - Step-by-Step Deployment Guide
AWS EC2 Ubuntu Instance - Step-by-Step Deployment Guide
 
Puppet for dummies - ZendCon 2011 Edition
Puppet for dummies - ZendCon 2011 EditionPuppet for dummies - ZendCon 2011 Edition
Puppet for dummies - ZendCon 2011 Edition
 
Startup Camp - Git, Python, Django session
Startup Camp - Git, Python, Django sessionStartup Camp - Git, Python, Django session
Startup Camp - Git, Python, Django session
 
Arbeiten mit distribute, pip und virtualenv
Arbeiten mit distribute, pip und virtualenvArbeiten mit distribute, pip und virtualenv
Arbeiten mit distribute, pip und virtualenv
 
Python Dependency Management - PyconDE 2018
Python Dependency Management - PyconDE 2018Python Dependency Management - PyconDE 2018
Python Dependency Management - PyconDE 2018
 

Recently uploaded

New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 

Recently uploaded (20)

New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 

Python environments

  • 1. Python Environments! Epically winning at Python! Glen Zangirolami Twitter @glenbot http://theglenbot.com Prepared for the 100th PyHou meetup.
  • 2. Environments! Porque?
  • 3. Environments! Porque? Isolation - Python packages and even versions live in their own little $HOME!
  • 4. Environments! Porque? Isolation - Python packages and even versions live in their own little $HOME! Permissions - Not everyone is 1337 and can be a sudoer.
  • 5. Environments! Porque? Isolation - Python packages and even versions live in their own little $HOME! Permissions - Not everyone is 1337 and can be a sudoer. Organization - each project can maintain it’s own requirements file of python packages and you don’t have version overlap.
  • 6. Environments! Porque? Isolation - Python packages and even versions live in their own little $HOME! Permissions - Not everyone is 1337 and can be a sudoer. Organization - each project can maintain it’s own requirements file of python packages and you don’t have version overlap. Anti-globalization - installing stuff to the system globally is generally not a good idea, unless it’s something like PIP.
  • 7.
  • 9. Ok fine. But how? virtualenv http://pypi.python.org/pypi/virtualenv virtualenvwrapper http://www.doughellmann.com/projects/ virtualenvwrapper/ pythonbrew https://github.com/utahta/pythonbrew
  • 11. virtualenv $ easy_install pip $ pip install virtualenv $ virtualenv <ENV>
  • 12. virtualenv $ easy_install pip $ pip install virtualenv $ virtualenv <ENV> This creates a folder <ENV> in the $PWD. <ENV>/lib/pythonX.X/site-packages
  • 14. virtualenvwrapper $ pip install virtualenvwrapper
  • 15. virtualenvwrapper $ pip install virtualenvwrapper Some simple environment vars need to go into .bashrc export WORKON_HOME=$HOME/.virtualenv source /usr/local/bin/virtualenvwrapper.sh export PIP_VIRTUALENV_BASE=$WORKON_HOME export PIP_RESPECT_VIRTUALENV=true
  • 16. virtualenvwrapper $ pip install virtualenvwrapper Some simple environment vars need to go into .bashrc export WORKON_HOME=$HOME/.virtualenv source /usr/local/bin/virtualenvwrapper.sh export PIP_VIRTUALENV_BASE=$WORKON_HOME export PIP_RESPECT_VIRTUALENV=true The last package that you should ever install globally
  • 18. virtualenv + virtualenvwrapper = Can you guess it?
  • 19. virtualenv + virtualenvwrapper = Can you guess it?
  • 21. 1up - pythonbrew $ curl -kL http://xrl.us/pythonbrewinstall | bash
  • 22. 1up - pythonbrew $ curl -kL http://xrl.us/pythonbrewinstall | bash Some simple code needs to go into .bashrc [[ -s $HOME/.pythonbrew/etc/bashrc ]] && source $HOME/.pythonbrew/etc/bashrc
  • 24. virtualenv + virtualenvwrapper + pythonbrew = Can you guess it?
  • 25. virtualenv + virtualenvwrapper + pythonbrew = Can you guess it?
  • 26. Using virtualenvwrapper $ mkvirtualenv python-rules $ workon python-rules $ pip install pygett $ deactivate $ cdsitepackages $ lssitepackages $ rmvirtualenv python-rules
  • 27. Using pythonbrew $ pybrew list $ pybrew install --force 2.7.2 $ pybrew switch 2.7.2 $ pybrew install --force 2.4.6 $ pybrew switch 2.4.6 $ pybrew venv create -p 2.7.2 python-rules $ pybrew off $ pybrew py awesome_script.py
  • 29. Holy grail of pythonbrew Are you ready for this?
  • 30. Holy grail of pythonbrew Are you ready for this? Ok, maybe it’s not THAT epic ;)
  • 31. Holy grail of pythonbrew Are you ready for this? Ok, maybe it’s not THAT epic ;) $ pybrew py awesome_script.py
  • 32. Holy grail of pythonbrew Are you ready for this? Ok, maybe it’s not THAT epic ;) $ pybrew py awesome_script.py What does this do?!?! It tests your python script against all python versions! EPIC!
  • 34. Let’s reiterate virtualenv & virtualenvwrapper allow you to create environments and manage them with the default system Python.
  • 35. Let’s reiterate virtualenv & virtualenvwrapper allow you to create environments and manage them with the default system Python. pybrew is like virtualenv & virtualenvwrapper had babies with a BRAWNDO ENERGY DRINK! WIN AT PYTHON!
  • 36. The EPIC end. Thanks for listening. I’m Glen Zangirolami and I love developing EPIC Python projects that WIN. Twitter @glenbot http://theglenbot.com

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n