• About
  • Blog
  • My Services
  • Twitter
  • LinkedIn
  • Email

Getting started with Python Virtualenv

Create a new Virtualenv

virtualenv {name_of_virtualenv}

Interactively load the virtualenv

source ./{name_of_virtualenv}/bin/activate

Work in the virtualenv

cd ~/{name_of_virtualenv}
git clone {repo}
pip install -r ./{repo}/requirements.txt
./{repo}/{some_thing}.py

Or, to run a python script within a virtualenv once (e.g. scheduled via cron)

./{name_of_virtualenv}/bin/python2.7 ./{name_of_virtualenv}/{repo}/{some_thing}.py
Tag
  • Python
  • linux

Share

Twitter Facebook Google+
Back to all post
comments powered by Disqus
Subscribe!
All content copyright © 2025 • All rights reserved.
Proudly published with Ghost