Tag Archives: pyenv

Install and setup PostgreSQL for Django

1. Deactivate the virtualenv if there is.

pyenv deactivate

 

2. Install the required libraries.

sudo apt-get install libpq-dev python-dev

 

3. Install PostgreSQL.

sudo apt-get install postgresql postgresql-contrib

Continue reading Install and setup PostgreSQL for Django

Advertisements

Install Graphite under pyenv virtualenv on Ubuntu

It took me one and an half day to get the Graphite working…

1. Make sure you have pyenv and pyenv-virtualenv installed.

 

2. Install the following packages.

sudo apt-get install python-dev pkg-config libcairo2-dev memcached

 

3. Install Python 2.7 with enable-shared.

env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 2.7.8

Continue reading Install Graphite under pyenv virtualenv on Ubuntu

Perl – Setting locale failed

I tried to install Python using pyenv but came across the following error:

vagrant@vagrant-ubuntu-trusty-64:~$ pyenv install 2.7.8
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LC_CTYPE = "UTF-8",
	LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

 

For those which are unset, set the environmental variables in .bashrc or .bash_profile.

export LANGUAGE=en_US.UTF-8
export LC_ALL=en_US.UTF-8

 

Re-login and try again.

Done =)

Reference: perl: warning: Please check that your locale settings ubuntu

Manage your Python projects with virtualenv

Last week we talked about managing multiple Pythons using pyenv.

 

But still we are lacking something like the Gemfile in Ruby for managing the version of those Python packages in a Python project. And here comes the Python virtualenv.

We can create different virtualenv on the same machine and each of them has its own Python binary, the pip package and the all other standard Python libraries needed to run the Python. In other words, each virtualenv acts like the Gemfile in a particular Python project.
Continue reading Manage your Python projects with virtualenv