1

I'm trying to install Err on Ubuntu Server 12.04.4. It requires python plus a bunch of dependencies.

When I followed the install instructions, I couldn't get it to work using the "default" which appeared to be Python 2.7. There seems to be a circular dependency in sleekxmpp (one of the requirements):

ImportError: cannot import name resolver

So my idea is to use Python 3 instead. My system has all of this installed:

python                                          install
python-apt-common                               install
python-dbus-dev                                 install
python-minimal                                  install
python-pip                                      install
python-pkg-resources                            install
python-setuptools                               install
python2.7                                       install
python2.7-minimal                               install
python3                                         install
python3-minimal                                 install
python3.2                                       install
python3.2-minimal                               install

When I use pip to install stuff, I have no idea if it's using python 2, or 3, or really, what anything is using (I can't see how to control which version of packages to install, what version of python these packages are based on with pip freeze).

I just want to have an environment that uses the latest version of Python 3 without all this other stuff confusing me. So I tried installing virtualenv and setting up the environment, but it appears to just be another python2.7 environment. In short I have no idea what's going on, and need some pointers.

Aditya
  • 13,416
njp
  • 113
  • 3

1 Answers1

2

Err pulls in a lot of dependencies along with it, so I would suggest to use Virtualenv in order to install it. And since they mention that as of Err v2.0, they have written it with Python 3 in mind, you should use Python 3 if you can (although Err is compatible with Python 2.7 too).

To understand how to use virtualenv, have a look at its documentation and create a couple of them to play and understand the concept. Basically virtualenv is to keep the dependencies separate for each project and not to mix up with the ones already installed on the system by default.

Virtualenv comes by default in the standard library from Python 3.3 onwards. But since you have Python 3.2, we would need to install it first.

sudo apt-get install python3-pip
sudo pip3 install virtualenv

Now, create the virtualenv for installing Err and activate it following the documentation above. I don't have Python 3.2 so cannot test it right now, but the following should work (assuming you want to create it at ~/venv/py3-err/):

python3 virtualenv.py ~/venv/py3-err/
. ~/venv/py3-err/bin/activate

Once activated install Err using pip. Since, you are facing issues with sleekxmpp, a bug was reported in this regard and it has been fixed in their Github master branch. So, install it directly from there:

pip install https://github.com/gbin/err/archive/master.zip

If you get any build-errors in this step, download the basic build-packages and re-run the above command:

sudo apt-get install build-essential cmake libffi-dev

Once installed, you need to save the config-template.py as config.py in a separate data directory. cd to this directory and start it by just running err.py or err.py --daemon following the user guide.

Aditya
  • 13,416