Skip to content

rschumann/python-on-osx

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 

Repository files navigation

How to setup python environment on Mac OS X Yosemite

On this page I describe how to setup python environment on Mac OS X Yosemite (10.10).

Know issues

Now don't work some applications on OS X Yosemite:

  • Gmail doesn't work - Mail app crashes on Yosemite. After update from Mavericks to Yosemite I have troubles with Mail app - it turned off after few seconds after launch. I have found this solution and it works well for me. Try it. It's easy and solve your problem. As I understand this problem appear if you have a lot of messages (1000+) into Gmail Inbox
  • mongodb - was problem in Beta version of yosemite. In final version it was solved

HomeBrew

Before you start, open Terminal application and install Xcode command-line tool. It's required to install a lot of software on your Mac.

xcode-select --install

Install HomeBrew to have ability to install up-to-date software, like apt-get install in Ubuntu.

My list of brew software (use brew install [package_name]):

  • memcached
  • mercurial
  • git
  • mysql
  • postgresql
  • mongodb
  • rabbitmq
  • node
  • wget
  • --- optional ---
  • zookeeper --with-python
  • boost --with-python
  • lynx
  • cairo
  • jpeg
  • jsoncpp
  • gettext
  • glib
  • libpng
  • log4cpp

System changes

Edit nano ~/.profile file to have this lines:

# load all completions
source /usr/local/etc/bash_completion.d/*
# load virtual env wrapper
source virtualenvwrapper.sh
# Set architecture flags
export ARCHFLAGS="-arch x86_64"
# Ensure user-installed binaries take precedence
export PATH=/usr/local/bin:$PATH
# Load .bashrc if it exists
test -f ~/.bashrc && source ~/.bashrc

Press Cmd + O to save file, Cmd + X to exit from nano. Run this command in terminal source ~/.profile to load changes.

Edit ~/.hgrc and insert info about my user:

[ui]
username = User Name <user@gmail.com>

Python tools

  • brew install python installs python and pip
  • pip install virtualenv
  • pip install virtualenvwrapper

Django completion

Add autocompletion in terminal when we type manage.py or django-admin.py and press <tab> key two times

  • cd /usr/local/etc/bash_completion.d/
  • wget https://raw.github.com/django/django/master/extras/django_bash_completion
  • source ~/.profile to affect changes

Post-installation

  • create virtual environments for projects mkvirtualenv [env_name] and run pip install -r requirements.txt
  • restore MySQL databases
  • restore mongodb collections: 1. mongodump --out backup/ 2. mongorestore backup/

Software

This is my list of sofrware that I use:

Setup OS X integration with web sites

Read also

About

How to setup python environment on Mac OS X Yosemite

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published