Python Installation For Projects
Python Installation For Projects
○ this creates a .python-version file in your project directory. Commit it to the repository
○ install all packages that your project needs with pip install <package_name>. Then freeze
pip with
pip freeze > requirements.txt
○ you should now have the intended environment. every time you cd into the project di-
rectory, pyenv automatically changes the virtualenv to venv_3.4.0 and all pip install hap-
pen there.
● Installing CV2
○ find package destination
○ make symlink to compiled cv2.so
DEPRECATED
● First we have to make sure you have a stable python version on your Mac OS X Lion
○ Use the guide here to install homebrew, python, pip, virtualenv
○ Use the guide here to install virtualenvwrapper
○ Create a virtualenv called tapp
mkvirtualenv tapp
○ Clone pyadb repo to your machine. Run the following commands inside it.
python setup.py build
sudo python setup.py install
■ Make sure your editor is set to 2 spaces by default (View > Indentation) when you
start modifying/creating any code. Before you commit any code to the repo, make
sure you run the auto formatter via the Command Palette.
○ Replicating a virtualenv
○ Also look at
○ making virualenv play nice with git
cd ../bar
workon bar
python bar.pymkvirtualenv foo
git clone ssh://foo
cd foo
pip install -r requirements.txt
python foo.py
cd ../bar
workon bar
python bar.py
○ http://hmarr.com/2010/jan/19/making-virtualenv-play-nice-with-git/
○ running a cron job with virtualenv
0 9 * * * /path/to/virtenv/bin/python /path/to/
cron_script.py
If this fails, you might need to put a working directory in the .plist file