Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Is it possible to install Nose (http://somethingaboutorange.com/mrl/projects/nose/0.11.1/) into a subdirectory of my home directory on a Linux machine? (I'm not on the sudoers list for that machine.) If so, how do I do that?

share|improve this question
add comment

2 Answers 2

up vote 2 down vote accepted

The answer is to use virtualenv.

But I didn't mention that (because I'm not on the sudoers list), I also did a custom Python install. When I installed correctly following Crast's instructions in http://stackoverflow.com/questions/2278028/how-do-i-work-around-this-problem-creating-a-virtualenv-environment-with-a-custom/2278059#2278059, I was able to install nose using that version of Python.

Update: I didn't notice until now that when I actually run nosetests, I get:

$ nosetests
bash: /home/dspitzer/apps/bin/nosetests: /usr/local/bin/python2.6: bad interpreter: No such file or directory

I'll try reinstalling with the --root option as suggested in the other answer.

share|improve this answer
    
I suggest you to try running a trivial python script that does nothing and see what happens. I strongly suspect that you have a broken python install. –  Anonymous Feb 20 '10 at 21:05
add comment

Also most setup.py scripts support a custom root directory setting. So you can use them like:

python setup.py install --root <a subdirectory of your home directory>

Having that subdirectory in PYTHONPATH, you shall be able to get access to modules that you installed there.

share|improve this answer
    
I ran python setup.py install --root ~/apps/nose-0.11.1/ and it seemed to install correctly. I found nosetests in ~/apps/nose-0.11.1/home/dspitzer/apps/bin/, but when I run it I get the same error: "bash: ./nosetests: /usr/local/bin/python2.6: bad interpreter: No such file or directory" –  Daryl Spitzer Feb 19 '10 at 19:21
    
With such --root the nosetests script shall get installed into ~/apps/nose-0.11.1/bin, the nose python package - into ~/apps/nose-0.11.1/lib/python2.6/site-packages. Running it from there gives an error. This is obvious - no nose in /usr/lib/python2.6/site-packages. Running it like "PYTHONPATH=~/apps/nose-0.11.1/usr/lib/python2.6/site-packages/ ./nosetests" when being in ~/apps/nose-0.11.1/bin makes it work as expected. Before doing this I've removed the nose package from my system (Slackware Linux 13.0) so it wouldn't interfere into my experiment. –  Anonymous Feb 20 '10 at 16:52
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.