SlideShare ist ein Scribd-Unternehmen logo
1 von 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

Weitere ähnliche Inhalte

Was ist angesagt?

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
 

Was ist angesagt? (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?
 

Andere mochten auch

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
 

Andere mochten auch (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
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Kürzlich hochgeladen

Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
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
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
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
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
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
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
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
 

Kürzlich hochgeladen (20)

Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
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
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
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
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
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
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
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
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
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
 

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

Hinweis der Redaktion

  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