Pipenv is a user-friendly method of managing virtual environments and
packages.
You can look at it as a mix of pip and virtualenv, so you don’t have
to manage them seperately for your projects.

We’ll now install pipenv by running the following command:

$ pip3 install pipenv

Now we create a Python 3 environment for the project. Move to your project
directory and run the following command:

$ pipenv --three

The above command will create a virtual environment isolated from your system
global installation.

To install coala and all bears, run the following command:

$ pipenv install coala-bears

Great, you have now setup a pipenv environment for your project directory and
installed coala using it.
You can now activate the pipenv by running:

$ pipenv shell

Your virtual environment (virtualenv) is now active. You’ll notice the change
before the $ sign on the command-line which will have your project
directory name and some alpha-numeric value to make it unique.
You can use coala by running the coala command and exit the virtualenv
environment by entering exit at any time.

First, we need to install virtualenv to the system. You may already have this
installed as virtualenv or pyvenv. If you do not, this can be done
with pip3 easily:

$ pip3 install virtualenv

Once you have virtualenv installed, just fire up a shell and create
your own environment. I usually create a project folder and a venv
folder:

$ virtualenv venv

Note

If you have both Python 3 and Python 2 installed, use
virtualenvvenv-p$(whichpython3).
This creates an isolated Python 3 environment named venv
in your current directory, as coala only works for Python 3.4 and above.

Now, whenever you want to work on the project, you only have to activate
the corresponding environment.

On Unix based systems (OS X and Linux), this can be done with:

$ source venv/bin/activate

And on Windows this is done with:

$ venv\scripts\activate

Finally, you should install coala and the supported bears inside the activated
virtualenv with:

The recommended way to use coala is using docker: coala has a lot of
dependencies because it has so much code analysis for so many languages. If you
use our docker image, you can run it like any other tool but you do not need to
care about those! The general command to run coala is:

This will automatically download the docker image with all the coala
dependencies for you. The image may take up a bit over 2GB of space on your
disk. Check out the native installation if this is not for you.

Those dependencies are not mandatory. You may install all of the
dependencies if you want to install all the bears. The bear
application also asks for the packages needed in case it does not
have it.

The requirements files ( Gemfile, requirements.txt, etc.) are in
the coala-bears repository and you should not get them from
source, but you should git clone the repository if you want to
execute those commands.

This section lists dependencies of coala that are not automatically
installed. On Windows, you can get many with nuget
(https://www.nuget.org/). On Mac, Homebrew will help you installing
dependencies (http://brew.sh/). These dependencies require you to have
the repository
cloned locally.

In case you are getting
ValueError:('Expectedversionspecin','appdirs~=1.4.0','at','~=1.4.0'), then don’t panic. It happens when you are using an outdated
version of pip that doesn’t support our version specifiers yet.