SlideShare une entreprise Scribd logo
1  sur  18
VirtualEnv and Pip
Isolated Python environments
             Ryan Blunden
   Brisbane Python Group, May 2011
Summary
• Global site-packages management
• Per project package management
• VirtualEnv creates isolated Py envs
• VirtualEnvWrapper makes things easy
• Pip to install your packages
• Next... Automate your deploys
About Me
•   Have been the Front End Tech Lead at Flight Centre

•   Interested in all things web and am a fan of the new
    RESTful back-end => thick client movement

•   Python at work for back office and Systems Admin tasks.
    Don’t get why SA’s love bash scripts so much

•   Can’t build Django apps at work so I build them for
    myself and external clients

•   I’m hardly a Python expert, but I love it!
Global Package Management
•   Starts out fine

•   Overtime, things get messy

•   Not great for development in teams (sync issues)

•   Challenges in keeping dev, stage and prod environments
    in sync

•   Sometimes you don’t even have control of the prod
    global site packages

•   Easy for things to break overtime when versions and
    dependencies not clearly set
Per Project Packages
•   Enter virtualenv, a tool for creating isolated Python
    environments

•   Better than workingenv as it doesn’t rely on
    $PYTHONPATH trickery

•   Better than virtual-python as it works on Windows
    (doesn’t rely on symlinks)

•   Any of these are better than nothing, I just think
    virtualenv does it best.

•   Version 1.6.1 supports PyPy 1.5. PyPy!
Installing virtualenv
•   sudo easy_install virtualenv, then add this to your .bashrc

•   Create a new Python environment

    •   virtualenv myproject --no-site-packages
        Don’t inherit from global site-packages directory

    •   virtualenv myproject --no-site-packages --distribute
        Uses distribute instead of setup_tools

    •   I think it’s best to ensure your new env does not inherit
        packages from your global site-packages directory

•   This is ok but to make things easier to manage, let’s use
    virtualenvwrapper (Thanks Doug Hellmann)
virtualenvwrapper
•   Organises your virtualenvs into one spot
    # Put this in your .bash_profile or .bashrc
    export WORKON_HOME=$HOME/.virtualenvs
    source /usr/local/bin/virtualenvwrapper_bashrc



•   Separates your virtualenvs from your project source

•   Nice environment event hooks for automation of
    repetitive tasks (cd project on post_activate)

•   Basically, it makes your use of virtualenv more efficient

•   Now we need the perfect package management tool for
    installing packages in our env...
VirtualEnvWrapper scripts
•   mkvirtualenv (create a new virtualenv)

•   rmvirtualenv (remove an existing virtualenv)

•   workon (change the current virtualenv)

•   add2virtualenv (add external packages in a .pth file to current
    virtualenv)

•   cdsitepackages (cd into the site-packages directory of current
    virtualenv)

•   cdvirtualenv (cd into the root of the current virtualenv)

•   deactivate (deactivate virtualenv, which calls several hooks)
Virtual EnvWrapper Hooks
•   postmkvirtualenv

•   prermvirtualenv

•   postrmvirtualenv

•   postactivate

•   predeactivate

•   postdeactivate
Introducing pip
•   Pip - Pip Installs Packages, nothing more, nothing less

•   It’s good, James Bennet explains - http://goo.gl/F9m2N

•   Great at re-producing builds of specific versions of
    packages, just remember to use versioning for each
    package.

•   Every project needs at least one requirements file
Installing packages
•   By default, searches PyPi just like easy_install

•   Can also install from:
    - tarballs containing a setup.py script
    - Editable checkouts from VCS repos
    - Editable checkouts from VCS repos with revision info

•   Can install packages from Pip bundles
Installing packages
•   Installation - sudo easy_install pip

•   Workflow
    1. Make or activate virtual env
    2. Install (and search for) packages

•   pip search
    pip install package-name (latest)
    pip install package-name==1.4.5 (specific)
    pip install package-name>=1.4.5 (at least...)

•   Install packages from requirements file
    pip install -r requirements.txt

•   Freeze current packages to produce requirements file
Terminal action!

• Finally, let’s write some code
• For those watching at home, go checkout
  Mathemtism’s excellent screen cast at
  http://goo.gl/wWkti
What about my editor?

•   Good Python editors and IDE’s should support
    virtual env

•   PyCharm does by you telling it which python
    interpreter should be used for each project, it then
    nows which site packages directory to use.
Summary

• Isolated Python environments are a must
• VirtualEnv,VirtualEnvWrapper are THE way
  to manage them
Docs

•   VirtualEnv
    http://www.virtualenv.org/en/latest/

•   VirtualEnvWrapper
    http://www.doughellmann.com/docs/virtualenvwrapper/

•   Pip
    http://www.pip-installer.org/en/latest/
References
•   Pip and VirtualEnv (Awesome!)
    http://mathematism.com/2009/07/30/presentation-pip-
    and-virtualenv/

•   Tools of the Modern Python Hacker:Virtualenv, Fabric
    and Pip
    http://www.clemesha.org/blog/modern-python-hacker-
    tools-virtualenv-fabric-pip

•   Notes on using pip and virtualenv with Django
    http://www.saltycrane.com/blog/2009/05/notes-using-pip-
    and-virtualenv-django/
Thanks!

• Ryan Blunden
  ryan.blunden@gmail.com
  @ryan_blunden

Contenu connexe

En vedette

2014_07_28_Django環境安裝以及 Django Book Chapter 4: Templates
2014_07_28_Django環境安裝以及 Django Book Chapter 4: Templates2014_07_28_Django環境安裝以及 Django Book Chapter 4: Templates
2014_07_28_Django環境安裝以及 Django Book Chapter 4: TemplatesKe Wei Louis
 
Jenkins djangovillage
Jenkins djangovillageJenkins djangovillage
Jenkins djangovillageLucio Grenzi
 
Virtualenv
VirtualenvVirtualenv
VirtualenvWEBdeBS
 
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
 
Python packaging and dependency resolution
Python packaging and dependency resolutionPython packaging and dependency resolution
Python packaging and dependency resolutionTatiana Al-Chueyr
 
Current State of Python Packaging
Current State of Python PackagingCurrent State of Python Packaging
Current State of Python PackagingClayton Parker
 
Using Python Packages - An Overview
Using Python Packages - An OverviewUsing Python Packages - An Overview
Using Python Packages - An OverviewDaniel Hepper
 
Function calling convention
Function calling conventionFunction calling convention
Function calling conventionYuk SeungChan
 
Django in Production
Django in ProductionDjango in Production
Django in ProductionHyun-woo Park
 
Django sharing
Django sharingDjango sharing
Django sharingTom Chen
 
Django와 flask
Django와 flaskDjango와 flask
Django와 flaskJiho Lee
 
Django, 저는 이렇게 씁니다.
Django, 저는 이렇게 씁니다.Django, 저는 이렇게 씁니다.
Django, 저는 이렇게 씁니다.Kyoung Up Jung
 
12 tips on Django Best Practices
12 tips on Django Best Practices12 tips on Django Best Practices
12 tips on Django Best PracticesDavid Arcos
 
Isolated development in python
Isolated development in pythonIsolated development in python
Isolated development in pythonAndrés J. Díaz
 

En vedette (17)

2014_07_28_Django環境安裝以及 Django Book Chapter 4: Templates
2014_07_28_Django環境安裝以及 Django Book Chapter 4: Templates2014_07_28_Django環境安裝以及 Django Book Chapter 4: Templates
2014_07_28_Django環境安裝以及 Django Book Chapter 4: Templates
 
Jenkins djangovillage
Jenkins djangovillageJenkins djangovillage
Jenkins djangovillage
 
Virtualenv
VirtualenvVirtualenv
Virtualenv
 
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
 
Python packaging and dependency resolution
Python packaging and dependency resolutionPython packaging and dependency resolution
Python packaging and dependency resolution
 
Current State of Python Packaging
Current State of Python PackagingCurrent State of Python Packaging
Current State of Python Packaging
 
Django Deployment-in-AWS
Django Deployment-in-AWSDjango Deployment-in-AWS
Django Deployment-in-AWS
 
Using Python Packages - An Overview
Using Python Packages - An OverviewUsing Python Packages - An Overview
Using Python Packages - An Overview
 
Stack frame
Stack frameStack frame
Stack frame
 
Function calling convention
Function calling conventionFunction calling convention
Function calling convention
 
Django in Production
Django in ProductionDjango in Production
Django in Production
 
Django sharing
Django sharingDjango sharing
Django sharing
 
Django와 flask
Django와 flaskDjango와 flask
Django와 flask
 
Django, 저는 이렇게 씁니다.
Django, 저는 이렇게 씁니다.Django, 저는 이렇게 씁니다.
Django, 저는 이렇게 씁니다.
 
12 tips on Django Best Practices
12 tips on Django Best Practices12 tips on Django Best Practices
12 tips on Django Best Practices
 
Isolated development in python
Isolated development in pythonIsolated development in python
Isolated development in python
 
Django quickstart
Django quickstartDjango quickstart
Django quickstart
 

Plus de Ryan Blunden

Container Camp Sydney 2017 Summary
Container Camp Sydney 2017 SummaryContainer Camp Sydney 2017 Summary
Container Camp Sydney 2017 SummaryRyan Blunden
 
Docker Multi-Stage Builds
Docker Multi-Stage BuildsDocker Multi-Stage Builds
Docker Multi-Stage BuildsRyan Blunden
 
Python typing module
Python typing modulePython typing module
Python typing moduleRyan Blunden
 
Transpiler’s are here to stay
Transpiler’s are here to stayTranspiler’s are here to stay
Transpiler’s are here to stayRyan Blunden
 
Promises in JavaScript with jQuery
Promises in JavaScript with jQueryPromises in JavaScript with jQuery
Promises in JavaScript with jQueryRyan Blunden
 
jQuery 1.4-1.6 Best new features
jQuery 1.4-1.6 Best new featuresjQuery 1.4-1.6 Best new features
jQuery 1.4-1.6 Best new featuresRyan Blunden
 

Plus de Ryan Blunden (6)

Container Camp Sydney 2017 Summary
Container Camp Sydney 2017 SummaryContainer Camp Sydney 2017 Summary
Container Camp Sydney 2017 Summary
 
Docker Multi-Stage Builds
Docker Multi-Stage BuildsDocker Multi-Stage Builds
Docker Multi-Stage Builds
 
Python typing module
Python typing modulePython typing module
Python typing module
 
Transpiler’s are here to stay
Transpiler’s are here to stayTranspiler’s are here to stay
Transpiler’s are here to stay
 
Promises in JavaScript with jQuery
Promises in JavaScript with jQueryPromises in JavaScript with jQuery
Promises in JavaScript with jQuery
 
jQuery 1.4-1.6 Best new features
jQuery 1.4-1.6 Best new featuresjQuery 1.4-1.6 Best new features
jQuery 1.4-1.6 Best new features
 

Dernier

Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...RKavithamani
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 

Dernier (20)

Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 

VirtualEnv and Pip - Isolated Python environments

  • 1. VirtualEnv and Pip Isolated Python environments Ryan Blunden Brisbane Python Group, May 2011
  • 2. Summary • Global site-packages management • Per project package management • VirtualEnv creates isolated Py envs • VirtualEnvWrapper makes things easy • Pip to install your packages • Next... Automate your deploys
  • 3. About Me • Have been the Front End Tech Lead at Flight Centre • Interested in all things web and am a fan of the new RESTful back-end => thick client movement • Python at work for back office and Systems Admin tasks. Don’t get why SA’s love bash scripts so much • Can’t build Django apps at work so I build them for myself and external clients • I’m hardly a Python expert, but I love it!
  • 4. Global Package Management • Starts out fine • Overtime, things get messy • Not great for development in teams (sync issues) • Challenges in keeping dev, stage and prod environments in sync • Sometimes you don’t even have control of the prod global site packages • Easy for things to break overtime when versions and dependencies not clearly set
  • 5. Per Project Packages • Enter virtualenv, a tool for creating isolated Python environments • Better than workingenv as it doesn’t rely on $PYTHONPATH trickery • Better than virtual-python as it works on Windows (doesn’t rely on symlinks) • Any of these are better than nothing, I just think virtualenv does it best. • Version 1.6.1 supports PyPy 1.5. PyPy!
  • 6. Installing virtualenv • sudo easy_install virtualenv, then add this to your .bashrc • Create a new Python environment • virtualenv myproject --no-site-packages Don’t inherit from global site-packages directory • virtualenv myproject --no-site-packages --distribute Uses distribute instead of setup_tools • I think it’s best to ensure your new env does not inherit packages from your global site-packages directory • This is ok but to make things easier to manage, let’s use virtualenvwrapper (Thanks Doug Hellmann)
  • 7. virtualenvwrapper • Organises your virtualenvs into one spot # Put this in your .bash_profile or .bashrc export WORKON_HOME=$HOME/.virtualenvs source /usr/local/bin/virtualenvwrapper_bashrc • Separates your virtualenvs from your project source • Nice environment event hooks for automation of repetitive tasks (cd project on post_activate) • Basically, it makes your use of virtualenv more efficient • Now we need the perfect package management tool for installing packages in our env...
  • 8. VirtualEnvWrapper scripts • mkvirtualenv (create a new virtualenv) • rmvirtualenv (remove an existing virtualenv) • workon (change the current virtualenv) • add2virtualenv (add external packages in a .pth file to current virtualenv) • cdsitepackages (cd into the site-packages directory of current virtualenv) • cdvirtualenv (cd into the root of the current virtualenv) • deactivate (deactivate virtualenv, which calls several hooks)
  • 9. Virtual EnvWrapper Hooks • postmkvirtualenv • prermvirtualenv • postrmvirtualenv • postactivate • predeactivate • postdeactivate
  • 10. Introducing pip • Pip - Pip Installs Packages, nothing more, nothing less • It’s good, James Bennet explains - http://goo.gl/F9m2N • Great at re-producing builds of specific versions of packages, just remember to use versioning for each package. • Every project needs at least one requirements file
  • 11. Installing packages • By default, searches PyPi just like easy_install • Can also install from: - tarballs containing a setup.py script - Editable checkouts from VCS repos - Editable checkouts from VCS repos with revision info • Can install packages from Pip bundles
  • 12. Installing packages • Installation - sudo easy_install pip • Workflow 1. Make or activate virtual env 2. Install (and search for) packages • pip search pip install package-name (latest) pip install package-name==1.4.5 (specific) pip install package-name>=1.4.5 (at least...) • Install packages from requirements file pip install -r requirements.txt • Freeze current packages to produce requirements file
  • 13. Terminal action! • Finally, let’s write some code • For those watching at home, go checkout Mathemtism’s excellent screen cast at http://goo.gl/wWkti
  • 14. What about my editor? • Good Python editors and IDE’s should support virtual env • PyCharm does by you telling it which python interpreter should be used for each project, it then nows which site packages directory to use.
  • 15. Summary • Isolated Python environments are a must • VirtualEnv,VirtualEnvWrapper are THE way to manage them
  • 16. Docs • VirtualEnv http://www.virtualenv.org/en/latest/ • VirtualEnvWrapper http://www.doughellmann.com/docs/virtualenvwrapper/ • Pip http://www.pip-installer.org/en/latest/
  • 17. References • Pip and VirtualEnv (Awesome!) http://mathematism.com/2009/07/30/presentation-pip- and-virtualenv/ • Tools of the Modern Python Hacker:Virtualenv, Fabric and Pip http://www.clemesha.org/blog/modern-python-hacker- tools-virtualenv-fabric-pip • Notes on using pip and virtualenv with Django http://www.saltycrane.com/blog/2009/05/notes-using-pip- and-virtualenv-django/
  • 18. Thanks! • Ryan Blunden ryan.blunden@gmail.com @ryan_blunden

Notes de l'éditeur

  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