[Python] How to get the pandas version in Python with numpy >= 2.0.0 installed

Discussão em 'Python' iniciado por Stack, Setembro 25, 2024.

  1. Stack

    Stack Membro Participativo

    One usually gets the pandas version in Python as follows:

    import pandas
    print(pandas.__version__)


    However if numpy version 2.0.0 or higher is installed, and the pandas version is < 2.2.2 it typically crashes as follows on the import statement:

    [​IMG]

    Is there a clever way to check the pandas version (within Python) in order to warn the user of this incompatibility instead of the user-unfriendly traceback dump?

    Continue reading...

Compartilhe esta Página