Can't import python modules

why i can’t import any modules on replit even though they are installed
i did pip install and all of them are already satisfied

image

That’s not saying you can’t import them, it’s only a warning that they are un-sorted. You can safely ignore that warning.

2 Likes

but when i run the program it throwing errors but when i run the code on my machine it works fine
do you know what can be the issue then?

 python messbot.py
Traceback (most recent call last):
  File "/home/runner/Messbot/messbot.py", line 14, in <module>
    import ai
  File "/home/runner/Messbot/ai.py", line 8, in <module>
    import tflearn
  File "/home/runner/Messbot/.pythonlibs/lib/python3.10/site-packages/tflearn/__init__.py", line 25, in <module>
    from .layers import normalization
  File "/home/runner/Messbot/.pythonlibs/lib/python3.10/site-packages/tflearn/layers/__init__.py", line 11, in <module>
    from .recurrent import lstm, gru, simple_rnn, bidirectional_rnn, \
  File "/home/runner/Messbot/.pythonlibs/lib/python3.10/site-packages/tflearn/layers/recurrent.py", line 17, in <module>
    from tensorflow.python.util.nest import is_sequence
ImportError: cannot import name 'is_sequence' from 'tensorflow.python.util.nest' (/home/runner/Messbot/.pythonlibs/lib/python3.10/site-packages/tensorflow/python/util/nest.py)
exit status 1

Seems like your version of tensorflow doesn’t support that function, could you check the versions of it on Replit and on your machine?

on my machine the version is: TensorFlow version: 2.10.0
on replit the version was: TensorFlow version: 2.14.0-rc1

so i installed the 2.10.0 version on replit
now i’m getting these errors and i don’t even use Pil
tflearn version is same both on replit and on my machine (0.5.0)

 python messbot.py
Traceback (most recent call last):
File “/home/runner/Messbot/messbot.py”, line 14, in
import ai
File “/home/runner/Messbot/ai.py”, line 8, in
import tflearn
File “/home/runner/Messbot/.pythonlibs/lib/python3.10/site-packages/tflearn/**init**.py”, line 66, in
from . import datasets
File “/home/runner/Messbot/.pythonlibs/lib/python3.10/site-packages/tflearn/datasets/**init**.py”, line 1, in
from . import cifar10
File “/home/runner/Messbot/.pythonlibs/lib/python3.10/site-packages/tflearn/datasets/cifar10.py”, line 16, in
from …data_utils import to_categorical
File “/home/runner/Messbot/.pythonlibs/lib/python3.10/site-packages/tflearn/data_utils.py”, line 577, in
resize_mode=Image.ANTIALIAS):
AttributeError: module ‘PIL.Image’ has no attribute ‘ANTIALIAS’

Seems to be referencing a dead pillow function, try running these in Shell:

poetry add Pillow@9.5.0

(PIL is from the Pillow package)