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

嗯嗯,其他的問題,目前我還不太清楚,可以提出來,大家一起討論。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM