Hi everyone, an error occurred while importing pennylane on Google Colab. I’ve tried many things, but the error still occurs.
Installation of Python 3.8.20
!apt-get update
!apt-get install python3.8 python3.8-distutils
!update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1
!wget https://bootstrap.pypa.io/get-pip.py
!python3.8 get-pip.py
Installation of Packages
!python3.8 -m pip install --upgrade pip
!python3.8 -m pip install tensorflow==2.4.0
!python3.8 -m pip install --force-reinstall pennylane==0.17.0
!python3.8 -m pip install --force-reinstall strawberryfields==0.18.0
!python3.8 -m pip install pennylane-sf==0.16.0
!python3.8 -m pip install numba==0.53.1
!python3.8 -m pip install numpy==1.19.5 matplotlib scikit-learn pandas scikit-image
pip list
import pennylane as qml
If you run it, this error will occur.
I saw someone else resolve a similar issue with ‘pip install autoray==0.2.5’, so I added
!python3.8 -m pip install --force-reinstall autoray==0.2.5
at the last of the ‘Installation of Packages’ cell.
But the problem wasn’t resolved.
Does anyone have an idea how to solve this problem?