ModuleNotFoundError: No module named 'chess' when upgrading python-chess to 1.999
When upgrading to python-chess 1.999, pip (tested with the latest version, 20.2.4) seems to uninstall the older version of python-chess being upgraded from (e.g. v1.2.0) after the new chess dependency is installed:
>pip install python-chess==1.2.0 Collecting python-chess==1.2.0 Using cached python_chess-1.2.0-py3-none-any.whl (140 kB) Installing collected packages: python-chess Successfully installed python-chess-1.2.0 >pip install --upgrade python-chess Collecting python-chess Using cached python_chess-1.999-py3-none-any.whl (1.4 kB) Collecting chess<2,>=1 Using cached chess-1.2.1-py3-none-any.whl (140 kB) Installing collected packages: chess, python-chess Attempting uninstall: python-chess Found existing installation: python-chess 1.2.0 Uninstalling python-chess-1.2.0: Successfully uninstalled python-chess-1.2.0 Successfully installed chess-1.2.1 python-chess-1.999 >py Python 3.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020, 15:57:54) [MSC v.1924 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import chess Traceback (most recent call last): File "<stdin>", line 1, in <module> ModuleNotFoundError: No module named 'chess'
with the result being the newly installed chess module is uninstalled and isn't found on import, causing the error.
pip install --force-reinstall chess resolves the issue and python-chess can be uninstalled with pip uninstall python-chess without issue.