0

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?

Daryl Spitzer
  • 2,946
  • 9
  • 33
  • 40

2 Answers2

2

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 https://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.

Daryl Spitzer
  • 2,946
  • 9
  • 33
  • 40
  • 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
-1

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.

Anonymous
  • 1,540
  • 1
  • 14
  • 18
  • 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