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

ImportError: No module named 'medleydb.sql' #77

Open
Kaustubhk12 opened this issue Apr 19, 2017 · 7 comments
Open

ImportError: No module named 'medleydb.sql' #77

Kaustubhk12 opened this issue Apr 19, 2017 · 7 comments
Assignees
Labels

Comments

@Kaustubhk12
Copy link

Kaustubhk12 commented Apr 19, 2017

Also the command :

pip install -e .[sql]

gives the following:

medleydb 1.2.9 does not provide the extra 'sql'

although the medleydb gets installed fine by this command and medleydb can be imported without any error. Further the command

medleydb-export

gives the following error:

bash: medleydb-export: command not found

My OS is Centos 6.4 and Python version is 3.5.2.

@rabitt rabitt self-assigned this Apr 19, 2017
@rabitt rabitt added the bug label Apr 19, 2017
@rabitt
Copy link
Contributor

rabitt commented Apr 19, 2017

@Kaustubhk12 thanks for reporting this. I deprecated the sql submodule. Where did you see it in the current version of the api? Is it in the docs somewhere?

@Kaustubhk12
Copy link
Author

It is there in conftest.py

import medleydb.sql as m

def session(medleydb):
_session = m.session(ephemeral=True)
m.from_medleydb(_session, limit=2)
return _session

Also if the existing code uses session as follows:

session = medleydb.sql.session()
stems = session.query(medleydb.sql.model.Stem).all()

then exactly how can it be done now without medleydb.sql ?

@Kaustubhk12
Copy link
Author

Or could you please make medleydb.sql module available, may be with a deprecation warning, so that those who want to use that module for existing code can use it.

@Kaustubhk12
Copy link
Author

Any solutions regarding how can I find medleydb.sql and use medleydb.sql.session(). Or any alternatives to medleydb.sql.session() ?

@rabitt
Copy link
Contributor

rabitt commented May 30, 2017

Hey @Kaustubhk12 sorry for the delay.

There's no easy way to bring back the sql api without doing a fairly big rewrite. If you need it you can roll back to the version of the code where it existed. In general though, all of the search capabilities of the sql submodule can be done in python through the current api. Is there functionality missing from the current api that was in the sql api?

@Kaustubhk12
Copy link
Author

Kaustubhk12 commented Jun 1, 2017 via email

@rabitt
Copy link
Contributor

rabitt commented Jun 1, 2017

In general you can refer to the documentation. For example to retrieve all the stems for a given multitrack and print their instrument you can do:

import medleydb as mdb

mtrack = mdb.MultiTrack('MusicDelta_Beethoven')
for key, stem in mtrack.stems.items():
    print("This is stem # {}".format(key))
    print(stem.instrument)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants