Open zzhuncle opened 2 years ago
Make sure that libboost
is installed. You can install on Ubuntu with this command:
sudo apt install libboost-python-dev
Hope it helps.
By the way, this is the error after I installed libboost
from apt
Traceback (most recent call last):
File "/opt/conda/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/opt/conda/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/mnt/rldm/scripts/evaluate_checkpoint.py", line 19, in <module>
import gfootball.env as football_env
File "/opt/conda/lib/python3.7/site-packages/gfootball/__init__.py", line 17, in <module>
from gfootball.env import scenario_builder
File "/opt/conda/lib/python3.7/site-packages/gfootball/env/__init__.py", line 21, in <module>
from gfootball.env import config
File "/opt/conda/lib/python3.7/site-packages/gfootball/env/config.py", line 27, in <module>
import gfootball_engine as libgame
File "/opt/conda/lib/python3.7/site-packages/gfootball_engine/__init__.py", line 43, in <module>
from _gameplayfootball import *
ImportError: /usr/lib/x86_64-linux-gnu/libboost_python38.so.1.71.0: undefined symbol: _Py_tracemalloc_config
I have no idea how this happened. I worked with the previous build of Docker before :(
I believe that my problem is surely different from the original issue. It happened in running in a Docker when called import gfootball
. Does anyone see ImportError: /usr/lib/x86_64-linux-gnu/libboost_python38.so.1.71.0: undefined symbol: _Py_tracemalloc_config
before? My Docker has libboost-all-dev
and libboost-python-dev
installed.
For those who got a problem similar to mine, I fixed it by upgrading my Python version to 3.8 instead. And the _Py_tracemalloc_config
is gone.
As for the original issue, might need zzhuncle to update whether installing libboost-all-dev
is fixed or not.
Sorry for jamming my issue here in the same thread. I thought it related to libboost
similarly.
I think that @zzhuncle problem is happening because of Python version mismatch. Ubuntu 20.04 has Python 3.8 by default, so apt
also installs Boost.Python 3.8 and not 3.9. To run football with Python 3.9 you need to compile Boost.Python against the same version.
Thanks for the comments @fonylew. I think your error can be explained by the same reasoning (you had Python 3.7). I've been working on replacing Boost.Python with Pybind11. Once the PR is ready, it will eliminate such problems, because Python version will be resolved dynamically during compilation of the engine.
I have met the same issue. And I have solved it by install py-boost under Anaconda environment. Here is a reference https://anaconda.org/anaconda/py-boost
I have met the same issue. And I have solved it by install py-boost under Anaconda environment. Here is a reference https://anaconda.org/anaconda/py-boost
Thank you, Yurui-Li!!!! Your solution is the cleanest one that does save my time! Recommend this solution to everyone who encountered the same bug.
I have met the same issue. And I have solved it by install py-boost under Anaconda environment. Here is a reference https://anaconda.org/anaconda/py-boost
thanks!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
I use a ubuntu20.04 LTS virtual machine, but i cannot pip the gfootball, here is the error logs. thanks very much.