Import error :unable to check device status


no module named boltiot

Hi @mahadikvedant2017,

It seems that you have not installed the Bolt IoT library which is required for you to run your code.

Please go through the VPS setup topic again, and you will find the instructions required to install the libaray.

Hi @mahadikvedant2017
It seems that you are using Ubuntu on vmware workstation & working with Ubuntu is complicated specially on vmware .
Check the following :

  • Ubuntu has multiple version of Python installed.
  • If there is multiple version of Python check in which version the boltiot module installed.

If your problem is not get solved then

  • Try installing Python3.8 directly on windows and then install boltiot package using pip command. It will work if you system is connected with internet .
  • Or you can use ubuntu on AWS ec-2 instances which is cloud ubuntu server & it is free of cost for 12 months if you create new account on AWS.

Hi,

You can install Anaconda Navigator or Python 3.7 to run python code, which are alternative for DigitalOcean or Vmware-Ubuntu.
For project 6, Python code we get error message as “TypeError: ‘module’ object is not callable”.
Resolution: We can just code as below to get the response- if your using directly python tool then internet should be connected to your system.

api_key = “your API key”
device_id = “BOLTXXXXXX”
mybolt = Bolt.Bolt(api_key,device_id) — Calling bolt class which is in bolt file.
response=mybolt.isOnline()
print(response)

Thanks

This error occurs when the python compiler gets confused between function name and module name and try to run a module name as a function. This error statement TypeError: ‘module’ object is not callable is raised as you are being confused about the Class name and Module name. The problem is in the import line . You are importing a module, not a class. This happend because the module name and class name have the same name .

If you have a class MyClass in a file called MyClass.py , then you should write:

from MyClass import MyClass

In Python , a script is a module, whose name is determined by the filename . So when you start out your file MyClass.py with import MyClass you are creating a loop in the module structure. Also, note that this usually happens when you import any kind of module as a function.

You will first need to install the module. Try using pip install boltiot.