Ubuntu: package xxxx and python-xxxx



Question:

I am trying to install the latest version of package xxxx. I downloaded, unarchived and follow the readme: python setup-py install But python does not see my latest version. It seems that there is a python-xxxx package already installed (older version of xxxx) and python uses that I think. How do I remove this conflict? Can I just apt-get remove python-xxxx? But would that cause dependencies problem? (Arrgh, I am spending more time on installation issues than getting actual work done...)


Solution:1

If you're developing things*, I strongly recommend using virtualenv to create an entirely separate package environment for your development. This allows you to install anything without conflicting with the system... And perhaps more importantly, means the system updates won't conflict with your development (something I have lost hair to in the past).

If you have an installed program that depends on a newer version of a Python library, that's a bit tougher.

  • You could remove the python-xxxx package from Apt and install with sudo pip, but that might cause dependency issues with apt.

  • You could leave the packaged version and just install-over with sudo pip. This is dirty in so many ways but can occasionally work. I still wouldn't recommend it.

  • Or you could properly package up the newer version of the library into a deb and install it. I've just found a super-quick way of doing this, so I'll go over that now.

As I mentioned in the third bullet, packaging python packages is pretty simple once you know how. I'm going to suggest using stdeb. Once installed it makes the whole thing as simple as sudo pypi-install xxxx but there is immediately an issue: The current repository version is bugged and won't work. A newer version works though, and no, the irony is not lost on me.

You need to enable the Proposed repos (look in Software Sources under updates), then sudo apt-get update and finally sudo apt-get install python-stdeb.

Once you have done that, you can simply call:

sudo pypi-install xxxx  

And stdeb will generate a python-xxxx package with all the right version information and install it.

* things not intended to be released to the wider Ubuntu community, where using pre-packaged dependencies is desirable.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »