question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No module named 'tcod._libtcod' when importing tcod

See original GitHub issue

I’m getting the following error when I try to import tcod:

Traceback (most recent call last):
  File "/Users/iamgabrielma/PycharmProjects/roguelikedev2021/main.py", line 1, in <module>
    import tcod
  File "/Users/iamgabrielma/PycharmProjects/roguelikedev2021/venv/lib/python3.9/site-packages/tcod/__init__.py", line 21, in <module>
    from tcod import (
  File "/Users/iamgabrielma/PycharmProjects/roguelikedev2021/venv/lib/python3.9/site-packages/tcod/bsp.py", line 28, in <module>
    import tcod.random
  File "/Users/iamgabrielma/PycharmProjects/roguelikedev2021/venv/lib/python3.9/site-packages/tcod/random.py", line 13, in <module>
    import tcod.constants
  File "/Users/iamgabrielma/PycharmProjects/roguelikedev2021/venv/lib/python3.9/site-packages/tcod/constants.py", line 6, in <module>
    from tcod.color import Color
  File "/Users/iamgabrielma/PycharmProjects/roguelikedev2021/venv/lib/python3.9/site-packages/tcod/color.py", line 7, in <module>
    from tcod._internal import deprecate
  File "/Users/iamgabrielma/PycharmProjects/roguelikedev2021/venv/lib/python3.9/site-packages/tcod/_internal.py", line 10, in <module>
    from tcod.loader import ffi, lib
  File "/Users/iamgabrielma/PycharmProjects/roguelikedev2021/venv/lib/python3.9/site-packages/tcod/loader.py", line 92, in <module>
    from tcod._libtcod import ffi, lib  # type: ignore # noqa: F401
ModuleNotFoundError: No module named 'tcod._libtcod'

I wasn’t able to even install the module until I updated the OSX certificates via pip3 install --upgrade certifi, once this was done I was able to install tcod but this new problem appeared. This happens both without and with virtual environment ( tried via venv module, and via PyCharm )

Currently installed: tcod | 12.5.0

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
HexDecimalcommented, Jun 30, 2021

Version 12.7.1 now as ARM64 builds, but they’re cross-compiled so I can’t actually test them. You’ll need to upgrade and report back.

1reaction
HexDecimalcommented, Jun 30, 2021

Thanks, this was what I was looking for: tcod-12.7.0-cp38-cp38-macosx_10_14_6_arm64.whl

ARM64 is a new architecture that I don’t have automated builds for. I’ll need to check if I can build those.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to properly import libtcod in PyCharm? - Stack Overflow
Take a look at this github project called tcod: ... get the error "ImportError: DLL load failed: The specified module could not be...
Read more >
Frequently Asked Questions - python-tcod - Read the Docs
I get No module named 'tcod' when I try to import tcod in PyCharm.¶. PyCharm will automatically setup a Python ... Libtcod uses...
Read more >
tcod/libtcod errors in PyCharm : r/roguelikedev - Reddit
import tcod as libtcod ... ModuleNotFoundError: No module named 'tcod' ... I'd guess that you're installing the tcod package to one ...
Read more >
python-tcod/installation.rst at main - GitHub
A high-performance Python port of libtcod. Includes the libtcodpy module for ... Once python-tcod is installed, you'll be able to import the tcod...
Read more >
python-tcod Documentation - Read the Docs
I get No module named 'tcod' when I try to import tcod in PyCharm. ... libtcod-cffi has since been part of python-tcod providing...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found