ModuleNotFoundError: No module named 'kivymd.stiffscroll'

Possible solution: Some suggest that this problem happens because the kivymd I installed is only on the terminal and not on my IDE (Pycharm)'s Python Interpreter. I'm not so sure about this because first, I pip install kivymd on my terminal and manually added the kivy package onto my IDE's Python interpreter. And because second, my IDE Python interpreter is at "/Desktop/CoinSnack4/venv/bin/python" and my kivymd is installed at "/Users/kienletrung/Desktop/CoinSnack4/venv" on my terminal (I found this by typing "echo $VIRTUAL_ENV" into the terminal).

Also, my program, when run with the IDE, runs fine. The error below only happens when I open the .exe file of it...

Hi please anyone could help with this my exe file is throwing up this error:

The answer in this Stackoverflow (No module named kivymd.effects when using pyinstaller)didn't work for me...

[INFO   ] [Logger      ] Record log in /Users/kienletrung/.kivy/logs/kivy_22-01-18_0.txt
[INFO   ] [Kivy        ] v2.0.0
[INFO   ] [Kivy        ] Installed at "/var/folders/g4/1xyrvs4j721f0tlsddrbxch00000gn/T/_MEI2YvYUa/kivy/__init__.pyc"
[INFO   ] [Python      ] v3.8.1 (v3.8.1:1b293b6006, Dec 18 2019, 14:08:53) 
[Clang 6.0 (clang-600.0.57)]
[INFO   ] [Python      ] Interpreter at "/Users/kienletrung/Desktop/CoinSnack4/dist/financiaz"
[INFO   ] [Factory     ] 186 symbols loaded
[INFO   ] [Image       ] Providers: img_tex, img_imageio, img_dds, img_sdl2, img_pil (img_ffpyplayer ignored)
[INFO   ] [KivyMD      ] 0.104.2.dev0 (installed at "/var/folders/g4/1xyrvs4j721f0tlsddrbxch00000gn/T/_MEI2YvYUa/kivymd/__init__.pyc")
[INFO   ] [Text        ] Provider: sdl2
[INFO   ] [Window      ] Provider: sdl2
[INFO   ] [GL          ] Using the "OpenGL ES 2" graphics system
[INFO   ] [GL          ] Backend used <sdl2>
[INFO   ] [GL          ] OpenGL version <b'2.1 INTEL-14.7.18'>
[INFO   ] [GL          ] OpenGL vendor <b'Intel Inc.'>
[INFO   ] [GL          ] OpenGL renderer <b'Intel(R) HD Graphics 6000'>
[INFO   ] [GL          ] OpenGL parsed version: 2, 1
[INFO   ] [GL          ] Shading version <b'1.20'>
[INFO   ] [GL          ] Texture max size <16384>
[INFO   ] [GL          ] Texture max units <16>
[INFO   ] [Window      ] auto add sdl2 input provider
[INFO   ] [Window      ] virtual keyboard not allowed, single mode, not docked
[ERROR  ] 
Traceback (most recent call last):
  File "kivy/lang/parser.py", line 472, in execute_directives
ModuleNotFoundError: No module named 'kivymd.stiffscroll'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "kivy/lang/parser.py", line 474, in execute_directives
ModuleNotFoundError: No module named 'kivymd.stiffscroll'
 Traceback (most recent call last):
   File "kivy/lang/parser.py", line 472, in execute_directives
 ModuleNotFoundError: No module named 'kivymd.stiffscroll'
 
 During handling of the above exception, another exception occurred:
 
 Traceback (most recent call last):
   File "kivy/lang/parser.py", line 474, in execute_directives
 ModuleNotFoundError: No module named 'kivymd.stiffscroll'
 
 During handling of the above exception, another exception occurred:
 
 Traceback (most recent call last):
   File "main.py", line 24, in <module>
   File "<frozen importlib._bootstrap>", line 991, in _find_and_load
   File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
   File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
   File "PyInstaller/loader/pyimod03_importers.py", line 540, in exec_module
   File "kivymd/uix/datatables.py", line 54, in <module>
   File "kivy/lang/builder.py", line 373, in load_string
   File "kivy/lang/parser.py", line 402, in __init__
   File "kivy/lang/parser.py", line 508, in parse
   File "kivy/lang/parser.py", line 483, in execute_directives
 kivy.lang.parser.ParserException: Parser: File "<inline>", line 3:
 ...
       1:
       2:#:import DEVICE_TYPE kivymd.material_resources.DEVICE_TYPE
 >>    3:#:import StiffScrollEffect kivymd.stiffscroll.StiffScrollEffect
       4:
       5:
 ...
 Unable to import package 'kivymd.stiffscroll.StiffScrollEffect'
[8390] Failed to execute script main
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[Process completed]


It seems that the error happens all because the database.py file in kivymd/uix/database.py can't make the code "#:import StiffScrollEffect kivymd.stiffscroll.StiffScrollEffect" works for some reason! Picture of database.py

If it helps, this my spec file:

# -*- mode: python ; coding: utf-8 -*-

from kivymd import hooks_path as kivymd_hooks_path
block_cipher = None


#changes the '/Users/kienletrung/Desktop/CoinSnack_MiniIA/main.py' below to the
#path to the python python file of the whole project. change the #'/Users/kienletrung/Desktop/CoinSnack_MiniIA' below to the folder that holds the previous python file.
a = Analysis(['/Users/kienletrung/Desktop/FinanciazIA/main.py'],
             pathex=['/Users/kienletrung/Desktop/FinanciazIA'],
             binaries=[],
             datas=[],
             hiddenimports=["kivymd"],
             hookspath=[kivymd_hooks_path],
             runtime_hooks=[],
             excludes=['_tkinter', 'Tkinter', 'enchant', 'twisted'],
             win_no_prefer_redirects=False,
             win_private_assemblies=False,
             cipher=block_cipher,
             noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
             cipher=block_cipher)

#adds other files that are not the main python file with the way below: (needs to change the #'/Users/kienletrung/Desktop/CoinSnack_MiniIA/main.kv' to the appropriate path to the file)
a.datas += [('main.kv', '/Users/kienletrung/Desktop/FinanciazIA/main.kv', 'DATA'), ('Financiaz.png', '/Users/kienletrung/Desktop/FinanciazIA/Financiaz.png', 'DATA')]

#needs to change '/Users/kienletrung/Desktop/CoinSnack_MiniIA' to the path that holds the data that I add in the above line. change the "coinsnack" name to appropriate app name.
exe = EXE(pyz, Tree('/Users/kienletrung/Desktop/FinanciazIA', 'Data'),
          a.scripts,
          a.binaries,
          a.zipfiles,
          a.datas,
          [],
          name='financiaz',
          debug=False,
          bootloader_ignore_signals=False,
          strip=False,
          upx=True,
          upx_exclude=[],
          runtime_tmpdir=None,
          console=False )
app = BUNDLE(exe,
             name='financiaz.app',
             icon=None,
             bundle_identifier=None)



I tried days and days but I still couldn't solve this problem... I would be forever grateful if you could help me. Thank you so much!


pip uninstall kivymd
pip install https://github.com/kivymd/KivyMD/archive/master.zip