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

sample.py throws ModuleNotFoundError #46

Open
agilebean opened this issue May 8, 2020 · 9 comments
Open

sample.py throws ModuleNotFoundError #46

agilebean opened this issue May 8, 2020 · 9 comments

Comments

@agilebean
Copy link

Hi,
this might be easy to fix, I am just missing a detail in the configuration.
After installation without errors, the example code for sampling doesn't run.

python jukebox/sample.py --model=5b_lyrics --name=sample_5b --levels=3 --sample_length_in_seconds=20 --total_sample_length_in_seconds=180 --sr=44100 --n_samples=6 --hop_fraction=0.5,0.5,0.125

throws error:

Traceback (most recent call last):
  File "./sample.py", line 1, in <module>
    import jukebox
ModuleNotFoundError: No module named 'jukebox'

I understand that sample.py is in the jukebox folder, so I need to execute python jukebox/sample.py one level above - but then of course, jukebox cannot be imported.
But how is jukebox supposed to be found as module?
Doesn't sample.py have to be outside of the jukebox folder?

@peterlazzarino
Copy link

have you run the pip install steps? Also are you sure the correct conda environment is activated? It will revert to base if you re-open the console after closing

@agilebean
Copy link
Author

@peterlazzarino yes i did all that.
in the line import jukebox,
is jukebox referring to the folder jukebox or to a module that is installed during the pip install steps?

@johndpope
Copy link
Contributor

Use miniconda - https://docs.conda.io/en/latest/miniconda.html

@JohnXenakis2
Copy link

I am having the similar problem:

Traceback (most recent call last):
File "jukebox/sample.py", line 5, in
from jukebox.hparams import Hyperparams
ModuleNotFoundError: No module named 'jukebox'

Has anyone already solve this?

@TimOgden
Copy link

Did you remember to use the command pip install -e . as the last step of the installation? I was having this same issue until I realized that I just forgot to do that last step.

@agilebean
Copy link
Author

Did you remember to use the command pip install -e . as the last step of the installation? I was having this same issue until I realized that I just forgot to do that last step.

@TimOgden thanks, that solved the problem - module jukebox is found now.

Unfortunately, I get a new error message now:

python jukebox/sample.py --model=5b_lyrics --name=sample_5b --levels=3 --sample_length_in_seconds=20 \
> --total_sample_length_in_seconds=180 --sr=44100 --n_samples=6 --hop_fraction=0.5,0.5,0.125

Caught error during NCCL init (attempt 0 of 5): Distributed package doesn't have NCCL built in

does this also an installation issue?
the nvidia page is not helpful...

@febfour
Copy link

febfour commented Jul 25, 2020

@TimOgden I've tried this, but it doesn't help.

I added this to sample.py and it went through, but I don't want to write this stuff.

import sys  
sys.path.append('{absolute path}/jukebox')

and, I got another error.

ModuleNotFoundError: No module named 'mpi4py'

Why can't we import jukebox when they're right in front of us?

When it's this hard to execute, I'm getting tired of it.

@febfour
Copy link

febfour commented Jul 25, 2020

I changed A to B and it started to pass.

A : python jukebox/sample.py
B : python3 jukebox/sample.py

but, I got an error.

Caught error during NCCL init (attempt 0 of 5): Distributed package doesn't have NCCL built in

@hdnh2006
Copy link

hdnh2006 commented Nov 5, 2022

Did you remember to use the command pip install -e . as the last step of the installation? I was having this same issue until I realized that I just forgot to do that last step.

This is the right answer!

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

No branches or pull requests

7 participants