python-3.xcleverhans

How to fix "ImportError: cannot import name 'flags' " while importing flags from Cleverhans.compat in Python


I am having a problem while playing the following code given as example in Cleverhans Library :

The problem is on Line # 18 . When it plays it gives out an import error :

ImportError: cannot import name 'flags'

I have tried to see in the help and there is also no flags function listed there.

from cleverhans.compat import flags

This should work by simply importing the module and giving no error.


Solution

  • I found the solution.

    If any such error appears then its due to the problem in the way you have set your environment to work in .

    If the dependencies are perfectly aligned then there comes no such error.

    Thanks :)

    P.S. If you find such error while running your code in Cleverhans then drop me a message . I'll be happy to help :)