google-research / football

Check out the new game server:
https://research-football.dev
Apache License 2.0
3.28k stars 1.27k forks source link

Could NOT find Boost: #317

Open zzhuncle opened 2 years ago

zzhuncle commented 2 years ago

I use a ubuntu20.04 LTS virtual machine, but i cannot pip the gfootball, here is the error logs. thanks very much.

 -- Found Python: /home/zzh/anaconda3/lib/libpython3.9.so (found version "3.9") found components: Development
  Using Python: 3.9
  -- Could NOT find Boost: missing: python39 (found /usr/lib/x86_64-linux-gnu/cmake/Boost-1.71.0/BoostConfig.cmake (found version "1.71.0"))
  python39 not found. Trying other names.
  -- Could NOT find Boost: missing: python3-py39 (found /usr/lib/x86_64-linux-gnu/cmake/Boost-1.71.0/BoostConfig.cmake (found version "1.71.0"))
  python3-py39 not found. Trying other names.
  -- Could NOT find Boost: missing: python-py39 (found /usr/lib/x86_64-linux-gnu/cmake/Boost-1.71.0/BoostConfig.cmake (found version "1.71.0"))
  python-py39 not found. Trying other names.
  CMake Error at CMakeLists.txt:113 (message):
    Boost Python not found

  -- Configuring incomplete, errors occurred!
  See also "/tmp/pip-install-5avl6psx/gfootball_f24dfc15e0d24ff888c84e5c4eec7570/third_party/gfootball_engine/CMakeFiles/CMakeOutput.log".
  gfootball/build_game_engine.sh: 第 29 行: pushd: third_party/gfootball_engine: 没有那个文件或目录
  error: Google Research Football compilation failed
  [end of output]
fonylew commented 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.

fonylew commented 2 years ago

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 :(

fonylew commented 2 years ago

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.

fonylew commented 2 years ago

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.

vi3itor commented 2 years ago

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.

Yurui-Li commented 1 year ago

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

Zi-ang-Cao commented 1 year ago

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.

1220357873 commented 1 month ago

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!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!