AttributeError: 'module' object has no attribute 'RAND_LIMIT_swigconstant

好久没有来yy了。

 

最近在耍openAI,安装些组件的时候出了点问题,也不算是大问题,在https://github.com/openai/gym/issues/100找到了解决方案的,我这里算是记录一下。

jonasschneider

One of the only references to this issue that I could dig up is http://lists.alioth.debian.org/pipermail/pkg-exppsy-pymvpa/2015q3.txt (grep for swigconstant). For them, SWIG 3.0.6 is failing, while SWIG 3.0.2 is working.

我当时按照的时候这个小组建已经是3.0.10版本了,报了一样的错误,于是果断的把版本调到3.0.2

过程如下(用$标记的是输入的命令行):

$ conda uninstall swig
$ conda search swig
Fetching package metadata ...............
swig                         2.0.10                   py27_0  defaults        
                             2.0.10                        1  defaults        
                             3.0.2                         0  defaults        
                             3.0.8                         0  defaults        
                             3.0.8                         1  defaults        
                             3.0.10                        0  defaults        
                             3.0.12               h38cdd7d_3  defaults        
                             3.0.12               h38cdd7d_3  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main 
                             2.0.10                   py27_0  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free 
                             2.0.10                        1  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free 
                             3.0.2                         0  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free 
                             3.0.8                         0  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free 
                             3.0.8                         1  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free 
                             3.0.10                        0  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free 
$ conda install swig=3.0.2

大概就是这么个情况,如果不行,再把swig安装成3.0.2,然后再把pybox2d组件重装下:

$ git clone https://github.com/pybox2d/pybox2d.git
$ cd pybox2d/
$ python setup.py clean
$ python setup.py install

嗯嗯,其他的问题,目前我还不太清楚,可以提出来,大家一起讨论。

posted @ 2017-12-16 09:49  looking weather  阅读(1315)  评论(0编辑  收藏  举报