ubuntu16.04+anaconda+openspiel

1.创建anaconda环境:

conda create -n openspiel python=3.7

2 激活环境:

source activate openspiel

3.更新

sudo apt-get update

4.安装matplotlib

conda install matplotlib    

     matplotlib版本至少3.11,默认安装就是这个版本

5.安装cmake

conda install cmake

cmake版本至少3.12,默认安装3.14

6.下载编译安装openspiel

git clone https://github.com/deepmind/open_spiel.git
cd open_spiel
./install.sh # Install various dependencies (note: assumes Debian-based distro!)
pip3 install --upgrade -r requirements.txt # Install Python dependencies
mkdir build
cd build
CXX=g++ cmake -DPython_TARGET_VERSION=3.6 -DCMAKE_CXX_COMPILER=g++ ../open_spiel
make -j6
ctest -j6

7. 把pythonpath加入bashrc

sudo gedit .bashrc

在最下面加入:

# For the Python modules in open_spiel.
export PYTHONPATH=$PYTHONPATH:/<path_to_open_spiel>
# For the Python bindings of Pyspiel
export PYTHONPATH=$PYTHONPATH:/<path_to_open_spiel>/build/python

更新一下bashrc

source .bashrc

8.安装absl-py

pip install absl-py

9.跑测试试一下:

cd openspiel/openspiel
python3 python/examples/example.py --game=breakthrough
python3 python/examples/matrix_game_example.py

10.参考资料:

https://arxiv.org/pdf/1908.09453.pdf

https://github.com/deepmind/open_spiel/blob/master/docs/install.md


版权声明:本文为qq_30193419原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。