Skip to content
This repository has been archived by the owner on May 1, 2023. It is now read-only.

ModuleNotFoundError: No module named 'distiller' #332

Closed
nathanhubens opened this issue Jul 23, 2019 · 6 comments
Closed

ModuleNotFoundError: No module named 'distiller' #332

nathanhubens opened this issue Jul 23, 2019 · 6 comments

Comments

@nathanhubens
Copy link

After following the installation guide, I wanted to try the compress_classifier.py example. But it tells me that it is unable to find the distiller module. The same error occurs when I try running the notebooks.

I have CUDA 9.2 and PyTorch 1.1 and I had no error during the installation stage. What should I do ?

@guyjacob
Copy link
Contributor

It's hard to say without more info.

  • Which OS are you running on?
  • Are you sure you created a virtualenv, activated it and then ran the pip install -e . command from the Distiller directory? Any errors popped up during the installation?
  • When running the script, you're in the activated virtualenv?

(Apologies if these questions seem redundant - just trying to make sure I understand the steps you took)

Can you try running pip list | grep distiller and see what you get? If the package was installed properly, it should be listed. And if it's listed then I can't think of a reason it won't be found when importing.

If none of the above helps to root cause the problem, please provide more details on what the steps you took and we'll try to help.

@nathanhubens
Copy link
Author

I use Ubuntu 18.04.

Here are the steps I followed during the installation:

  1. activate the virtual environment (I use Conda)
  2. git clone https://github.com/NervanaSystems/distiller.git
  3. cd distiller
  4. pip3 install -e . -> No error occured
  5. run the script python3 compress_classifier.py --help -> This leads to the error python3 compress_classifier.py --help

When I try to run the following command pip list | grep distiller I get nothing. But if I use pip3, I have distiller (0.4.0rc0, /home/nathan/distiller). It seems that the library has been installed outside of the scope of my virtual environment.

@levzlotnik
Copy link
Contributor

levzlotnik commented Jul 24, 2019

Yes that happens sometimes with virtualenv, sometimes it creates python3 and pip3 in the new dir, but pip and python remain the old aliases. Try running which pip3, and you'll probably see /usr/bin/pip3 or something like that...
This is the exact issue as this.

@nzmora
Copy link
Contributor

nzmora commented Jul 27, 2019

Hi @nathanhubens ,

We don't usually use Conda, so the mixing of Conda and pip can be to blame - although I don't think so.
To create the virtual environment, did you use $ python3 -m virtualenv env or python3 -m venv env? I wonder if the latter is giving you a problem?

Thanks!
Neta

@nathanhubens
Copy link
Author

Hi @nzmora,

I used a conda virtual environment, created with conda create -n env, so it is neither of them. Everything now works fine using virtualenv

Thank you !

@nzmora
Copy link
Contributor

nzmora commented Aug 11, 2019

Glad to hear! I'm closing the issue.
Cheers
Neta

@nzmora nzmora closed this as completed Aug 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants