Error in pre-release 3.13.0b2

OS: Windows 10
Python version: 3.13.0b2
Error that occurs when calling the Python interpreter in the console (cmd.exe):

C:\Users\1>py
Python 3.13.0b2 (tags/v3.13.0b2:3a83b17, Jun 5 2024, 19:01:25) [MSC v.1940 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
Failed calling sys.__interactivehook__
Traceback (most recent call last):
  File "<frozen site>", line 489, in register_readline
  File "D:\Program Files\Python310\Lib\rlcompleter.py", line 34, in <module>
    import inspect
  File "D:\Program Files\Python310\Lib\inspect.py", line 146, in <module>
    import dis
  File "D:\Program Files\Python310\Lib\dis.py", line 19, in <module>
    FORMAT_VALUE = opmap['FORMAT_VALUE']
                   ~~~~~^^^^^^^^^^^^^^^^
KeyError: 'FORMAT_VALUE'
warning: can't use pyrepl: 'FORMAT_VALUE'
>>>print(200)
200

And also an error that occurs when executing .py files:

D:\Python\MYFOLDER>py solaris.py
Traceback (most recent call last):
  File "D:\Python\MYFOLDER\solaris.py", line 9, in <module>
    from faker import Faker
  File "D:\Program Files\Python310\Lib\site-packages\faker\__init__.py", line 1, in <module>
    from faker.factory import Factory
  File "D:\Program Files\Python310\Lib\site-packages\faker\factory.py", line 8, in <module>
    from .config import AVAILABLE_LOCALES, DEFAULT_LOCALE, PROVIDERS
  File "D:\Program Files\Python310\Lib\site-packages\faker\config.py", line 11, in <module>
    PROVIDERS = find_available_providers([import_module(path) for path in META_PROVIDERS_MODULES])
                                          ~~~~~~~~~~~~~^^^^^^
  File "D:\Program Files\Python310\Lib\importlib\__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Program Files\Python310\Lib\site-packages\faker\providers\__init__.py", line 7, in <module>
    from ..generator import Generator
  File "D:\Program Files\Python310\Lib\site-packages\faker\generator.py", line 6, in <module>
    from .typing import SeedType
  File "D:\Program Files\Python310\Lib\site-packages\faker\typing.py", line 1, in <module>
    import dataclasses
  File "D:\Program Files\Python310\Lib\dataclasses.py", line 5, in <module>
    import inspect
  File "D:\Program Files\Python310\Lib\inspect.py", line 146, in <module>
    import dis
  File "D:\Program Files\Python310\Lib\dis.py", line 19, in <module>
    FORMAT_VALUE = opmap['FORMAT_VALUE']
                   ~~~~~^^^^^^^^^^^^^^^^
KeyError: 'FORMAT_VALUE'

I installed Python in the same folder as Python 3.10.0 to “update” it (which is why the folder is called Python310).

Well, don’t do that. Some old files where found/not overwritten and now you are getting error messages. Uninstall the old python version and install the new one, or even better, just have both in parallel and switch over projects as the need arises.

Oh, and this install folder is now basically completely bricked. You are going to need to completely delete it.

1 Like

What about the installed libraries? Will nothing happen if I move site-packages to the folder with the new version?

In general, you need to re-install third-party libraries anyway, especially if they use any non-Python extensions (so things like Numpy). There’s no guarantee that the existing installed libraries are compatible with a future version of Python - the library writers can’t predict future deprecations, removals or breaking changes in either the standard library or the language syntax. It’s much worse with extensions, because details of the API change all the time (so does the bytecode standard, but this usually shouldn’t matter. I think.)

For example, before the async keyword was added to the language grammar, lots of third-party libraries that do asynchronous programming would use async as a variable name. It was fine until it wasn’t; and there was no good reason to think that it would ever stop being fine, until there was.

Tkanks, that helped! However, I had to uninstall Python from the same folder with two installers at once (3.10.0 and .3.12.0b2)