Project 6: Checking Device Status and Restarting the Device

“ImportError” cannot import name ‘PathLike’
"AttributeError: module ‘os’ has no attribute ‘PathLike’

@sec19ec082

I am inviting @rahul.singh1 to look into this.

@sec19ec082

The issue seems to be in the os library of your current python version. You can update the python version and it should resolve this error.

Follow the steps in the link below, to update your python and set all of it as default,

No sir for me, In “SETUP THE BOLT PYTHON LIBRARY”
STEP 3 : sudo pip3 install boltiot
Showing ERROR while running the above code.

@sec19ec082

As I have mentioned earlier, upgrade your python version from 3.5 to 3.7

Click on the link and follow the steps. It should be able to run after that.

No sir I have try it but it shows error

@sec19ec082

Try below commands serially

apt update
sudo apt install software-properties-common

Then

sudo apt-get update

Then

sudo apt install python3.7

Let me know if you get the same result.

Yes sir, SAME ERROR IS COMING.

hello,
what is the solution to this @akshayan.sinha?
i am facing the issue.

@adeeshdesai

Are you facing the same issue? Have you gone through the python update process?

yes, i have.
it says 0 updates available.

@adeeshdesai

And what is your current python version?

the current version is 3.5.2

@adeeshdesai

Try below commands serially

apt update
sudo apt install software-properties-common

Then

sudo add-apt-repository ppa:deadsnakes/ppa

Then

sudo apt-get update

Then

sudo apt install python3.7

Now test python version with

python3.7 --version

Let me know if you get the same result.

@akshayan.sinha,
the update to python3.7 is successful.
Thank you.

Sir, again error is coming

Hi @sec19ec082,

You can ignore this error.

Type the below command and send me the screenshot of the output.

sudo python --version
sudo python3 --version
sudo python3.7 --version

Sir, even successully upgrading, in Setup the bolt python library i am getting error

@sec19ec082

Try pip instead of pip3.

sudo pip install boltiot

Looks like you installed python3-pip. So it should work this way.