Issue with Ex 46 - can't run nosetests

To the best of my knowledge, i’ve setup everything as per the instructions. I’m trying to get this right and to check if there’s anything i’ve missed out. For context, the version of python i’m using is 3.10.8 - although i’m not sure if this should be causing problems

This is what’s showing when call ls - R from the skeleton , the files seem to line up with the book except for some reason doesn’t show in the drop down list

Here’s the code from
—begin—(not included in code)
from setuptools import setup
except ImportError:
from distutils.core import setup

config = {
‘description’ : ‘My Project’,
‘author’: ‘My Name’,
‘url’: ‘URL to get it at.’,
‘download_url’: “Where to download it”,
‘author_email’: ‘My email.’,
‘version’: ‘0.1’,
‘install_requires’: [‘nose’],
‘packages’: [‘NAME’],
‘scripts’: [],
‘name’: ‘projectname’

—end—(not included in code)

and this is

—begin—(not included in code)
from import *
import NAME

def setup():

def teardown():
print(“TEAR DOWN!”)

def test_basic():
print(“I RAN!”, end=’ ')
—end—(not included in code)

when calling nosetests from the skeleton directory, the error message I get is as below

Traceback (most recent call last):
File “/Users/wenmingsoh/.venvs/lpthw/bin/nosetests”, line 8, in
File “/Users/wenmingsoh/.venvs/lpthw/lib/python3.10/site-packages/nose/”, line 118, in init
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/unittest/”, line 100, in init
File “/Users/wenmingsoh/.venvs/lpthw/lib/python3.10/site-packages/nose/”, line 179, in parseArgs
File “/Users/wenmingsoh/.venvs/lpthw/lib/python3.10/site-packages/nose/”, line 193, in createTests
self.test = self.testLoader.loadTestsFromNames(self.testNames)
File “/Users/wenmingsoh/.venvs/lpthw/lib/python3.10/site-packages/nose/”, line 481, in loadTestsFromNames
return unittest.TestLoader.loadTestsFromNames(self, names, module)
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/unittest/”, line 220, in loadTestsFromNames
suites = [self.loadTestsFromName(name, module) for name in names]
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/unittest/”, line 220, in
suites = [self.loadTestsFromName(name, module) for name in names]
File “/Users/wenmingsoh/.venvs/lpthw/lib/python3.10/site-packages/nose/”, line 454, in loadTestsFromName
return LazySuite(
File “/Users/wenmingsoh/.venvs/lpthw/lib/python3.10/site-packages/nose/”, line 53, in init
super(LazySuite, self).init()
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/unittest/”, line 22, in init
self._tests = []
File “/Users/wenmingsoh/.venvs/lpthw/lib/python3.10/site-packages/nose/”, line 106, in _set_tests
if isinstance(tests, collections.Callable) and not is_suite:
AttributeError: module ‘collections’ has no attribute ‘Callable’

I really don’t know how to get this right from here but I would really like to try if I can get help. Thanks in advance

Hi - try searching this site for Nosetest. There are a few threads about not using it as it pretty much unmaintained. Preference is now Pytest.