-2

Attempting to run the following in python but getting errors:

import info
user = info.usersInfo()['user']
module 'info' has no attribute 'usersInfo'


File "<ipython-input-25-2a848fa5f31d>", line 1, in <module>
user = info.usersInfo()['user']

AttributeError: module 'info' has no attribute 'usersInfo'

Any suggestions?

alexsmith2
  • 331
  • 4
  • 12

1 Answers1

-1

You have imported a namespace (info), not an object. You are trying to use info as an object or class name. You will need to import a specific class to be able to create that object or call a class method.

SSutcliffe
  • 29
  • 1
  • 6
  • Why did this get down voted? It still looks to me like you are trying to call a method on a namespace. – SSutcliffe Jun 07 '18 at 16:32
  • I downvoted because it's wrong. For a module `info` with a `usersInfo` function, `info.usersInfo()` is a valid way to call that function. – user2357112 Jun 07 '18 at 16:55