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

Import bug due to mido dependency #388

Open
BaptisteHi opened this issue Oct 11, 2024 · 2 comments
Open

Import bug due to mido dependency #388

BaptisteHi opened this issue Oct 11, 2024 · 2 comments
Assignees
Labels
good first issue Good for newcomers invalid This doesn't seem right

Comments

@BaptisteHi
Copy link

Hi,

I have encountered issues while using google collab tutorials for partitura : While importing partitura, there is a conflict issue raised because of the mido dependency which requires packaging with the version 23.1 while newer versions are available.

I have tried downgrading packaging's version right before the import and right before the installation of partitura using pip but it didn't work out.

Here is the message error :

Requirement already satisfied: packaging==23.1 in /usr/local/lib/python3.10/dist-packages (23.1)

---------------------------------------------------------------------------

ContextualVersionConflict                 Traceback (most recent call last)

[<ipython-input-7-fb54198d7d05>](https://localhost:8080/#) in <cell line: 4>()
      2 import os
      3 get_ipython().system('pip install packaging==23.1')
----> 4 import partitura as pt
      5 import numpy as np
      6 import matplotlib.pyplot as plt

5 frames

[/usr/local/lib/python3.10/dist-packages/pkg_resources/__init__.py](https://localhost:8080/#) in _resolve_dist(self, req, best, replace_conflicting, env, installer, required_by, to_activate)
    937             # Oops, the "best" so far conflicts with a dependency
    938             dependent_req = required_by[req]
--> 939             raise VersionConflict(dist, req).with_context(dependent_req)
    940         return dist
    941 

ContextualVersionConflict: (packaging 24.1 (/usr/local/lib/python3.10/dist-packages), Requirement.parse('packaging~=23.1'), {'mido'})
@manoskary manoskary self-assigned this Oct 11, 2024
@manoskary manoskary added good first issue Good for newcomers invalid This doesn't seem right labels Oct 11, 2024
@manoskary
Copy link
Member

Hello and thanks for raising this issue.
It looks that the Google colab's cache is not updated and although packaging 24.1 is no longer there and packaging 23.1 took its
place somehow it still exists in the site_packages folder.
It is a weird error, but it seems to be related mostly with Colab and not with the partitura installation, I will dig a bit deeper and then try to find a better solution.

If you still want to run tutorial, run the first shells that install partitura and then refresh the runtime, and run through the notebook again. This should fix the error.

@CarlosCancino-Chacon
Copy link
Member

Hi @BaptisteHi and @manoskary! I found a potential solution that we can use for the time being. We can use an older version of mido to avoid the issues with packaging.

I will create a pull request in the tutorial repository to address these issue

# Issues on Colab with newer versions of MIDO
! pip install mido==1.2.10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

3 participants