Hey,
So I’ve downloaded .whl files for scipy and numpy+mkl from http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy
I extracted the source after installation and created panda3d packages for each. I then create a dummy program that calls a scipy routine. I use ppackage to build and it builds just fine, but with some warnings about how it can’t add certain python files. The dummy program runs fine when it doesn’t use numpy / scipy, but gives this exact same error when I incorporate either numpy, scipy, or both:
:PackageInfo: Package panda3d uses 104 MB
:PackageInfo: Package morepy uses 16 MB
Traceback (most recent call last):
File "C:\buildslave\rtdist-windows-i386\build\built\direct\p3d\AppRunner.py", line 844, in addPackageInfo
File "C:\buildslave\rtdist-windows-i386\build\built\direct\p3d\PackageInfo.py", line 1135, in installPackage
File "VFSImporter", line 523, in reloadSharedPackages
File "VFSImporter", line 498, in reloadSharedPackage
File "VFSImporter", line 435, in load_module
AttributeError: 'module' object has no attribute '__path__'
My dummy python file (front.py):
import sys
sys.path.insert(0,'.\\')
def main():
from scipy.interpolate.interpolate import interp2d
import numpy as np
x = np.arange(-5.01, 5.01, 0.25)
y = np.arange(-5.01, 5.01, 0.25)
xx, yy = np.meshgrid(x, y)
z = np.sin(xx**2+yy**2)
f = interp2d(x, y, z, kind='cubic')
print "Finished!"
if __name__ == '__main__':
sys.exit(main())
My .pdef file:
import sys
sys.path.insert(0,'')
sys.path.insert(0,'src')
packager.setHost('file:///C:/Users/<path>/<to>/<my>/<Packages>/')
class numpy(package):
module('numpy')
module('numpy.*')
module('numpy.*.*')
dir('src/numpy',newDir='numpy')
class scipy(package):
require('numpy', host='file:///C:/Users/<path>/<to>/<packages>/')
module('scipy')
module('scipy.*')
module('scipy.*.*')
dir('src/scipy',newDir='scipy')
class TestP3D(p3d):
require('morepy','panda3d') # include some other packages
require('scipy', host='file:///C:/Users/<path>/<to>/<packages>/')
require('numpy', host='file:///C:/Users/<path>/<to>/<packages>/')
config(
version="0.0",
display_name="TestP3D")
main('front.py')
I call
ppython build.py build
My build.py file is:
import subprocess
import sys
p=sys.argv[1]
destDir='.\\'
pdef='all.pdef'
ppython="ppython"
if p == "build":
ppackage="C:\\Panda3D-1.9.4\\direct\\p3d\\ppackage.py"
args=[ppython, ppackage, "-i",destDir,pdef]
p = subprocess.Popen(args).communicate(input=None)