Py2app throws [errno 35] Resource unavailable during unconditional import

I am using python 2.7 installed via macports, pyobjc, cocoa and especially scipy (via FlowCytometryTools ) with py2app to create a small mac application. Running Py2app setup.py with sudo python setup.py py2app great for -A for testing, but when run without this option, it is not possible to create a complete .app assembly.

The build process will receive a variable distance through unconditional import, and then give error: [Errno 35] Resource temporarily unavailable and exit immediately. The number of unconditional import lines that terminate before an error occurs changes. The longest run so far has been observed at startup immediately after a reboot. I tried working with and without deleting previous build / dist files without any effects.

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

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'], ) 

and the import section of my python FlowMac.py file 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 

Commenting on both FlowCytometryTools and pylab import allows you to build py2app, but, of course, makes the program non-functional.

  • What's happening?
  • How to get additional information about which resource is unavailable?
    • hit the recursion limit is the key to my problem?

I run Yosemite on a MacBook Pro with 8 GB of RAM, so I am very surprised to click on the wall here. Thank you for your time.

UPDATE 04/29/2015: Import everything works fine if I remove my .xib from the datafiles array of the py2app setup.py pool. An empty Cocoa, Foundation, and Appkit import file works fine. Importing xib with any of FlowCytometryTools, pylab, scipy, matplotlib, numpy does not work. pylab and FlowCytometryTools rely on the other three, and either of scipy, matplotlib or numpy brings py2app recipes for the other two. One of these recipes does not work with xib, but I do not know why ...

+1
source share
2 answers

There is no experience with py2app, but I am wondering if you are trying to create a more minimal version of the code that would not help fix the problems?

Perhaps if FlowMac.py contains nothing but import statements:

 import Cocoa import Foundation import AppKit import FlowCytometryTools import pylab 

Also could you narrow it down to a problem due to pylab or FlowCytometryTools? (Commenting them out separately?)

0
source

From my testing, this error is apparently caused by the log exit itself from py2app. Try redirecting the standard error to a file:

 python setup.py py2app 2>error_log 

This should work with an error.

0
source

Source: https://habr.com/ru/post/981980/


All Articles