{"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"provenance":[],"authorship_tag":"ABX9TyOB851qIYyT+MMf76dDdBP6"},"kernelspec":{"name":"python3","display_name":"Python 3"},"language_info":{"name":"python"}},"cells":[{"cell_type":"code","execution_count":1,"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"ZCl-kuew3emJ","executionInfo":{"status":"ok","timestamp":1783281640759,"user_tz":-120,"elapsed":3824,"user":{"displayName":"Francesc Tarres Ruiz","userId":"06456031981481204454"}},"outputId":"d9478168-3734-40ad-9959-1f65a92891d9"},"outputs":[{"output_type":"stream","name":"stdout","text":["Found existing installation: pillow 11.3.0\n","Uninstalling pillow-11.3.0:\n","  Successfully uninstalled pillow-11.3.0\n","\u001b[33mWARNING: Skipping PIL as it is not installed.\u001b[0m\u001b[33m\n","\u001b[0m\u001b[33mWARNING: Skipping pillow-simd as it is not installed.\u001b[0m\u001b[33m\n","\u001b[0m['/usr/local/lib/python3.12/dist-packages', '/usr/lib/python3/dist-packages', '/usr/lib/python3.12/dist-packages', '/root/.local/lib/python3.12/site-packages']\n"]}],"source":["import sys, site, shutil, glob, os\n","\n","# Desinstalar paquetes relacionados\n","!pip uninstall -y pillow PIL pillow-simd\n","\n","# Localizar site-packages\n","paths = site.getsitepackages() + [site.getusersitepackages()]\n","print(paths)\n","\n","# Borrar restos de PIL/Pillow que puedan haber quedado\n","for base in paths:\n","    for pattern in [\"PIL\", \"Pillow*\", \"pillow*\"]:\n","        for p in glob.glob(os.path.join(base, pattern)):\n","            print(\"Eliminando:\", p)\n","            shutil.rmtree(p, ignore_errors=True)"]}]}