Numpy package does not work with morepy

Bug #1148559 reported by Craig Macomber
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Panda3D
Won't Fix
Undecided
Unassigned

Bug Description

With panda 1.8.0 on mac OSX 10.6 and Windows 7, the "numpy" package does not work if also using "morepy". I have not tried any other setups. The runtime downloads it, but "import numpy" at runtime produces:

  File "VFSImporter", line 446, in load_module
ImportError

The traceback continues up into my code to the line that calls "import numpy".

Side note: Thats not very detailed for an ImportError. I think the nice description is getting lost somewhere.
Side note 2: When you remove morepy so this demo runs, the runtime locks the CPU at 100% use instead of exiting, which is a pain on windows since the process does not show in the task bar, you need to kill it with the tack manager.

Trivial example:
main.py:

import numpy

n.pdef:

class n(p3d):
    require('numpy','morepy') # Remove morepy to fix
    mainModule('main')

Output (Mac):

CraigsBook:numpyTest craigmacomber$ ppackage n.pdef
:AppRunner: Total Panda3D disk space used: 397 MB
:AppRunner: Configured max usage is: 2048 MB
:Packager: Reading n.pdef
Generating n.p3d
CraigsBook:numpyTest craigmacomber$ panda3d n.p3d
:AppRunner: Total Panda3D disk space used: 397 MB
:AppRunner: Configured max usage is: 2048 MB
Traceback (most recent call last):
  File "/Users/buildbot/slave/release_rtdist_osx/build/panda3d/built_cmu/direct/showbase/Messenger.py", line 424, in __taskChainDispatch
  File "/Users/buildbot/slave/release_rtdist_osx/build/panda3d/built_cmu/direct/showbase/Messenger.py", line 482, in __dispatch
  File "/Users/buildbot/slave/release_rtdist_osx/build/panda3d/built_cmu/direct/p3d/AppRunner.py", line 748, in __startIfReady
  File "VFSImporter", line 153, in load_module
  File "/Users/craigmacomber/Documents/Panda3D/numpyTest/main.py", line 1, in <module>
    import numpy
  File "VFSImporter", line 446, in load_module
ImportError
:task(error): Exception occurred in PythonTask Messenger-default
Traceback (most recent call last):
  File "/Users/buildbot/slave/release_rtdist_osx/build/panda3d/built_cmu/direct/p3d/AppRunner.py", line 638, in run
  File "/Users/buildbot/slave/release_rtdist_osx/build/panda3d/built_cmu/direct/task/Task.py", line 502, in run
  File "/Users/buildbot/slave/release_rtdist_osx/build/panda3d/built_cmu/direct/task/Task.py", line 460, in step
  File "/Users/buildbot/slave/release_rtdist_osx/build/panda3d/built_cmu/direct/showbase/Messenger.py", line 424, in __taskChainDispatch
  File "/Users/buildbot/slave/release_rtdist_osx/build/panda3d/built_cmu/direct/showbase/Messenger.py", line 482, in __dispatch
  File "/Users/buildbot/slave/release_rtdist_osx/build/panda3d/built_cmu/direct/p3d/AppRunner.py", line 748, in __startIfReady
  File "VFSImporter", line 153, in load_module
  File "/Users/craigmacomber/Documents/Panda3D/numpyTest/main.py", line 1, in <module>
    import numpy
  File "VFSImporter", line 446, in load_module
ImportError
Successfully joined thread: 0
Failure on startup.

Tags: packaging
Revision history for this message
Craig Macomber (craigm) wrote :

This is caused by:

import unittest

If the "morepy" package is used.

In Numpy,
from unittest import TestCase
causes the issue, which is in: numpy/testing/__init__.py
Removing that import fixes the issue.

Also, numpy should be marked to depend on morepy, since it uses shutil (though only in one place)

Moguri (mogurijin)
tags: added: packaging
Revision history for this message
rdb (rdb) wrote :

packp3d is no longer supported in 1.10 (in favour of the new setuptools-based deployment system), so I'm closing this. Please file an issue on GitHub if the issue still persists with deploy-ng.

Changed in panda3d:
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.