Colab already includes a preinstalled version of Scikit‑learn. Before setting up pyAMPA, remove the existing Scikit‑learn installation from the environment. Then proceed with the setup and run the remaining cells. If you don’t remove it, Colab will use the newer preinstalled version instead of the required Scikit‑learn 1.2.2.
Here are the codes to do that, or you can use this Colab
#Remove scikit-learn to run this Notebook
!pip uninstall scikit-learn sklearn -y
#verify the uninstallation
import sys
#Force clear the module from memory if it was imported
if 'sklearn' in sys.modules:
del sys.modules['sklearn']
try:
import sklearn
print(f'Warning: scikit-learn is still installed. Version: {sklearn.version}')
except ImportError:
print('Success: scikit-learn is no longer installed.')
After running the SETUP cell, check the installation of Scikit-learn 1.2.2.
#Check current version of Scikit-learn
try:
import sklearn
print(f"scikit-learn is installed. Version: {sklearn.version}")
except ImportError:
print("scikit-learn is not installed.")
Colab already includes a preinstalled version of Scikit‑learn. Before setting up pyAMPA, remove the existing Scikit‑learn installation from the environment. Then proceed with the setup and run the remaining cells. If you don’t remove it, Colab will use the newer preinstalled version instead of the required Scikit‑learn 1.2.2.
Here are the codes to do that, or you can use this Colab
#Remove scikit-learn to run this Notebook
!pip uninstall scikit-learn sklearn -y
#verify the uninstallation
import sys
#Force clear the module from memory if it was imported
if 'sklearn' in sys.modules:
del sys.modules['sklearn']
try:
import sklearn
print(f'Warning: scikit-learn is still installed. Version: {sklearn.version}')
except ImportError:
print('Success: scikit-learn is no longer installed.')
After running the SETUP cell, check the installation of Scikit-learn 1.2.2.
#Check current version of Scikit-learn
try:
import sklearn
print(f"scikit-learn is installed. Version: {sklearn.version}")
except ImportError:
print("scikit-learn is not installed.")