1

I am trying to install cleverhans (https://github.com/tensorflow/cleverhans)

I am running the following command

!pip install -q -e git+http://github.com/tensorflow/cleverhans.git#egg=cleverhans

However, when I try to do import cleverhans I get an error saying that there's no such module.

PS If I try to install the module on my local machine, the source is stored in ~/.src/cleverhans.

danronmoon
  • 3,814
  • 5
  • 34
  • 56
gokul_uf
  • 740
  • 1
  • 8
  • 21

1 Answers1

4

It looks like the installation doesn't properly update the python path. Here's a snippet that worked for me:

!pip install -qq -e git+http://github.com/tensorflow/cleverhans.git#egg=cleverhans
import sys
sys.path.append('/content/src/cleverhans')
import cleverhans
Bob Smith
  • 36,107
  • 11
  • 98
  • 91
  • Works like a charm! Do I need to install it every time I reopen the notebook? – gokul_uf Nov 29 '17 at 08:45
  • You'll need to re-execute that cell once for each VM. VMs are recycled after a period of inactivity; see https://stackoverflow.com/questions/47474406 – Bob Smith Nov 29 '17 at 16:15