Actually I've had a couple of hiccups in my previously detailed server migration. Well - check that - this my second server migration; don't ask about the first one!
Anyways, I need PIL and Pycrypto for my Django/Satchmo sites. Using easy_install to setup Pycrypto didn't work; the compilation bailed with the error message "ld: cannot find -lpython". I'm somewhat familiar with this problem - you get this when the linking portion of compilation can't find a needed .so library. Most linux systems maintain a system to configure search paths and build a cache of dynamically linkable libraries. The walkthrough I'd followed had me add a file with the path of the python 2.6 .so in /etc/ld.so.conf and rebuild the linker cache with ldconfig. I verified (ldconfig -p | grep python) that the linker cache was aware of libpython.2.6.so. I tried fiddling with some environmental variables that allegedly set the LD search path; but testing via "ld -lpython2.6" still produced the error message, while manually setting the LD path (ld -lpython2.6 -L /opt/python2.6/lib) worked. Yes I looked at the privileges on the .so file and containing directory without finding a problem. Eventually I copied the .so file to a known location with
cp /opt/python2.6/lib/libpython2.6.so /usr/lib
and was able to sucessfully build Pycrypto. The next piece I needed was the Python Imaging Library and it had seemed to easy_install without incident. When I started a Django site, however, it stopped running with a cryptic error message: "AccessInit: hash collision". Googling yielded nothing except the C source code for the PIL module. I have no idea what provoked the crash and running a couple of scripts I had that used PIL to resize images didn't generate the exit either. Downloading the latest version and running the setup.py file generated a working install...
There's a reason I'm not a sysadmin. Solving problems with code makes me happy - and hard problems just make me think harder. I want to understand the problem and come up with a good solution! Sysadmin problems (broken environments) just make me swear frenziedly and I don't care so much about the solution, I just want stuff to work so I can get on with my job. I wasted several hours between PIL and Pycrpto and I still don't know why ld couldn't find my libraries or even what the AccessInit error mesage from PIL meant (besides the fact that two different things hashed to the same value that apparently shouldn't). Hopefully posting my travails helps somebody else who bumps into the same problem...
Update: I should clarify one thing - I said above that "I wasted several hours between PIL and PyCrypto". I meant that merely as a description of the problems I was working on - both of those packages are solid pieces of code with a wide user base. Obviously the problems I'm encountering are because I'm building a non-standard environment. Anyways - I'm not capping on any particular piece of software here... Just complaining about my skills and inclinations that make sysadmin stuff possible for me but not particularly enjoyable.
blog comments powered by Disqus