2017-01-06 144 views
2

我在virtualenv中安裝gym-atari時遇到問題。從我可以告訴,它看起來像問題是與zlib,但zlib安裝在系統上(所以是cmake)。有人有主意嗎?這是在Gentoo系統上,它的價值:在virtualenv中安裝gym [atari]

(tensorflow)alaya ~ # pip install gym[atari] 
Requirement already satisfied: gym[atari] in  /opt/tensorflow/lib/python2.7/site-packages 
Requirement already satisfied: six in /usr/lib64/python2.7/site-packages (from gym[atari]) 
Requirement already satisfied: requests>=2.0 in /usr/lib64/python2.7/site-packages (from gym[atari]) 
Requirement already satisfied: pyglet>=1.2.0 in /opt/tensorflow/lib/python2.7/site-packages (from gym[atari]) 
Requirement already satisfied: numpy>=1.10.4 in /opt/tensorflow/lib/python2.7/site-packages (from gym[atari]) 
Requirement already satisfied: PyOpenGL; extra == "atari" in /usr/lib64/python2.7/site-packages (from gym[atari]) 
Collecting atari-py>=0.0.17; extra == "atari" (from gym[atari]) Using cached atari-py-0.0.18.tar.gz 
Requirement already satisfied: Pillow; extra == "atari" in /usr/lib64/python2.7/site-packages (from gym[atari]) 
Building wheels for collected packages: atari-py 
Running setup.py bdist_wheel for atari-py ... error 
Complete output from command /opt/tensorflow/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-Xd0Ga4/atari-py/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpCxn1j3pip-wheel- --python-tag cp27: 
. 
. 
. 
[ 9%] Building CXX object CMakeFiles/ale-bin.dir/src/common/display_screen.cpp.o 
In file included from /tmp/pip-build-Xd0Ga4/atari-py/atari_py/ale_interface/src/emucore/unzip.c:13:0: /tmp/pip-build-Xd0Ga4/atari-py/atari_py/ale_interface/src/emucore/unzip.h:114:45: 
error: expected '=', ',', ';', 'asm' or '__attribute__' before 'OF' extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1, 
              ^ 
/tmp/pip-build-Xd0Ga4/atari-py/atari_py/ale_interface/src/emucore/unzip.h:127:32: 
error: expected '=', ',', ';', 'asm' or '__attribute__' before 'OF' extern unzFile ZEXPORT unzOpen OF((const char *path)); 
           ^ 
/tmp/pip-build-Xd0Ga4/atari-py/atari_py/ale_interface/src/emucore/unzip.h:138:29: 
error: expected '=', ',', ';', 'asm' or '__attribute__' before 'OF' extern int ZEXPORT unzClose OF((unzFile file)); 
. . . 

任何想法?我唯一的猜測是,不知何故zlib沒有被拉進virtualenv?也許它甚至不是zlib?

+0

問這個問題響了,我有一個類似的問題試圖在我的Gentoo盒子上安裝ALE。解決辦法是修改unzip.h,但我不知道該怎麼做。 我會打開一個新的線程,並嘗試從這裏鏈接到它。 – user3054726

回答

3

也可以,所以這最終是一個Gentoo問題 - 我會發布解決方案,以防其他人擁有它。

按照說明here(使用atari-py而不是netifaces)我能夠得到我可以編輯的軟件包的一個版本。然後添加以下到/tmp/atari-py-0.0.18/atari_py/ale_interface/src/emucore/unzip.h的頂部:

/* Gentoo removed OF from their copy of zconf.h  (https://bugs.gentoo.org/show_bug.cgi?id=383179) */ 
/* but our copy of minizip needs it. */ 
#ifndef OF 
#define OF(args) args 
#endif 

然後運行點子安裝。從/tmp/atari-py-0.0.18取得了訣竅。

+0

謝謝,這也適用於我。我從github克隆了atari-py,按照你的建議更改了代碼並做了「點安裝」。像我的gentoo上的魅力一樣工作 – coolbootgeek