Closed max-vogler closed 6 years ago
Hey @max-vogler !
Small update.
With regards to the first issue: ImportError: dynamic module does not define module export function (PyInit_gameboycore)
pip can't install .egg
files. And it seems pypi will not accept .whl
files with the linux_x86_64
tag. So the solution is to install using easy_install
.
This should do the trick:
easy_install gameboycore
So you should not have to install from source.
Still digging on the second issue: ImportError: /app/gameboycore-python/gameboycore.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZTIN5boost6python15instance_holderE
Thanks for your feedback! Using easy_install gameboycore
works for the installation, but still yields the undefined symbol
error.
I suspect it's some sort of linking error? Is it possible to be flexible about the used Boost version? This could simplify installation to something around 3 steps:
apt-get update
apt-get install -y python3-dev python3-pip libboost-python
easy_install gameboycore
Updated the docs a bit but forgot to update the issue, sorry.
If you build from source and then add the /path/to/boost/stage/lib/
directory to the LD_LIBRARAY_PATH
environment variable you should be up and running.
What I can do is build the extension against the version of boost in the apt repo. Will simplify installation.
It works when adding the path to LD_LIBRARY_PATH
, thanks! Here is a working Dockerfile:
FROM debian:testing
RUN apt-get update -qq && \
apt-get install -y make git cmake gcc g++ python3.6-dev python3.6 wget libdpkg-perl && \
wget -q -O- https://bootstrap.pypa.io/get-pip.py | python3.6
ENV CPLUS_INCLUDE_PATH="/usr/include/python3.6"
WORKDIR /opt
RUN wget -qq https://sourceforge.net/projects/boost/files/boost/1.60.0/boost_1_60_0.tar.gz && \
tar -xzf boost_*.tar.gz && \
rm boost_*.tar.gz
ENV BOOST_ROOT=/opt/boost_1_60_0
WORKDIR $BOOST_ROOT
RUN echo "using python : 3.6 ;" > $HOME/user-config.jam
RUN ./bootstrap.sh
RUN ./b2 --with-system --with-python python-debugging=off threading=multi variant=release link=shared stage
ENV LD_LIBRARY_PATH="$BOOST_ROOT/stage/lib"
RUN easy_install gameboycore
Hey @nnarain!
I would love to use gameboycore-python for an AI project similar to MarI/O - Machine Learning for Video Games. For this purpose, I'm trying to install it in Debian (running in a Docker container) with Python 3.6.
When installing your library using
pip install gameboycore-python
, I'm getting the error:After successful manual compilation, when trying to run the demo you provided in https://github.com/nnarain/gameboycore-python/issues/8#issuecomment-269588554, I'm always getting the error:
For reference, my Dockerfile is this (I know that I'm running the installation code multiple times, that's part of the debugging):