“属性错误:文件号”当尝试从 pyevolve 导入时
我刚刚使用 easy_install 安装了 Pyevolve,在尝试运行我的第一个程序时遇到错误。我首先尝试复制并粘贴第一个示例的源代码,但是这是我尝试运行它时收到的信息:
回溯(最近一次调用最后一次):
文件“/home/corey/CTest/first_intro.py”,第 3 行,位于
从 pyevolve 导入 G1DList
文件“/usr/lib/python2.6/site-packages/Pyevolve-0.5-py2.6.egg/pyevolve/init.py”,第 15 行,位于
文件“/usr/lib/python2.6/site-packages/Pyevolve-0.5-py2.6.egg/pyevolve/Consts.py”,第 240 行,位于
导入选择器
文件“/usr/lib/python2.6/site-packages/Pyevolve-0.5-py2.6.egg/pyevolve/Selectors.py”,第 12 行,位于
文件“/usr/lib/python2.6/site-packages/Pyevolve-0.5-py2.6.egg/pyevolve/GPopulation.py”,第 11 行,位于
文件“/usr/lib/python2.6/site-packages/Pyevolve-0.5-py2.6.egg/pyevolve/FunctionSlot.py”,第 14 行,位于
文件“/usr/lib/python2.6/site-packages/Pyevolve-0.5-py2.6.egg/pyevolve/Util.py”,第 20 行,位于
属性错误:文件号
我正在 Fedora 11 X86_64 上运行 python 2.6。
编辑:经过更多研究后,如果我从命令行运行 python,它可以工作,但只有当我运行 IDLE 时才会失败。
I just installed Pyevolve using easy_install and I am getting errors trying to run my first program. I first tried copy and pasting the source code of the first example but this is what I receive when I attempt to run it:
Traceback (most recent call last):
File "/home/corey/CTest/first_intro.py", line 3, in
from pyevolve import G1DList
File "/usr/lib/python2.6/site-packages/Pyevolve-0.5-py2.6.egg/pyevolve/init.py", line 15, in
File "/usr/lib/python2.6/site-packages/Pyevolve-0.5-py2.6.egg/pyevolve/Consts.py", line 240, in
import Selectors
File "/usr/lib/python2.6/site-packages/Pyevolve-0.5-py2.6.egg/pyevolve/Selectors.py", line 12, in
File "/usr/lib/python2.6/site-packages/Pyevolve-0.5-py2.6.egg/pyevolve/GPopulation.py", line 11, in
File "/usr/lib/python2.6/site-packages/Pyevolve-0.5-py2.6.egg/pyevolve/FunctionSlot.py", line 14, in
File "/usr/lib/python2.6/site-packages/Pyevolve-0.5-py2.6.egg/pyevolve/Util.py", line 20, in
AttributeError: fileno
I am running python 2.6 on Fedora 11 X86_64.
Edit: After looking into it more if I run python from the command line it works but it only fails when I'm running IDLE.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否尝试过查看开发版本?它接近 RC1,所以现在很稳定:
svn co https://pyevolve.svn.sourceforge.net/svnroot/pyevolve/trunk pyevolve
你的问题似乎是路径,尝试解压缩“egg”文件并将“pyevolve”目录放入站点包或应用程序目录内。
Have you tried to check out the Development version ? It's near of the RC1, so it is stable right now:
svn co https://pyevolve.svn.sourceforge.net/svnroot/pyevolve/trunk pyevolve
Your problem seems to be the paths, try uncompressing the "egg" file and put the "pyevolve" directory in the site-packages or inside your application directory.