Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

beginner installing nosetests package

I'm trying to install the following as per the learnpythonthehardway tutorial:

  1. pip from http://pypi.python.org/pypi/pip
  2. distribute from http://pypi.python.org/pypi/distribute
  3. nose from http://pypi.python.org/pypi/nose/
  4. virtualenv from http://pypi.python.org/pypi/virtualenv

I've visited these links and clicked the download button; each file is in my downloads folder now, and I unarchive/unzipped them- not sure what this means but it seemed required. Are they "installed"? If not, what does it mean to really install them? I've tried typing nosetests in the terminal (as the book says you should), as well as tried easy_install but that doesn't seem to work. It appears my understanding is limited in a number of ways here.

I get the following -bash: nosetests: command not found, but am trying to get:

nosetests . ---------------------------------------------------------------------- Ran 1 test in 0.007s OK

like image 817
ZCJ Avatar asked Feb 14 '12 00:02

ZCJ


People also ask

Which command is used to run nose tests?

nose can be integrated with DocTest by using with-doctest option in athe bove command line. The result will be true if the test run is successful, or false if it fails or raises an uncaught exception. nose supports fixtures (setup and teardown methods) at the package, module, class, and test level.

How do I get PIP in Python?

Step 1: Download the get-pip.py (https://bootstrap.pypa.io/get-pip.py) file and store it in the same directory as python is installed. Step 2: Change the current path of the directory in the command line to the path of the directory where the above file exists. Step 4: Now wait through the installation process. Voila!


2 Answers

Find out where the nosetests script is. On OSX:

/usr/local/share/nosetests

Execute directly, or set up a bash alias, perhaps in .bash_profile:

alias nosetests='/usr/local/share/python/nosetests'
alias nosetests3='/usr/local/share/python3/nosetests'
like image 52
tfgrahame Avatar answered Oct 13 '22 01:10

tfgrahame


This works on mac, it may work on linux

1)Open terminal (Be prepared to enter your password)

2)Type: sudo easy_install pip

3)Type: sudo pip install distribute

4)Type: sudo pip install nose

5)Type: sudo pip install virtualenv

Hope that helps, cheers!

like image 25
mharris7190 Avatar answered Oct 13 '22 00:10

mharris7190