Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError: No module named 'chess' when upgrading python-chess to 1.999 #680

Closed
Harmon758 opened this issue Oct 26, 2020 · 2 comments

Comments

@Harmon758
Copy link
Contributor

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.

@niklasf niklasf added the bug label Oct 27, 2020
@niklasf
Copy link
Owner

niklasf commented Oct 27, 2020

Thanks for reporting. Which pip --version is this? Ah, nevermind. I can reproduce the issue when upgrading exactly as you do, but not when installing fresh.

@niklasf
Copy link
Owner

niklasf commented Nov 29, 2020

I see no great way to fix this. So instead I added the workaround for users who are updating to the README, and new users won't have this issue.

@niklasf niklasf closed this as completed Nov 29, 2020
niklasf added a commit that referenced this issue Nov 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants