weixin_39725756
weixin_39725756
2020-12-02 21:15

Failed building wheel for tdl (ubuntu 16.04)

When I run the 'pip3 install tdl' command I get an error of 'Failed building wheel for tdl (ubuntu 16.04)'

Failed building wheel for tdl (ubuntu 16.04)

pip 9.0.1 from /usr/local/lib/python3.5/dist-packages (python 3.5) tim-Galago-UltraPro:~$ pip3 install tdl Collecting tdl Using cached tdl-4.1.1.tar.gz Requirement already satisfied: cffi<2,>=1.8.1 in ./.local/lib/python3.5/site-packages (from tdl) Requirement already satisfied: numpy<2,>=1.10 in ./.local/lib/python3.5/site-packages (from tdl) Requirement already satisfied: pycparser in ./.local/lib/python3.5/site-packages (from cffi<2,>=1.8.1->tdl) Building wheels for collected packages: tdl Running setup.py bdist_wheel for tdl ... error Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-build-ucu9poc_/tdl/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" bdist_wheel -d /tmp/tmpqd1hw3cgpip-wheel- --python-tag cp35: running bdist_wheel error: error in setup.cfg: command 'bdist_wheel' has no such option 'py_limited_api'

Failed building wheel for tdl Running setup.py clean for tdl Failed to build tdl Installing collected packages: tdl Running setup.py install for tdl ... error Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-build-ucu9poc_/tdl/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-0uvs6i9d-record/install-record.txt --single-version-externally-managed --compile: running install running build running build_py creating build creating build/lib.linux-x86_64-3.5 creating build/lib.linux-x86_64-3.5/tdl copying tdl/event.py -> build/lib.linux-x86_64-3.5/tdl copying tdl/map.py -> build/lib.linux-x86_64-3.5/tdl copying tdl/version.py -> build/lib.linux-x86_64-3.5/tdl copying tdl/init.py -> build/lib.linux-x86_64-3.5/tdl copying tdl/noise.py -> build/lib.linux-x86_64-3.5/tdl copying tdl/style.py -> build/lib.linux-x86_64-3.5/tdl creating build/lib.linux-x86_64-3.5/tcod copying tcod/map.py -> build/lib.linux-x86_64-3.5/tcod copying tcod/libtcodpy.py -> build/lib.linux-x86_64-3.5/tcod copying tcod/libtcod.py -> build/lib.linux-x86_64-3.5/tcod copying tcod/version.py -> build/lib.linux-x86_64-3.5/tcod copying tcod/init.py -> build/lib.linux-x86_64-3.5/tcod copying tcod/tcod.py -> build/lib.linux-x86_64-3.5/tcod copying tcod/noise.py -> build/lib.linux-x86_64-3.5/tcod copying tcod/path.py -> build/lib.linux-x86_64-3.5/tcod copying tcod/bsp.py -> build/lib.linux-x86_64-3.5/tcod copying tcod/random.py -> build/lib.linux-x86_64-3.5/tcod copying tcod/color.py -> build/lib.linux-x86_64-3.5/tcod copying tcod/console.py -> build/lib.linux-x86_64-3.5/tcod copying tcod/image.py -> build/lib.linux-x86_64-3.5/tcod copying tdl/terminal8x8.png -> build/lib.linux-x86_64-3.5/tdl running build_ext generating cffi module 'build/temp.linux-x86_64-3.5/tcod._libtcod.c' creating build/temp.linux-x86_64-3.5 building 'tcod._libtcod' extension creating build/temp.linux-x86_64-3.5/build creating build/temp.linux-x86_64-3.5/build/temp.linux-x86_64-3.5 creating build/temp.linux-x86_64-3.5/libtcod creating build/temp.linux-x86_64-3.5/libtcod/src creating build/temp.linux-x86_64-3.5/libtcod/src/png creating build/temp.linux-x86_64-3.5/libtcod/src/zlib creating build/temp.linux-x86_64-3.5/tcod x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DLIBTCOD_EXPORTS -DTCOD_SDL2 -D_CRT_SECURE_NO_WARNINGS -I. -Ilibtcod/include/ -Ilibtcod/src/png/ -Ilibtcod/src/zlib/ -I/usr/include/SDL2/ -I/usr/include/python3.5m -c build/temp.linux-x86_64-3.5/tcod._libtcod.c -o build/temp.linux-x86_64-3.5/build/temp.linux-x86_64-3.5/tcod._libtcod.o -I/usr/local/include/SDL2 -D_REENTRANT -flto -fopenmp build/temp.linux-x86_64-3.5/tcod._libtcod.c: In function ‘_cffi_const_SDL_PIXELFORMAT_RGBA32’: build/temp.linux-x86_64-3.5/tcod._libtcod.c:3824:12: error: ‘SDL_PIXELFORMAT_RGBA32’ undeclared (first use in this function) int n = (SDL_PIXELFORMAT_RGBA32) <= 0; ^ build/temp.linux-x86_64-3.5/tcod._libtcod.c:3824:12: note: each undeclared identifier is reported only once for each function it appears in build/temp.linux-x86_64-3.5/tcod._libtcod.c: In function ‘_cffi_const_SDL_PIXELFORMAT_ARGB32’: build/temp.linux-x86_64-3.5/tcod._libtcod.c:3831:12: error: ‘SDL_PIXELFORMAT_ARGB32’ undeclared (first use in this function) int n = (SDL_PIXELFORMAT_ARGB32) <= 0; ^ build/temp.linux-x86_64-3.5/tcod._libtcod.c: In function ‘_cffi_const_SDL_PIXELFORMAT_BGRA32’: build/temp.linux-x86_64-3.5/tcod._libtcod.c:3838:12: error: ‘SDL_PIXELFORMAT_BGRA32’ undeclared (first use in this function) int n = (SDL_PIXELFORMAT_BGRA32) <= 0; ^ build/temp.linux-x86_64-3.5/tcod._libtcod.c: In function ‘_cffi_const_SDL_PIXELFORMAT_ABGR32’: build/temp.linux-x86_64-3.5/tcod._libtcod.c:3845:12: error: ‘SDL_PIXELFORMAT_ABGR32’ undeclared (first use in this function) int n = (SDL_PIXELFORMAT_ABGR32) <= 0; ^ build/temp.linux-x86_64-3.5/tcod._libtcod.c: In function ‘_cffi_const_SDL_DROPTEXT’: build/temp.linux-x86_64-3.5/tcod._libtcod.c:6577:12: error: ‘SDL_DROPTEXT’ undeclared (first use in this function) int n = (SDL_DROPTEXT) <= 0; ^ build/temp.linux-x86_64-3.5/tcod._libtcod.c: In function ‘_cffi_const_SDL_DROPBEGIN’: build/temp.linux-x86_64-3.5/tcod._libtcod.c:6584:12: error: ‘SDL_DROPBEGIN’ undeclared (first use in this function) int n = (SDL_DROPBEGIN) <= 0; ^ build/temp.linux-x86_64-3.5/tcod._libtcod.c: In function ‘_cffi_const_SDL_DROPCOMPLETE’: build/temp.linux-x86_64-3.5/tcod._libtcod.c:6591:12: error: ‘SDL_DROPCOMPLETE’ undeclared (first use in this function) int n = (SDL_DROPCOMPLETE) <= 0; ^ build/temp.linux-x86_64-3.5/tcod._libtcod.c: In function ‘_cffi_const_SDL_WINDOWEVENT_TAKE_FOCUS’: build/temp.linux-x86_64-3.5/tcod._libtcod.c:9523:12: error: ‘SDL_WINDOWEVENT_TAKE_FOCUS’ undeclared (first use in this function) int n = (SDL_WINDOWEVENT_TAKE_FOCUS) <= 0; ^ build/temp.linux-x86_64-3.5/tcod._libtcod.c: In function ‘_cffi_const_SDL_WINDOWEVENT_HIT_TEST’: build/temp.linux-x86_64-3.5/tcod._libtcod.c:9530:12: error: ‘SDL_WINDOWEVENT_HIT_TEST’ undeclared (first use in this function) int n = (SDL_WINDOWEVENT_HIT_TEST) <= 0; ^ build/temp.linux-x86_64-3.5/tcod._libtcod.c: In function ‘_cffi_const_SDL_WINDOW_ALWAYS_ON_TOP’: build/temp.linux-x86_64-3.5/tcod._libtcod.c:9642:12: error: ‘SDL_WINDOW_ALWAYS_ON_TOP’ undeclared (first use in this function) int n = (SDL_WINDOW_ALWAYS_ON_TOP) <= 0; ^ build/temp.linux-x86_64-3.5/tcod._libtcod.c: In function ‘_cffi_const_SDL_WINDOW_SKIP_TASKBAR’: build/temp.linux-x86_64-3.5/tcod._libtcod.c:9649:12: error: ‘SDL_WINDOW_SKIP_TASKBAR’ undeclared (first use in this function) int n = (SDL_WINDOW_SKIP_TASKBAR) <= 0; ^ build/temp.linux-x86_64-3.5/tcod._libtcod.c: In function ‘_cffi_const_SDL_WINDOW_UTILITY’: build/temp.linux-x86_64-3.5/tcod._libtcod.c:9656:12: error: ‘SDL_WINDOW_UTILITY’ undeclared (first use in this function) int n = (SDL_WINDOW_UTILITY) <= 0; ^ build/temp.linux-x86_64-3.5/tcod._libtcod.c: In function ‘_cffi_const_SDL_WINDOW_TOOLTIP’: build/temp.linux-x86_64-3.5/tcod._libtcod.c:9663:12: error: ‘SDL_WINDOW_TOOLTIP’ undeclared (first use in this function) int n = (SDL_WINDOW_TOOLTIP) <= 0; ^ build/temp.linux-x86_64-3.5/tcod._libtcod.c: In function ‘_cffi_const_SDL_WINDOW_POPUP_MENU’: build/temp.linux-x86_64-3.5/tcod._libtcod.c:9670:12: error: ‘SDL_WINDOW_POPUP_MENU’ undeclared (first use in this function) int n = (SDL_WINDOW_POPUP_MENU) <= 0; ^ build/temp.linux-x86_64-3.5/tcod._libtcod.c: In function ‘_cffi_d_SDL_CreateRGBSurfaceWithFormat’: build/temp.linux-x86_64-3.5/tcod._libtcod.c:15569:10: warning: implicit declaration of function ‘SDL_CreateRGBSurfaceWithFormat’ [-Wimplicit-function-declaration] return SDL_CreateRGBSurfaceWithFormat(x0, x1, x2, x3, x4); ^ build/temp.linux-x86_64-3.5/tcod._libtcod.c:15569:10: warning: return makes pointer from integer without a cast [-Wint-conversion] build/temp.linux-x86_64-3.5/tcod._libtcod.c: In function ‘_cffi_f_SDL_CreateRGBSurfaceWithFormat’: build/temp.linux-x86_64-3.5/tcod._libtcod.c:15612:12: warning: assignment makes pointer from integer without a cast [-Wint-conversion] { result = SDL_CreateRGBSurfaceWithFormat(x0, x1, x2, x3, x4); } ^ build/temp.linux-x86_64-3.5/tcod._libtcod.c: In function ‘_cffi_d_SDL_CreateRGBSurfaceWithFormatFrom’: build/temp.linux-x86_64-3.5/tcod._libtcod.c:15625:10: warning: implicit declaration of function ‘SDL_CreateRGBSurfaceWithFormatFrom’ [-Wimplicit-function-declaration] return SDL_CreateRGBSurfaceWithFormatFrom(x0, x1, x2, x3, x4, x5); ^ build/temp.linux-x86_64-3.5/tcod._libtcod.c:15625:10: warning: return makes pointer from integer without a cast [-Wint-conversion] build/temp.linux-x86_64-3.5/tcod._libtcod.c: In function ‘_cffi_f_SDL_CreateRGBSurfaceWithFormatFrom’: build/temp.linux-x86_64-3.5/tcod._libtcod.c:15682:12: warning: assignment makes pointer from integer without a cast [-Wint-conversion] { result = SDL_CreateRGBSurfaceWithFormatFrom(x0, x1, x2, x3, x4, x5); } ^ build/temp.linux-x86_64-3.5/tcod._libtcod.c: In function ‘_cffi_d_SDL_DequeueAudio’: build/temp.linux-x86_64-3.5/tcod._libtcod.c:16265:10: warning: implicit declaration of function ‘SDL_DequeueAudio’ [-Wimplicit-function-declaration] return SDL_DequeueAudio(x0, x1, x2); ^ build/temp.linux-x86_64-3.5/tcod._libtcod.c: In function ‘_cffi_d_SDL_GetDisplayUsableBounds’: build/temp.linux-x86_64-3.5/tcod._libtcod.c:19428:10: warning: implicit declaration of function ‘SDL_GetDisplayUsableBounds’ [-Wimplicit-function-declaration] return SDL_GetDisplayUsableBounds(x0, x1); ^ build/temp.linux-x86_64-3.5/tcod._libtcod.c: In function ‘_cffi_d_SDL_GetHintBoolean’: build/temp.linux-x86_64-3.5/tcod._libtcod.c:19664:10: warning: implicit declaration of function ‘SDL_GetHintBoolean’ [-Wimplicit-function-declaration] return SDL_GetHintBoolean(x0, x1); ^ build/temp.linux-x86_64-3.5/tcod._libtcod.c: In function ‘_cffi_d_SDL_GetWindowBordersSize’: build/temp.linux-x86_64-3.5/tcod._libtcod.c:21728:10: warning: implicit declaration of function ‘SDL_GetWindowBordersSize’ [-Wimplicit-function-declaration] return SDL_GetWindowBordersSize(x0, x1, x2, x3, x4); ^ build/temp.linux-x86_64-3.5/tcod._libtcod.c: In function ‘_cffi_d_SDL_GetWindowOpacity’: build/temp.linux-x86_64-3.5/tcod._libtcod.c:22345:10: warning: implicit declaration of function ‘SDL_GetWindowOpacity’ [-Wimplicit-function-declaration] return SDL_GetWindowOpacity(x0, x1); ^ build/temp.linux-x86_64-3.5/tcod._libtcod.c: In function ‘_cffi_d_SDL_RWFromFP’: build/temp.linux-x86_64-3.5/tcod._libtcod.c:27411:23: warning: passing argument 1 of ‘SDL_RWFromFP’ from incompatible pointer type [-Wincompatible-pointer-types] return SDL_RWFromFP(x0, x1); ^ In file included from /usr/include/SDL2/SDL_audio.h:36:0, from /usr/include/SDL2/SDL.h:36, from ./tcod/cffi.h:5, from build/temp.linux-x86_64-3.5/tcod._libtcod.c:482: /usr/include/SDL2/SDL_rwops.h:157:36: note: expected ‘FILE * {aka struct _IO_FILE }’ but argument is of type ‘int ’ extern DECLSPEC SDL_RWops SDLCALL SDL_RWFromFP(FILE * fp, ^ build/temp.linux-x86_64-3.5/tcod._libtcod.c: In function ‘_cffi_f_SDL_RWFromFP’: build/temp.linux-x86_64-3.5/tcod._libtcod.c:27443:27: warning: passing argument 1 of ‘SDL_RWFromFP’ from incompatible pointer type [-Wincompatible-pointer-types] { result = SDL_RWFromFP(x0, x1); } ^ In file included from /usr/include/SDL2/SDL_audio.h:36:0, from /usr/include/SDL2/SDL.h:36, from ./tcod/cffi.h:5, from build/temp.linux-x86_64-3.5/tcod._libtcod.c:482: /usr/include/SDL2/SDL_rwops.h:157:36: note: expected ‘FILE * {aka struct _IO_FILE }’ but argument is of type ‘int ’ extern DECLSPEC SDL_RWops SDLCALL SDL_RWFromFP(FILE * fp, ^ build/temp.linux-x86_64-3.5/tcod._libtcod.c: In function ‘_cffi_d_SDL_RenderGetIntegerScale’: build/temp.linux-x86_64-3.5/tcod._libtcod.c:28656:10: warning: implicit declaration of function ‘SDL_RenderGetIntegerScale’ [-Wimplicit-function-declaration] return SDL_RenderGetIntegerScale(x0); ^ build/temp.linux-x86_64-3.5/tcod._libtcod.c: In function ‘_cffi_d_SDL_RenderSetIntegerScale’: build/temp.linux-x86_64-3.5/tcod._libtcod.c:29080:10: warning: implicit declaration of function ‘SDL_RenderSetIntegerScale’ [-Wimplicit-function-declaration] return SDL_RenderSetIntegerScale(x0, x1); ^ build/temp.linux-x86_64-3.5/tcod._libtcod.c: In function ‘_cffi_d_SDL_SetWindowInputFocus’: build/temp.linux-x86_64-3.5/tcod._libtcod.c:31449:10: warning: implicit declaration of function ‘SDL_SetWindowInputFocus’ [-Wimplicit-function-declaration] return SDL_SetWindowInputFocus(x0); ^ build/temp.linux-x86_64-3.5/tcod._libtcod.c: In function ‘_cffi_d_SDL_SetWindowModalFor’: build/temp.linux-x86_64-3.5/tcod._libtcod.c:31589:10: warning: implicit declaration of function ‘SDL_SetWindowModalFor’ [-Wimplicit-function-declaration] return SDL_SetWindowModalFor(x0, x1); ^ build/temp.linux-x86_64-3.5/tcod._libtcod.c: In function ‘_cffi_d_SDL_SetWindowOpacity’: build/temp.linux-x86_64-3.5/tcod._libtcod.c:31642:10: warning: implicit declaration of function ‘SDL_SetWindowOpacity’ [-Wimplicit-function-declaration] return SDL_SetWindowOpacity(x0, x1); ^ build/temp.linux-x86_64-3.5/tcod._libtcod.c: In function ‘_cffi_d_SDL_SetWindowResizable’: build/temp.linux-x86_64-3.5/tcod._libtcod.c:31740:3: warning: implicit declaration of function ‘SDL_SetWindowResizable’ [-Wimplicit-function-declaration] SDL_SetWindowResizable(x0, x1); ^ build/temp.linux-x86_64-3.5/tcod._libtcod.c: In function ‘_cffi_checkfld__SDL_DropEvent’: build/temp.linux-x86_64-3.5/tcod._libtcod.c:61601:12: error: ‘SDL_DropEvent {aka struct SDL_DropEvent}’ has no member named ‘windowID’ (void)((p->windowID) | 0); / check that 'SDL_DropEvent.windowID' is an integer / ^ In file included from /usr/include/iconv.h:23:0, from /usr/include/SDL2/SDL_stdinc.h:87, from /usr/include/SDL2/SDL_main.h:25, from /usr/include/SDL2/SDL.h:32, from ./tcod/cffi.h:5, from build/temp.linux-x86_64-3.5/tcod._libtcod.c:482: build/temp.linux-x86_64-3.5/tcod._libtcod.c: At top level: build/temp.linux-x86_64-3.5/tcod._libtcod.c:65598:17: error: ‘SDL_DropEvent {aka struct SDL_DropEvent}’ has no member named ‘windowID’ { "windowID", offsetof(SDL_DropEvent, windowID), ^ build/temp.linux-x86_64-3.5/tcod._libtcod.c:65599:44: error: ‘SDL_DropEvent {aka struct SDL_DropEvent}’ has no member named ‘windowID’ sizeof(((SDL_DropEvent *)0)->windowID), ^ error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------

Command "/usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-build-ucu9poc_/tdl/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-0uvs6i9d-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-ucu9poc_/tdl/

该提问来源于开源项目:libtcod/python-tcod

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

20条回答

  • weixin_39811166 weixin_39811166 5月前

    Also , how well does tdl install outside of your Anaconda environment?

    点赞 评论 复制链接分享
  • weixin_39904612 weixin_39904612 5月前

    After updating cffi I started getting new errors. In virtualenv/conda environment:

    Command "/GameLocation/venv/bin/python2.7 -u -c "import setuptools, tokenize;file='/tmp/pip-req-build-2eRh2k/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-record-iEYDqK/install-record.txt --single-version-externally-managed --compile --install-headers /home/neko/Desktop/Defeki/4sem/the_lands_of_jo-ebs/venv/include/site/python2.7/tdl" failed with error code 1 in /tmp/pip-req-build-2eRh2k/

    Outside the environment- it seems the package has some trouble with numpy

    Collecting numpy<2,>=1.10 (from tdl==4.4.0.dev5) Using cached https://files.pythonhosted.org/packages/c0/e7/08f059a00367fd613e4f2875a16c70b6237268a1d6d166c6d36acada8301/numpy-1.14.3-cp27-cp27mu-manylinux1_x86_64.whl Requirement already satisfied: pycparser in /home/me/anaconda/lib/python2.7/site-packages (from cffi<2,>=1.8.1->tdl==4.4.0.dev5) (2.14) Installing collected packages: numpy, tdl Found existing installation: numpy 1.9.2 Cannot uninstall 'numpy'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

    I'm really sorry for bothering you.

    点赞 评论 复制链接分享
  • weixin_39811166 weixin_39811166 5月前

    You don't need to apologize for anything.

    I tested tdl with Anaconda on Ubuntu 18.04 and that worked, but there are no module version conflicts in that version of Ubuntu.

    "failed with error code 1" mostly just means, 'look at the traceback'. Ideally you could post the full logs since the working parts could give more insight on the raised error.

    The 2nd error looks like pip might be trying to uninstall a module installed via apt. You should be able to just add --user to pip, which will install the modules to your home directory instead of trying to replace the system install, or make a normal virtual environment without Anaconda. It also seems weird for it to look for and find packages in /home/me/anaconda/lib/python2.7/site-packages when you're not in an Anaconda environment.

    点赞 评论 复制链接分享
  • weixin_39904612 weixin_39904612 5月前

    So examining the contents of /usr/include/SDL2 revealed that the message shown when installing tdl via pip is correct and SDL_DropEvent in SDL_events.h doesn't have the windowID field, which indicates that tdl requires a different version. I then downloaded the SDL source code from http://www.libsdl.org/download-2.0.php, decompressed the archive, and copied the headers manually from include to /usr/include/SDL2. Afterwards, installing tdl via pip install tdl works with no issues.

    点赞 评论 复制链接分享
  • weixin_39811166 weixin_39811166 5月前

    Sorry that I took so long. I found and removed code that was manually including the SDL2 headers from /usr/include/SDL2.

    The headers provided from sdl2-config were being overridden by this include, but this only took effect during the compile phase and not the CFFI parsing phase.. This would've caused the issue above where existing symbols are declared as missing. The bug triggers whenever sdl2-config --cflags gives an include directory other than /usr/include/SDL2. I haven't actually confirmed this, but it seems plausible based on what we have so far.

    Anyone still around to try installing from the master branch and confirm this fix? pip install git+https://github.com/HexDecimal/python-tdl.git

    Keep in mind that if you distribute tdl then it will need to link to a libsdl2.so file where the version is the same as or later than the version used when tdl was compiled.

    点赞 评论 复制链接分享
  • weixin_39811166 weixin_39811166 5月前

    I haven't had much luck debugging these kinds of issues. You might be best off just following the PPA instructions: https://github.com/HexDecimal/python-tdl#linux (EDIT: disregard this, 16.04 and earlier is not supported by the PPA)

    Seems like cffi is having some kind of problem with SDL2's headers. You could try upgrading the cffi and setuptools modules to the latest versions using pip and then installing again.

    点赞 评论 复制链接分享
  • weixin_39811166 weixin_39811166 5月前

    Sorry for the long wait. I finally set up a Ubuntu 16.04 VM.

    I've tested installing tdl via pip, and I got it to install successfully. I couldn't repeat your error.

    Your log shows errors mentioning variables and functions added in SDL2.0.5 but Ubuntu 16.04 repositories use SDL2.0.4. I can only speculate that you have both sets of headers and that cffi might be mixing them up while compiling tdl.

    点赞 评论 复制链接分享
  • weixin_39904612 weixin_39904612 5月前

    I still have the same issue, no matter which installation method I try. After trying to install it via apt-get I get "E: Unable to locate package python-tdl E: Unable to locate package python3-td" message. Any suggestions?

    EDIT

    After trying to install it via pip I get "Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-gDKaXY/tdl/ " response.

    点赞 评论 复制链接分享
  • weixin_39811166 weixin_39811166 5月前

    The python-cffi package in Ubuntu 16.04 is too old to make a tdl package for APT. You'll have to use pip instead, or upgrade to Ubuntu 18.04 LTS.

    When you run pip do you get the same error as Lemmywinks?

    点赞 评论 复制链接分享
  • weixin_39904612 weixin_39904612 5月前

    After trying first method (PPA) I get

    E: Unable to locate package python-tdl E:Unable to locate package python3-tdl

    Building from source (second method) results in what Lemmywinks posted.

    点赞 评论 复制链接分享
  • weixin_39811166 weixin_39811166 5月前

    Can you check this command? apt list libsdl2-2.0-0 libsdl2-dev

    I get this when I run it:

    
    Listing... Done
    libsdl2-2.0-0/xenial,now 2.0.4+dfsg1-2ubuntu2 amd64 [installed]
    libsdl2-dev/xenial,now 2.0.4+dfsg1-2ubuntu2 amd64 [installed]
    

    The version of SDL2 on Ubuntu 16.04 is 2.0.4. It shouldn't be possible to get the above issues because you'd need to have symbols from later versions of SDL2 for the installer to even complain about them. Do you have any newer versions of SDL2 installed somewhere?

    点赞 评论 复制链接分享
  • weixin_39904612 weixin_39904612 5月前

    I have the exact same output when I run it.

    点赞 评论 复制链接分享
  • weixin_39811166 weixin_39811166 5月前

    This is incredibly hard for me to debug since I'm not able to reproduce the problems causing the issue.

    build/temp.linux-x86_64-3.5/tcod._libtcod.c: In function ‘_cffi_const_SDL_PIXELFORMAT_RGBA32’: build/temp.linux-x86_64-3.5/tcod._libtcod.c:3824:12: error: ‘SDL_PIXELFORMAT_RGBA32’ undeclared

    python-cffi is set up to parse the SDL2 headers in two steps, and I think the above is what happens when those two steps get out-of-sync.

    When you put all the symbols together you can see what they have on common: these are all functions and constants that exist in SDL2.0.5 but not SDL2.0.4, but I have no idea where the SDL2.0.5 headers are coming from.

    点赞 评论 复制链接分享
  • weixin_39904612 weixin_39904612 5月前

    I'm about to try installing it again and eventually search for workarounds. I will update the issue after finding something that works. Thanks for helping me anyway! I really appreciate the efforts, because I'd love to include your library in my game.

    点赞 评论 复制链接分享
  • weixin_39811166 weixin_39811166 5月前

    Your welcome. It's just hard to get enough information right now.

    You could try running grep --include=\*.h -rnw '/usr' -e 'SDL_PIXELFORMAT_ARGB32' to look for any SDL 2.0.5 headers on your /usr directory, and then maybe change /usr to look in other directories.

    Maybe also show the results of pip list.

    You can also use pip install git+https://github.com/HexDecimal/python-tdl.git to install directly from master rather than wait for a release first. I've at least fixed the no such option 'py_limited_api' error.

    点赞 评论 复制链接分享
  • weixin_39904612 weixin_39904612 5月前

    I get the

    Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-Bp9H_A/tdl/

    response again... I think I will try to download the repo and install from it. I would be extremely grateful if you could provide me with instructions on how to install it this way.

    点赞 评论 复制链接分享
  • weixin_39811166 weixin_39811166 5月前

    You'll need to post more of your output when there's an error. I'd at least need the Python traceback, if there is one.

    点赞 评论 复制链接分享
  • weixin_39904612 weixin_39904612 5月前

    Installed /tmp/pip-req-build-6EVXLy/.eggs/cffi-1.11.5-py2.7-linux-x86_64.egg Traceback (most recent call last): File "", line 1, in File "/tmp/pip-req-build-6EVXLy/setup.py", line 113, in license='Simplified BSD License', File "/home/neko/anaconda/lib/python2.7/distutils/core.py", line 111, in setup _setup_distribution = dist = klass(attrs) File "/home/neko/anaconda/lib/python2.7/site-packages/setuptools-17.1.1-py2.7.egg/setuptools/dist.py", line 272, in init File "/home/neko/anaconda/lib/python2.7/distutils/dist.py", line 287, in init self.finalize_options() File "/home/neko/anaconda/lib/python2.7/site-packages/setuptools-17.1.1-py2.7.egg/setuptools/dist.py", line 327, in finalize_options File "/home/neko/anaconda/lib/python2.7/site-packages/cffi/setuptools_ext.py", line 152, in cffi_modules add_cffi_module(dist, cffi_module) File "/home/neko/anaconda/lib/python2.7/site-packages/cffi/setuptools_ext.py", line 46, in add_cffi_module
    execfile(build_file_name, mod_vars)
    File "/home/neko/anaconda/lib/python2.7/site-packages/cffi/setuptools_ext.py", line 22, in execfile
    exec(code, glob, glob)
    File "build_libtcod.py", line 290, in
    ffi.cdef(open(CFFI_EXTRA_CDEFS, 'r').read())
    File "/home/neko/anaconda/lib/python2.7/site-packages/cffi/api.py", line 107, in cdef
    self._parser.parse(csource, override=override, packed=packed)
    File "/home/neko/anaconda/lib/python2.7/site-packages/cffi/cparser.py", line 167, in parse
    self._internal_parse(csource)
    File "/home/neko/anaconda/lib/python2.7/site-packages/cffi/cparser.py", line 173, in _internal_parse
    ast, macros, csource = self._parse(csource) File "/home/neko/anaconda/lib/python2.7/site-packages/cffi/cparser.py", line 130, in _parse self.convert_pycparser_error(e, csource) File "/home/neko/anaconda/lib/python2.7/site-packages/cffi/cparser.py", line 159, in convert_pycparser_error raise api.CDefError(msg) cffi.api.CDefError: cannot parse "extern "Python" {" :316:8: before: "Python"

    ----------------------------------------
    

    Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-req-build-6EVXLy/

    点赞 评论 复制链接分享
  • weixin_39765695 weixin_39765695 5月前

    Do you have the proper Python headers installed?

    点赞 评论 复制链接分享
  • weixin_39811166 weixin_39811166 5月前

    cffi.api.CDefError: cannot parse "extern "Python" {"

    extern "Python" is a cffi 1.6 feature. I'm not sure why it wouldn't be able to parse this unless the installed version was old. It should upgrade automatically but pip can act weird in this area. Maybe you could try upgrading cffi on its own before installing tdl.

    点赞 评论 复制链接分享