[IPython-dev] Problems with physics profile

Duane Kaufman dkaufman@imago....
Wed Apr 11 12:40:31 CDT 2007


Hi,

I am trying to get the Physics profile working under Windows, but I get
an error when starting (see below).
I am running Ipython 0.8.0 and Scientific 2.6. Any hints as to what to
look into?

Thanks,
Duane

Error Follows:


C:\Console2>C:\Python24\python.exe C:\Python24\scripts\ipython-script.py
-pylab
-p physics
*** Simplified input for physical quantities enabled.
------------------------------------------------------------------------
---
exceptions.TypeError                                 Traceback (most
recent call
 last)

C:\Console2\<string>

c:\python24\lib\site-packages\ipython-0.8.0-py2.4.egg\IPython\Extensions
\Physica
lQInteractive.py
     20 __license__ = Release.license
     21
---> 22 from Scientific.Physics.PhysicalQuantities import
PhysicalQuantity
     23
     24 # This code can be set up to work with Numeric or with math for
providin
g the

c:\python24\lib\site-packages\ScientificPython-2.6-py2.4-win32.egg\Scien
tific\Ph
ysics\PhysicalQuantities.py
    591
    592 _addUnit('Hz', '1/s')                # Hertz
--> 593 _addUnit('N', 'm*kg/s**2')           # Newton
    594 _addUnit('Pa', 'N/m**2')             # Pascal
    595 _addUnit('J', 'N*m')                 # Joule

c:\python24\lib\site-packages\ScientificPython-2.6-py2.4-win32.egg\Scien
tific\Ph
ysics\PhysicalQuantities.py in _addUnit(name, unit)
    573         raise KeyError('Unit ' + name + ' already defined')
    574     if type(unit) == type(''):
--> 575         unit = eval(unit, _unit_table)
    576         for cruft in ['__builtins__', '__args__']:
    577             try: del _unit_table[cruft]

C:\Console2\<string>

c:\python24\lib\site-packages\ScientificPython-2.6-py2.4-win32.egg\Scien
tific\Ph
ysics\PhysicalQuantities.py in __pow__(self, other)
    367             raise TypeError("cannot exponentiate units with
non-zero off
set")
    368         if type(other) == type(0):
--> 369             return PhysicalUnit(other*self.names,
pow(self.factor, other
),
    370                                 map(lambda x,p=other: x*p,
self.powers))

    371         if type(other) == type(0.):

TypeError: unsupported operand type(s) for *: 'int' and 'NumberDict'
WARNING: Loading of IPython.Extensions.PhysicalQInteractive failed.

------------------------------------------------------------------------
---
exceptions.NameError                                 Traceback (most
recent call
 last)

C:\Console2\<string>

NameError: name 'PhysicalQuantityInteractive' is not defined
WARNING: Failure executing code: 'q = PhysicalQuantityInteractive'
------------------------------------------------------------------------
---
exceptions.NameError                                 Traceback (most
recent call
 last)

C:\Console2\<string>

NameError: name 'PhysicalQuantityInteractive' is not defined
WARNING: Failure executing code: "g = PhysicalQuantityInteractive('9.8
m/s**2')"

*** q is an alias for PhysicalQuantityInteractive
*** g = 9.8 m/s^2 has been defined
*** rad = pi/180  has been defined
Python 2.4.4 (#71, Oct 18 2006, 08:34:43) [MSC v.1310 32 bit (Intel)]
Type "copyright", "credits" or "license" for more information.

IPython 0.8.0 -- An enhanced Interactive Python.
?       -> Introduction to IPython's features.
%magic  -> Information about IPython's 'magic' % functions.
help    -> Python's own help system.
object? -> Details about 'object'. ?object also works, ?? prints more.

IPython profile: physics

  Welcome to pylab, a matplotlib-based Python environment.
  For more information, type 'help(pylab)'.

NOTICE: This e-mail communication may contain privileged or other confidential information for the sole use of the designated recipients. If you have received it in error, please advise the sender by reply email and immediately delete the message and any attachments without reviewing, copying or disclosing the contents.



More information about the IPython-dev mailing list