Frankly, my upgrade for the newest release of Ubuntu 12.04 Precise broke my OS.
And I didn't have any chance to recover it. So I just reinstalled Ubuntu and got fresh,
but empty operation system. The last time when I did setup of Python development environment was one year ago.
All my notes about this things were old and unsuitable for the latest Ubuntu release.
This post is summary of my actions to setup Python development environment from scratch.
Install Python setuptools package:
And If you have any comments and suggestions, please, post them in comments. Thanks.
Install Python setuptools package:
sudo apt-get install python-setuptools python-pipInstall virtualenvwrapper:
sudo pip install virtualenvwrapperSetup virtualenvwrapper:
mkdir -p ~/.virtualenvs echo 'export WORKON_HOME=~/.virtualenvs' >> ~/.bashrc echo 'export DJANGO_SITES_ROOT=$HOME/projects/' >> ~/.bashrc echo 'source /usr/local/bin/virtualenvwrapper.sh' >> ~/.bashrc source ~/.bashrcInstall Django extension for virtualenvwrapper. I have several Django projects, but if you aren't using Django, then you can skip this step:
sudo apt-get install git-core mkdir -p ~/.virtualenvs/django-libs cd ~/.virtualenvs/django-libs git clone https://github.com/epicserve/django-environment.git cd ~/.virtualenvs/django-libs/django-environment/django_env/bin/ install.pyTest virtualenvwrapper:
cd ~/projects mkvirtualenv example cd example && lsInstall PIL with JPEG, ZLib and FreeType support, if you aren't using PIL, then you can skip this step:
sudo apt-get install libjpeg62-dev zlib1g-dev libfreetype6-dev cd ~/.virtualenvs/{project-name}For 32-bit systems:
ln -s /usr/lib/i386-linux-gnu/libz.so ./lib/ ln -s /usr/lib/i386-linux-gnu/libjpeg.so ./lib/ ln -s /usr/lib/i386-linux-gnu/libfreetype.so ./lib/For 64-bit systems:
ln -s /usr/lib/x86_64-linux-gnu/libz.so ./lib/ ln -s /usr/lib/x86_64-linux-gnu/libjpeg.so ./lib/ ln -s /usr/lib/x86_64-linux-gnu/libfreetype.so ./lib/ pip install PILI'm big fan of Vim, so here is steps for Vim also:
sudo apt-get install vim.gtkInstall Pathogen plugin:
mkdir -p ~/.vim/autoload ~/.vim/bundle curl -so ~/.vim/autoload/pathogen.vim https://raw.github.com/tpope/vim-pathogen/master/autoload/pathogen.vimadd to ~/.vimrc file:
call pathogen#infect()Install Fugitive for Git support and Python-mode for all Python stuff in Vim:
cd ~/.vim/bundle git clone git://github.com/tpope/vim-fugitive.git git clone git://github.com/klen/python-mode.gitInstall super-fast Command-T plugin for opening files in Vim:
cd ~/.vim/bundle git clone git://git.wincent.com/command-t.git cd ~/.vim/bundle/command-t rake makeThat's all folks. I will keep this post updated for a while.
And If you have any comments and suggestions, please, post them in comments. Thanks.
Hi Andrey,
ReplyDeleteI remember going through a lot of grief trying to install PIL in virtualenv. I wanted to enable jpg support and I remember fiddling with soft links in order to enable it. Later I found that there is "Pillow" (http://pypi.python.org/pypi/Pillow). Everything was discovered and work correctly after "pip install pillow". It is drop-in replacement for PIL. Everything works as in PIL. I didn't have to change any code (from PIL import Image).
Cool vim setup. I should look into it.
Thank you very much
ReplyDelete