Comments you submit will be routed for moderation. If you have an account, please log in first.
Modify

Ticket #363 (new defect)

Opened 2 years ago

Last modified 14 months ago

PyInstaller fails to import module created using F2PY (Mac OSX 10.6, Python2.7)

Reported by: escheu2 Owned by: matysek
Priority: high Milestone:
Component: PyInstaller Version: 1.5
Severity: blocker Keywords: MacOSX10.6, PyQt4, F2PY, NumPy
Cc:

Description

I'm trying to bundle a PyQt4 gui script into a standalone app using PyInstaller?. So far, I've had good success in creating these standalone apps but just recently found a problem when trying to import modules created uisng SciPy?'s f2py (Fortran --> Python)...

The idea is to connect a gui button click to the execution of compiled Fortran code all wrapped up using Python and PyInstaller?...

PyInstaller? seems to build everything without error, but the app will not launch. The Traceback following failure to launch the app is:

ImportError?: numpy.core.multiarray failed to import

Traceback (most recent call last):

File "<string>", line 3, in <module> File "/Users/Edward?/pyinstaller/iu.py", line 436, in importHook

mod = _self_doimport(nm, ctx, fqname)

File "/Users/Edward?/pyinstaller/iu.py", line 505, in doimport

mod = director.getmod(nm)

File "/Users/Edward?/pyinstaller/iu.py", line 297, in getmod

mod = owner.getmod(nm)

File "/Users/Edward?/pyinstaller/iu.py", line 109, in getmod

mod = imp.load_module(nm, fp, attempt, (ext, mode, typ))

ImportError?: numpy.core.multiarray failed to import ([0x0-0x13c13c].Mactestgui[2902]): Exited with exit code: 255

Any ideas would be helpful.

Attachments

Change History

comment:1 Changed 22 months ago by matysek

  • Milestone set to PyInstaller 1.5.1

Could you please try svn version?

comment:2 Changed 22 months ago by matysek

  • Milestone changed from PyInstaller 1.5.1 to PyInstaller 1.5.2

This seems to require more work. Moving to another milestone.

comment:3 Changed 20 months ago by anonymous

Maybe a stupid suggestion, but if you import numpy module in your python main program, it may resolve your problem no ? I wrote a basic program python calling a f2py module and create an exe from that.

Python code


import testf2py
a=1
b=4
output=testf2py.main(a,b)

Fortran_code


subroutine main(a,b)
implicit none
integer a
integer b
integer i
i=0
do i=a,b

write(*,*),i

end do
end subroutine

Firstly, i had the following error : Traceback (most recent call last):

File "C:\Python26\pyinstaller-1.5\iu.py", line 455, in importHook

raise ImportError?, "No module named %s" % fqname

ImportError?: No module named numpy Traceback (most recent call last):

File "<string>", line 1, in <module> File "C:\Python26\pyinstaller-1.5\iu.py", line 436, in importHook

mod = _self_doimport(nm, ctx, fqname)

File "C:\Python26\pyinstaller-1.5\iu.py", line 505, in doimport

mod = director.getmod(nm)

File "C:\Python26\pyinstaller-1.5\iu.py", line 297, in getmod

mod = owner.getmod(nm)

File "C:\Python26\pyinstaller-1.5\iu.py", line 109, in getmod

mod = imp.load_module(nm, fp, attempt, (ext, mode, typ))

ImportError?: numpy.core.multiarray failed to import

So i wrote 'import numpy' in my main python code and it finally works. Maybe that can help you.

comment:4 Changed 14 months ago by matysek

  • Milestone PyInstaller 1.5.2 deleted
View

Add a comment

Modify Ticket

Action
as new
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.