Code Monkey home page Code Monkey logo

fix-py-collections's Introduction

fixcollections

Python 3.10 broke compatibility with old versions of some libraries (some of them are very popular, like setuptools).

This provides a monkeypatch function that restores the compatibility shims removed in Python 3.10

Installation:

$ pip install fixcollections

Usage:

import fixcollections
fixcollections.monkeypatch()

from setuptools import setup
# etc etc

If you see this exception, you either need to do this monkeypatching or migrate to newer version of your library (like setuptools):

Traceback (most recent call last):
  File "C:\p\fix-py-collections\setup.py", line 5, in <module>
    from setuptools import setup
  File "C:\Users\villevai\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\__init__.py", line 10, in <module>
    from setuptools.extern.six.moves import filter, map
  File "C:\Users\villevai\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\extern\__init__.py", line 1, in <module>
    from pkg_resources.extern import VendorImporter
  File "C:\Users\villevai\AppData\Local\Programs\Python\Python310\lib\site-packages\pkg_resources\__init__.py", line 77, in <module>
    __import__('pkg_resources.extern.packaging.requirements')
  File "C:\Users\villevai\AppData\Local\Programs\Python\Python310\lib\site-packages\pkg_resources\_vendor\packaging\requirements.py", line 9, in <module>
    from pkg_resources.extern.pyparsing import stringStart, stringEnd, originalTextFor, ParseException
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 672, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 632, in _load_backward_compatible
  File "C:\Users\villevai\AppData\Local\Programs\Python\Python310\lib\site-packages\pkg_resources\extern\__init__.py", line 43, in load_module
    __import__(extant)
  File "C:\Users\villevai\AppData\Local\Programs\Python\Python310\lib\site-packages\pkg_resources\_vendor\pyparsing.py", line 943, in <module>
    collections.MutableMapping.register(ParseResults)
AttributeError: module 'collections' has no attribute 'MutableMapping'

fix-py-collections's People

Contributors

vivainio avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.