The Random Ramblings

lost? dazed? confused? dont come here then as this aint goona help!!

Install Python modules from git using pip

As you must be now aware I am learning to program. That learning was massively accelerated when I was actually put to task on building a small back-end processing system to deliver a small number of PDFs so they could be displayed in an iPad app.

As with all things in IT, a 35 line script is now over 500 and doing far more than you could ever imagine.

It also now at the point where we are in full preproduction testing, ie no more dicking around with code on the server that will be pushing live editions. This has led to the building of a new environment. As the prod box was add modules when required I didn't think much about writing that down and there were already a lot installed, due to the many other scripts that I have written recently. This obviously lead to a big shock at how much is now being used that isn't part of the standard libs.

One annoying thing was PyPDF2, pip couldn't find the package on an attempted install, so, thinking I might have spelt it wrong a quick search confirmed that I was correct and I tried again, still a fail. I hate having to manually compile things like this as I have a lot of experience of battling with systems where people hadn't used package managers and the pain that can cause. It's here that I found this little gem that I hadn't seen mentioned anywhere else before, the pip install from git.

for PyPDF2 it was as simple as

sudo pip install -e git://github.com/knowah/PyPDF2.git#egg=PyPDF2

Basically the -e edits and so requires the #egg=packagename to know what to install.

Quick simple and manageable

Find Me
Category
100daysofcode
Alexa
films
Javascript learning