Python Pyinstaller缺少模块

Python Pyinstaller缺少模块,python,module,pyinstaller,Python,Module,Pyinstaller,我使用python和tcod和pygame等模块制作了一个小游戏。现在我正在用Pyinstaller将这个游戏制作成Ubuntu 20.04操作系统上的可执行文件。当我尝试运行新生成的可执行文件时,总会收到以下消息: Traceback (most recent call last): File "main.py", line 3, in <module> ModuleNotFoundError: No module named 'tcod' [82118]

我使用python和tcod和pygame等模块制作了一个小游戏。现在我正在用Pyinstaller将这个游戏制作成Ubuntu 20.04操作系统上的可执行文件。当我尝试运行新生成的可执行文件时,总会收到以下消息:

Traceback (most recent call last):
  File "main.py", line 3, in <module>
ModuleNotFoundError: No module named 'tcod'
[82118] Failed to execute script main
也许我在隐藏的进口零件上搞错了?我怎样才能解决这个问题

编辑:我忘了提到我的游戏是用venv制作的,它也在venv中运行

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

block_cipher = None

a = Analysis(['main.py'],
             pathex=['/home/nia/PycharmProjects/rouge_like'],
             binaries=[],
             datas=[],
             hiddenimports=['tcod', 'pygame'],
             hookspath=[],
             runtime_hooks=[],
             excludes=[],
             win_no_prefer_redirects=False,
             win_private_assemblies=False,
             cipher=block_cipher,
             noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
             cipher=block_cipher)
exe = EXE(pyz,
          a.scripts,
          [],
          exclude_binaries=True,
          name='main',
          debug=False,
          bootloader_ignore_signals=False,
          strip=False,
          upx=True,
          console=True )
coll = COLLECT(exe,
               a.binaries,
               a.zipfiles,
               a.datas,
               strip=False,
               upx=True,
               upx_exclude=[],
               name='main')