Falcon
Falcon

Reputation: 442

Not able to run tflearn

When i run

    import tflearn

in my python3 interpreter.

I get the following error.

    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/home/abc/app/neural_network/tflearn.py", line 2, in 
    <module>
    from tflearn.layers.conv import conv_2d,max_pool_2d
    ImportError: No module named 'tflearn.layers'; 'tflearn' is not a package

I have tensorflow version 1.2.1 and I have already installed tflearn.

Upvotes: 1

Views: 212

Answers (1)

Dr. Snoopy
Dr. Snoopy

Reputation: 56357

Do not name your file the same as a python package (tflearn in this case), as python will use your file as it was a package and all imports will fail.

Using a script with the same name as a package will shadow and hide the real package (assuming it is installed). That's why you get such an error.

Upvotes: 1

Related Questions