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

SystemError: extension module 'black' is already cached #4544

Closed
tyralla opened this issue Jan 5, 2025 · 2 comments
Closed

SystemError: extension module 'black' is already cached #4544

tyralla opened this issue Jan 5, 2025 · 2 comments
Labels
T: bug Something isn't working

Comments

@tyralla
Copy link

tyralla commented Jan 5, 2025

Unfortunately, I get this error only on AppVeyor and cannot reproduce it locally. It only happens under Python 3.13. According to their documentation, they recently switched from a release candidate to 3.13.1. I waited for this switch before filing this issue, but the problem remains.

Here is the complete traceback:

Traceback (most recent call last):
  File "C:\projects\hydpy-hep1s\prepare_build.py", line 258, in <module>
    main()  # pylint: disable=no-value-for-parameter
    ~~~~^^
  File "C:\Python313-x64\Lib\site-packages\click\core.py", line 1161, in __call__
    return self.main(*args, **kwargs)
           ~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "C:\Python313-x64\Lib\site-packages\click\core.py", line 1082, in main
    rv = self.invoke(ctx)
  File "C:\Python313-x64\Lib\site-packages\click\core.py", line 1443, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python313-x64\Lib\site-packages\click\core.py", line 788, in invoke
    return __callback(*args, **kwargs)
  File "C:\projects\hydpy-hep1s\prepare_build.py", line 251, in main
    _convert_interfaces(fast_cython=fast_cython, profile_cython=profile_cython)
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\projects\hydpy-hep1s\prepare_build.py", line 91, in _convert_interfaces
    from hydpy import config
  File "C:\projects\hydpy-hep1s\hydpy\__init__.py", line 21, in <module>
    from hydpy.core import pubtools
  File "C:\projects\hydpy-hep1s\hydpy\core\pubtools.py", line 10, in <module>
    from hydpy.core import exceptiontools
  File "C:\projects\hydpy-hep1s\hydpy\core\exceptiontools.py", line 10, in <module>
    from hydpy.core import objecttools
  File "C:\projects\hydpy-hep1s\hydpy\core\objecttools.py", line 18, in <module>
    import black
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 921, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 819, in module_from_spec
  File "<frozen importlib._bootstrap>", line 797, in _init_module_attrs
SystemError: extension module 'black' is already cached

pip-installed black version: 24.10.0

Any more information I can help with?

@tyralla tyralla added the T: bug Something isn't working label Jan 5, 2025
@hauntsaninja
Copy link
Collaborator

hauntsaninja commented Jan 5, 2025

You maybe already know all of this, but just in case.... Black wheels are compiled with mypyc. I ran into this in a beta release of CPython 3.13 and it was fixed upstream, see python/mypy#17748. Could you confirm the Python version?

@tyralla
Copy link
Author

tyralla commented Jan 5, 2025

Oh no, I should have checked more carefully before filing this issue. Despite the announced update to Python 3.13.1, AppVeyor's Visual Studio 2019 and 2022 images still contain version 3.13.0rc1 (tags/v3.13.0rc1:e4a3e78, Jul 31 2024, 20:58:38) [MSC v.1940 64 bit (AMD64)].

Thanks for the quick and helpful response!

In case anyone else encounters this problem, here is the link to the related AppVeyor discussion I just started: https://help.appveyor.com/discussions/problems/37742-python-3131

@tyralla tyralla closed this as completed Jan 5, 2025
sbraz added a commit to sbraz/pymediainfo that referenced this issue Feb 11, 2025
This could be useful to see whether the version is a release or a beta.
See e.g. psf/black#4544 and
https://help.appveyor.com/discussions/problems/37742-python-3131.
@sbraz sbraz mentioned this issue Feb 11, 2025
3 tasks
sbraz added a commit to sbraz/pymediainfo that referenced this issue Feb 11, 2025
This could be useful to see whether the version is a release or a beta.
See e.g. psf/black#4544 and
https://help.appveyor.com/discussions/problems/37742-python-3131.
sbraz added a commit to sbraz/pymediainfo that referenced this issue Feb 11, 2025
This could be useful to see whether the version is a release or a beta.
See e.g. psf/black#4544 and
https://help.appveyor.com/discussions/problems/37742-python-3131.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants