Hello Guys, How are you all? Hope You all Are Fine. I am facing the following error ImportError: cannot import name ‘PY3’ from ‘torch._six’ in Python. So Here I am Explain to you all the possible solutions here.
Without wasting your time, Let’s start This Article to Solve This Error.
How ImportError: cannot import name ‘PY3’ from ‘torch._six’ Error Occurs ?
I am facing the following error
ImportError: cannot import name 'PY3' from 'torch._six'
How To Solve ImportError: cannot import name ‘PY3’ from ‘torch._six’ Error ?
How To Solve ImportError: cannot import name ‘PY3’ from ‘torch._six’ Error ?
You are facing this error cause of your ‘torchvision’ and ‘pytorch’ version, they didn’t match. So, you need to upgrade your ‘torchvision’ and ‘pytorch’ version to the new version. Just follow below code pip install –upgrade torch torchvision.
Solution 1: upgrade torch torchvision
You are facing this error cause of your ‘torchvision’ and ‘pytorch’ version, they didn’t match. So, you need to upgrade your ‘torchvision’ and ‘pytorch’ version to the new version
pip install --upgrade torch torchvision
Solution 2: Install PY3
Install PY3 in your environment
pip install py3
Summery
It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?
Also Read