r/roguelikedev • • Sep 27 '18
problems in python rogue tutorial: tcod library and MacOs
Hi!
I'm trying to follow the tutorial http://www.roguebasin.com/index.php?title=Complete_Roguelike_Tutorial,_using_python3%2Blibtcod,_setup_Mac, but I am having troubles with the library tdl.
I am using python 3.6 via anaconda on a Mac.
(rogprog) me$ python --version
Python 3.6.5 :: Anaconda, Inc.
(rogprog) me$ pip install tdl
Collecting tdl
Using cached https://files.pythonhosted.org/packages/4d/67/d2f87745761dd4d073c819deff95ab5dd80000381567f9a7a385b0bf691b/tdl-6.0.0-py2.py3-none-any.whl
Collecting tcod (from tdl) Requirement already satisfied: cffi<2,>=1.8.1 in /anaconda3/envs/rogprog/lib/python3.6/site-packages (from tcod->tdl) (1.11.5)
Requirement already satisfied: numpy<2,>=1.10 in /anaconda3/envs/rogprog/lib/python3.6/site-packages (from tcod->tdl) (1.14.3)
Requirement already satisfied: pycparser in /anaconda3/envs/rogprog/lib/python3.6/site-packages (from cffi<2,>=1.8.1->tcod->tdl) (2.18) distributed 1.21.8 requires msgpack, which is not installed.
Installing collected packages: tcod, tdl
Successfully installed tcod-6.0.4 tdl-6.0.0 You are using pip version 10.0.1, however version 18.0 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
(rogprog) me$ python -c "import tcod"
Traceback (most recent call last): File "<string>", line 1, in <module> File "/anaconda3/envs/rogprog/lib/python3.6/site-packages/tcod/init.py", line 24, in <module>
from tcod.libtcodpy import * File "/anaconda3/envs/rogprog/lib/python3.6/site-packages/tcod/libtcodpy.py", line 14, in <module>
from tcod.libtcod import * File "/anaconda3/envs/rogprog/lib/python3.6/site-packages/tcod/libtcod.py", line 61, in <module>
from tcod._libtcod import lib, ffi ImportError: dlopen(/anaconda3/envs/rogprog/lib/python3.6/site-packages/tcod/_libtcod.abi3.so, 2): Library not loaded: @rpath/SDL2.framework/Versions/A/SDL2
Referenced from: /anaconda3/envs/rogprog/lib/python3.6/site-packages/tcod/_libtcod.abi3.so
Reason: image not foundI get the same problem even after updating pip the version 18.0.
Do you have any idea??
thank you in advance!
5
Upvotes
1
u/Widmo Sep 27 '18
Do you have SDL2 installed and available?
1
u/[deleted] Sep 27 '18
pip install tcod
1
u/stolencatkarma Sep 27 '18
pip is for python2, also run with python3 yourApp.py
3
u/HexDecimal libtcod maintainer | mastodon.gamedev.place/@HexDecimal Sep 27 '18 edited Sep 28 '18
There should be an SDL binary installed at:
site-packages/tcod/.dylibs/SDL2, this is included in the binary wheels oftcod._libtcod.abi3.soshould be trying to link to@loader_path/.dylibs/SDL2instead of any kind of@rpath.I'd try uninstalling tdl and tcod and then reinstalling tcod. You should pay attention to the tcod wheel used by pip (not shown in your log which which only shows tdl's wheel.)
2
u/HexDecimal libtcod maintainer | mastodon.gamedev.place/@HexDecimal Oct 01 '18
This issue might be fixed in the latest version of tcod (6.0.6), try upgrading it with pip.
1
u/BurningCalembour Sep 28 '18
I have a similar problem. This is what happens in my case (Xubuntu 18.04.1 Bionic Beaver):
Ideas?