Closed Zaakir-Kamar closed 4 years ago
The log shows that you have a problem with boost-python.
First of all, check what boost-python libs you have installed on your machine. You can do it by running:
find /usr/lib/x86_64-linux-gnu/ -name 'libboost_python3*'
On my Ubuntu 18.04 it produces the following output:
/usr/lib/x86_64-linux-gnu/libboost_python3-py36.a
/usr/lib/x86_64-linux-gnu/libboost_python3.so
/usr/lib/x86_64-linux-gnu/libboost_python3.a
/usr/lib/x86_64-linux-gnu/libboost_python3-py36.so
/usr/lib/x86_64-linux-gnu/libboost_python3-py36.so.1.65.1
If you have a similar result, the easiest solution would be to go with Python 3.6 for the virtual environment:
/usr/bin/python3.6 -m venv football-env
source football-env/bin/activate
pip3 install --upgrade pip setuptools
pip3 install gfootball
If you are still having errors run pip3 install gfootball --log log.txt
and attach your log.
Hi. new update. I troubleshooted and found it was because Boost was not installed to match Python. And I had to rebuild boost manually; now it gives a different error
/tmp/pip-req-build-vg1j0bgi/third_party/gfootball_engine /tmp/pip-req-build-vg1j0bgi
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so
-- Found SDL2_image: /usr/lib/x86_64-linux-gnu/libSDL2_image.so
-- Found SDL2_ttf: /usr/lib/x86_64-linux-gnu/libSDL2_ttf.so
-- Found SDL2_gfx: /usr/lib/x86_64-linux-gnu/libSDL2_gfx.so (found version "1.0.4")
-- Found PythonLibs: /usr/local/lib/libpython3.7m.a (found suitable version "3.7.6", minimum required is "3")
Using Python: 3.7.6
-- Boost found.
-- Found Boost components:
python3-py37
python3-py37 not found. Trying other names.
-- Boost found.
-- Found Boost components:
python-py37
python-py37 not found. Trying other names.
-- Boost found.
-- Found Boost components:
python37
CMake Error at CMakeLists.txt:71 (message):
Python boost not found
-- Configuring incomplete, errors occurred!
See also "/tmp/pip-req-build-vg1j0bgi/third_party/gfootball_engine/CMakeFiles/CMakeOutput.log".
gfootball/build_game_engine.sh: line 27: pushd: third_party/gfootball_engine: No such file or directory
error: Google Research Football compilation failed
----------------------------------------
ERROR: Command errored out with exit status 1: /home/user/origin/football/football-env/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-vg1j0bgi/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-vg1j0bgi/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-6lv4p77o/install-record.txt --single-version-externally-managed --compile --install-headers /home/user/origin/football/football-env/include/site/python3.7/gfootball Check the logs for full command output.
It is basically the same error: Python boost not found
. If you manually build boost python, did you install library files to the appropriate location? What is the output of the command find /usr/lib/x86_64-linux-gnu/ -name 'libboost_python3*'
?
Ok. Now I'm trying out
The log shows that you have a problem with boost-python. First of all, check what boost-python libs you have installed on your machine. You can do it by running:
find /usr/lib/x86_64-linux-gnu/ -name 'libboost_python3*'
On my Ubuntu 18.04 it produces the following output:/usr/lib/x86_64-linux-gnu/libboost_python3-py36.a /usr/lib/x86_64-linux-gnu/libboost_python3.so /usr/lib/x86_64-linux-gnu/libboost_python3.a /usr/lib/x86_64-linux-gnu/libboost_python3-py36.so /usr/lib/x86_64-linux-gnu/libboost_python3-py36.so.1.65.1
If you have a similar result, the easiest solution would be to go with Python 3.6 for the virtual environment:
/usr/bin/python3.6 -m venv football-env source football-env/bin/activate pip3 install --upgrade pip setuptools pip3 install gfootball
If you are still having errors run
pip3 install gfootball --log log.txt
and attach your log.
Hi, still the problem persists. Terminal output logs are attached terminal_output.txt
Looks like you need to specify a version of Python (CMake
has to use Python 3.6 instead of Python 3.7). Edit line 44 of CMakeLists.txt
:
replace find_package(PythonLibs 3 REQUIRED)
with find_package(PythonLibs 3.6 REQUIRED)
Please report the results.
Ok. Working on it. I'll reply ASAP
But, of course, you need to do it in the cloned repository pip3 install .
instead of simply pip3 install gfootball
Okay. Got it. I understand, I already have a clone of the repo. However, thanks for your suggestion . I'll reply ASAP
Here's the Output. Still a config error I guess.
/tmp/pip-req-build-7blrc253/third_party/gfootball_engine /tmp/pip-req-build-7blrc253
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so
-- Found SDL2_image: /usr/lib/x86_64-linux-gnu/libSDL2_image.so
-- Found SDL2_ttf: /usr/lib/x86_64-linux-gnu/libSDL2_ttf.so
-- Found SDL2_gfx: /usr/lib/x86_64-linux-gnu/libSDL2_gfx.so (found version "1.0.4")
-- Found PythonLibs: /usr/local/lib/libpython3.7m.a (found suitable version "3.7.6", minimum required is "3.6")
Using Python: 3.7.6
-- Boost found.
-- Found Boost components:
python3-py37
python3-py37 not found. Trying other names.
-- Boost found.
-- Found Boost components:
python-py37
python-py37 not found. Trying other names.
-- Boost found.
-- Found Boost components:
python37
CMake Error at CMakeLists.txt:71 (message):
Python boost not found
-- Configuring incomplete, errors occurred!
See also "/tmp/pip-req-build-7blrc253/third_party/gfootball_engine/CMakeFiles/CMakeOutput.log".
gfootball/build_game_engine.sh: line 27: pushd: third_party/gfootball_engine: No such file or directory
error: Google Research Football compilation failed
----------------------------------------
ERROR: Command errored out with exit status 1: /home/user/resche/football-env/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-7blrc253/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-7blrc253/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-0n0evoxh/install-record.txt --single-version-externally-managed --compile --install-headers /home/user/resche/football-env/include/site/python3.6/gfootball Check the logs for full command output.
Yes, it (again) found Python 3.7 instead of Python 3.6. I couldn't find any way to force a specific version. Last resort, manually define Python libraries and include_dirs: replace the lines 44-48:
find_package(PythonLibs 3 REQUIRED)
message("Using Python: ${PYTHONLIBS_VERSION_STRING}")
string(REPLACE "." ";" VERSION_LIST ${PYTHONLIBS_VERSION_STRING})
list(GET VERSION_LIST 0 PYTHON_MAJOR)
list(GET VERSION_LIST 1 PYTHON_MINOR)
with
set(PYTHON_LIBRARIES /usr/local/lib/libpython3.6m.a)
set(PYTHON_INCLUDE_DIRS /usr/include/python3.6)
set(PYTHON_MAJOR 3)
set(PYTHON_MINOR 6)
Nah... It's still not recognisable.
/tmp/pip-req-build-vrnl5br0/third_party/gfootball_engine /tmp/pip-req-build-vrnl5br0
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so
-- Found SDL2_image: /usr/lib/x86_64-linux-gnu/libSDL2_image.so
-- Found SDL2_ttf: /usr/lib/x86_64-linux-gnu/libSDL2_ttf.so
-- Found SDL2_gfx: /usr/lib/x86_64-linux-gnu/libSDL2_gfx.so (found version "1.0.4")
-- Boost found.
-- Found Boost components:
python3-py6
python3-py6 not found. Trying other names.
-- Boost found.
-- Found Boost components:
python-py6
python-py6 not found. Trying other names.
-- Boost found.
-- Found Boost components:
python6
CMake Error at CMakeLists.txt:70 (message):
Python boost not found
-- Configuring incomplete, errors occurred!
See also "/tmp/pip-req-build-vrnl5br0/third_party/gfootball_engine/CMakeFiles/CMakeOutput.log".
gfootball/build_game_engine.sh: line 27: pushd: third_party/gfootball_engine: No such file or directory
error: Google Research Football compilation failed
----------------------------------------
ERROR: Command errored out with exit status 1: /home/zaakir/resche/football-env/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-vrnl5br0/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-vrnl5br0/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-fmh5qi_r/install-record.txt --single-version-externally-managed --compile --install-headers /home/zaakir/resche/football-env/include/site/python3.6/gfootball Check the logs for full command output.
I suppose it recognizes Python-Libs alright. But there's some kind of repetitive loop in CMake list. The algorithm to recognize Boost lib might be problematic.
Sorry, my mistake (no copy-paste programming! haha). It should be
set(PYTHON_MINOR 6)
instead of
set(PYTHON_MAJOR 6)
Oh! You made me mad. That's why I was confused why. Hahaha. It's Just the major/minor, what a small but significant mistake. :-| . I appreciate you for finding out the mistake without being too confident.
Nope. I changed MAJOR-->MINOR. Still not working. Isn't it possible that there's some error in building third-party engine in Ubuntu according to the current CMakeList.txt? I'm sure I have libboost installed against Py3.6 (as in previous log I attached) and I 'doubt' whether CMake/CMakeList can actually recognize Boost. Here's the last part of output
/tmp/pip-req-build-rcsjuc_u/third_party/gfootball_engine /tmp/pip-req-build-rcsjuc_u
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so
-- Found SDL2_image: /usr/lib/x86_64-linux-gnu/libSDL2_image.so
-- Found SDL2_ttf: /usr/lib/x86_64-linux-gnu/libSDL2_ttf.so
-- Found SDL2_gfx: /usr/lib/x86_64-linux-gnu/libSDL2_gfx.so (found version "1.0.4")
-- Boost found.
-- Found Boost components:
python3-py36
python3-py36 not found. Trying other names.
-- Boost found.
-- Found Boost components:
python-py36
python-py36 not found. Trying other names.
-- Boost found.
-- Found Boost components:
python36
CMake Error at CMakeLists.txt:70 (message):
Python boost not found
-- Configuring incomplete, errors occurred!
See also "/tmp/pip-req-build-rcsjuc_u/third_party/gfootball_engine/CMakeFiles/CMakeOutput.log".
gfootball/build_game_engine.sh: line 27: pushd: third_party/gfootball_engine: No such file or directory
error: Google Research Football compilation failed
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-rcsjuc_u/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-rcsjuc_u/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-yzkwok1d/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.7m/gfootball Check the logs for full command output.
Can you verify that your CMakeLists.txt matches one from the master branch, except lines 44-48 that I asked you to replace?
Here CMakeLists.txt
I got back to my Ubuntu machine to check. There are no problems with finding python-boost3 by CMake. There is a small problem with compilation because it should be set(PYTHON_INCLUDE_DIR /usr/include/python3.6)
instead of DIRS.
If you are using a fresh version of CMake and haven't manually edited CMakeModule for finding Boost I don't know how to explain your problem.
You can try to use the following CMakeLists.txt that I prepared for you. All the if ... else
statements are removed and it successfully compiles on my end.
Thank you very much for your effort and time. For me, It still wouldn't compile, but this time a different error. I'm not an expert at CMake, do you think there's something wrong with my installation of CMake?
/tmp/pip-req-build-3kdhutp8/third_party/gfootball_engine /tmp/pip-req-build-3kdhutp8
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so
-- Found SDL2_image: /usr/lib/x86_64-linux-gnu/libSDL2_image.so
-- Found SDL2_ttf: /usr/lib/x86_64-linux-gnu/libSDL2_ttf.so
-- Found SDL2_gfx: /usr/lib/x86_64-linux-gnu/libSDL2_gfx.so (found version "1.0.4")
Using python_boost: python3-py36
CMake Error at /usr/local/lib/cmake/Boost-1.73.0/BoostConfig.cmake:141 (find_package):
Could not find a package configuration file provided by
"boost_python3-py36" (requested version 1.73.0) with any of the following
names:
boost_python3-py36Config.cmake
boost_python3-py36-config.cmake
Add the installation prefix of "boost_python3-py36" to CMAKE_PREFIX_PATH or
set "boost_python3-py36_DIR" to a directory containing one of the above
files. If "boost_python3-py36" provides a separate development package or
SDK, be sure it has been installed.
Call Stack (most recent call first):
/usr/local/lib/cmake/Boost-1.73.0/BoostConfig.cmake:258 (boost_find_component)
/usr/share/cmake-3.10/Modules/FindBoost.cmake:242 (find_package)
CMakeLists.txt:53 (FIND_PACKAGE)
-- Configuring incomplete, errors occurred!
See also "/tmp/pip-req-build-3kdhutp8/third_party/gfootball_engine/CMakeFiles/CMakeOutput.log".
See also "/tmp/pip-req-build-3kdhutp8/third_party/gfootball_engine/CMakeFiles/CMakeError.log".
gfootball/build_game_engine.sh: line 27: pushd: third_party/gfootball_engine: No such file or directory
error: Google Research Football compilation failed
----------------------------------------
ERROR: Command errored out with exit status 1: /home/zaakir/football-research/football/football-env/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-3kdhutp8/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-3kdhutp8/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-o1uald16/install-record.txt --single-version-externally-managed --compile --install-headers /home/zaakir/football-research/football/football-env/include/site/python3.7/gfootball Check the logs for full command output.
It says I don't have
boost_python3-py36Config.cmake boost_python3-py36-config.cmake
but I have
boost_python-config.cmake boost_python-config-version.cmake
Does that make any sense?
Now I see what is your problem.
There is no /usr/local/lib/cmake/Boost-1.73.0/
directory on my Ubuntu. And I repeat that I have the same Ubuntu version (Ubuntu 18.04). I don't even have /usr/local/lib/cmake/
. Which means that it was probably created when you
rebuilt boost manually
When I run sudo apt-get install libboost-all-dev
I get
libboost-all-dev is already the newest version (1.65.1.0ubuntu1).
My advice is to safely remove newly built boost (1.73.0) and go with the default one. We solved the problem with finding a correct version of Python, so you probably don't need the newest boost anymore. Otherwise, if you want to use the latest versions of libraries, you are on your own to make sure that they have the right dependencies installed (e.g. latest cmake, etc.).
Yes. You're right. I installed Boost (latest version) manually. And now I successfully removed boost(manual_install). And installed all the said dependencies. Ok. Now, I have to say I had followed 2 methods (as in README);
1) Downloading repository(and installing with pip install .)- I have two of repos, one without venv and other with venv. Sometimes, I freshly download a repo if there was an error
2) Installing from PyPi ('pip3 install gfootball')- I always start-out with a fresh venv and install gfootball
Now, here's the logs(PIP) of what I ran today after I uninstalled manual boost installation and reinstalled apt-get for all the packages as in Readme
Logs:
====
When I run 'pip3 install gfootball '--log log.txt -
log.txt
When I run 'pip3 install . --log log.txt' (With the custom CMakeInstall you made)- log.txt
For some (Sherlock_Holmes-like) detective purposes, LOL, here are some important system info which may matter (Eg: Python, Boost, System): output.txt
And also note that I had installed Python3.7.4, Python3.7.6 manually recently and I got a warning (it's below) regarding PIP and I think maybe it matters (but I'm using 3.6!)
Part of PIP Warning- python3 pip sudo warning.txt
(Edited) ====== Oh, I forgot to mention some boost details boost_info.txt
First, since you have boost-python36, you have to use Python 3.6 to create a virtual environment and run pip3:
/usr/bin/python3.6 -m venv football-env
source football-env/bin/activate
Second, you have to use a version of CMakeLists.txt
that I prepared for you above and run installation from the cloned repo:
pip3 install .
But the error message shows that you haven't removed boost completely:
CMake Error at /usr/local/lib/cmake/Boost-1.73.0/BoostConfig.cmake:141 (find_package)
Rename (remove) /usr/local/lib/cmake
and see if it helps.
@Zaakir-Kamar Have you solved the problem?
In any case, you can probably close the issue, because it is specific to your system set-up and not a problem with gfootball
.
The lesson here: if anyone decides to replace the default version of some packages in the OS with updated ones (e.g. Python), it's up to them to manually install the other compatible packages (e.g. boost). For Ubuntu 18.04, Python 3.6 is a default major version, that's why sudo apt-get install libboost-all-dev
installs libboost_python3-py36.so
.
Closing for now, please reopen if it still not resolved for you
Machine Details: Ubuntu 18.04, Python 3.7.6
When installing 'pip3 install gfootball'; every package installs fine, but gfootball wheel building fails (Note: I installed packages like PyGame, OpenCV successfully in my first attempt, but failed to build gfootball). I suppose there's something wrong with gfootball wheel. Here it is below