py2app抛出[errno 35]无条件导入期间资源不可用 [英] py2app throws [errno 35] Resource Not Available during unconditional imports

查看:203
本文介绍了py2app抛出[errno 35]无条件导入期间资源不可用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用通过macports,pyobjc,可可和特别是scipy安装的python 2.7(通过 FlowCytometryTools )与py2app一起创建一个小型mac应用程序.使用sudo python setup.py py2app运行的Py2app的setup.py用-A可以很好地完成测试,但是如果没有该参数来创建完整的.app构建,则无法完成.

I'm using python 2.7 installed via macports, pyobjc, cocoa and notably scipy (via FlowCytometryTools) with py2app to create a small mac application. Py2app's setup.py run with sudo python setup.py py2app completes nicely with -A for testing, but is unable to complete when running without that parameter to create a full .app build.

构建过程将通过无条件导入获得可变的距离,然后给出error: [Errno 35] Resource temporarily unavailable并立即退出.发生错误之前完成的无条件导入行的数量将发生变化.重新启动后立即运行时,可以看到迄今为止最长的运行时间.我尝试在不删除以前的build/dist文件夹的情况下运行而没有任何效果.

The build process will get a variable distance through the unconditional imports and then give error: [Errno 35] Resource temporarily unavailable and immediately exit. The number of unconditional import lines that complete before the error occurs changes. The longest run so far was seen when running immediately after a reboot. I've tried running with and without removing the previous build/dist folders to no effect.

Modules not found (unconditional imports):
...
 * builtins.int (Cython.Build.Inline, Cython.Compiler.ExprNodes, IPython.utils._tokenizeerror: [Errno 35] Resource temporarily unavailable

我的setup.py看起来像这样:

My setup.py looks like this:

import sys
sys.setrecursionlimit(1500) #required to avoid recursion triggered early exit in py2app while compiling scipy. (default is 1000)
from setuptools import setup

APP = ['FlowMac.py']
DATA_FILES = ['FlowMac_Main.xib']
OPTIONS = {'argv_emulation': True}

setup(
    app=APP,
    data_files=DATA_FILES,
    options={'py2app': OPTIONS},
    setup_requires=['py2app'],
)

和我的python文件FlowMac.py的imports部分看起来像这样:

and the imports section of my python file FlowMac.py looks like this:

from Cocoa import *
from Foundation import *
from AppKit import *
from FlowCytometryTools import * #file/data handling via scipy and pandas
from pylab import * #graphing histograms

对FlowCytometryTools和pylab导入进行注释可以使py2app构建完成,但当然会使程序无法运行.

Commenting out both the FlowCytometryTools and the pylab imports allows the py2app build to complete but of course renders the program nonfunctional.

  • 发生了什么事?
  • 如何获取有关哪些资源不可用的更多信息?
    • 达到递归限制是我遇到问题的线索吗?
    • What is happening?
    • How can I get more information on which resource is unavailable?
      • was hitting a recursion limit a clue to my problem?

      我在具有8GB RAM的MacBook Pro上运行优胜美地,所以在这里碰壁感到非常惊讶. 谢谢您的宝贵时间.

      I'm running Yosemite on a MacBook Pro with 8GB RAM, so I'm very surprised to be hitting a wall here. Thanks for your time.

      2015年4月29日更新: 如果我从py2app启动器setup.py的datafiles数组中删除.xib,则导入一切工作正常.仅导入Cocoa,Foundation和Appkit的空白文件即可正常工作.使用FlowCytometryTools,pylab,scipy,matplotlib,numpy中的任何一种导入xib均无效. pylab和FlowCytometryTools依赖于其他三个,而scipy,matplotlib或numpy中的任何一个都会为其他两个引入py2app接收.这些方法之一不适用于xib,但我不知道为什么...

      UPDATE 4/29/2015: Importing everything works fine if I remove my .xib from the datafiles array of the py2app launcher setup.py. A blank file with just import Cocoa, Foundation and Appkit works fine. Importing the xib with any one of FlowCytometryTools, pylab, scipy, matplotlib, numpy does not work. pylab and FlowCytometryTools rely on the other three, and any one of scipy, matplotlib or numpy brings in py2app recipies for the other two. One of these recipies isn't working with the xib, but I don't know why...

      推荐答案

      根据我的测试,此错误似乎是由py2app的日志输出本身引起的.尝试将标准错误重定向到文件:

      From my testing, this error seems to be caused by the log output itself from py2app. Try redirecting standard error to a file:

      python setup.py py2app 2>error_log
      

      这应该可以解决该错误.

      This should work around the error.

      这篇关于py2app抛出[errno 35]无条件导入期间资源不可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆