473,385 Members | 1,772 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

No math module??


I have been trying to run a python program and I get the following
error:
Traceback (most recent call last):
File "<string>", line 39, in ?
File "/home/Larry/.blender/scripts/bzflag/__init__.py", line 22, in ?
import BZfileRead
File "/home/Larry/.blender/scripts/bzflag/BZfileRead.py", line 24, in ?
import BZsceneWriter
File "/home/Larry/.blender/scripts/bzflag/BZsceneWriter.py", line 25, in ?
import BZcommon
File "/home/Larry/.blender/scripts/bzflag/BZcommon.py", line 24, in ?
import math
ImportError: No module named math

So just to check and make sure I tried to import the math module
and sure enough there isn't one. This whole program has calls to
the "math" module all the way through it.

I have been using python on my computer since it first came out and
this is the first time I have runinto this. I have Python 2.3.2
installed on Slackware Linux. I installed it from source download
from the Python.org web site.

I have looked all over for a math module but can't find one.
Maybe not looking in the right place???

So what's up?? :)

thanks
May 23 '06 #1
5 16349
WIdgeteye <No**@none.none> writes:
ImportError: No module named math
[...]
I have been using python on my computer since it first came out and
this is the first time I have runinto this. I have Python 2.3.2
installed on Slackware Linux. I installed it from source download
from the Python.org web site.


It definitely should be part of the default Python install. On my
Debian system:

=====
$ python
Python 2.3.5 (#2, Sep 4 2005, 22:01:42)
[GCC 3.3.5 (Debian 1:3.3.5-13)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
import math
repr(math) "<module 'math' from '/usr/lib/python2.3/lib-dynload/math.so'>"


$ dpkg -S /usr/lib/python2.3/lib-dynload/math.so
python2.3: /usr/lib/python2.3/lib-dynload/math.so
=====

Perhaps you should use the official Python package for your operating
system, or double-check you built and installed the source packages
the way you want them.

--
\ "My doctor told me to stop having intimate dinners for four. |
`\ Unless there are three other people." -- Orson Welles |
_o__) |
Ben Finney

May 23 '06 #2
On Tue, 23 May 2006 12:40:49 +1000, Ben Finney wrote:

Ok this is weird. I checked:
/usr/local/lib/python2.3/lib-dynload/math.so

Just as you have on your system and it's there.
So why in the heck isn't it loading with:
import math ????

This is strange.
WIdgeteye <No**@none.none> writes:

[quoted text muted]


It definitely should be part of the default Python install. On my Debian
system:

=====
$ python
Python 2.3.5 (#2, Sep 4 2005, 22:01:42) [GCC 3.3.5 (Debian 1:3.3.5-13)]
on linux2 Type "help", "copyright", "credits" or "license" for more
information.
[quoted text muted]

"<module 'math' from '/usr/lib/python2.3/lib-dynload/math.so'>"
[quoted text muted]

$ dpkg -S /usr/lib/python2.3/lib-dynload/math.so python2.3:
/usr/lib/python2.3/lib-dynload/math.so =====

Perhaps you should use the official Python package for your operating
system, or double-check you built and installed the source packages the
way you want them.


May 23 '06 #3
WIdgeteye wrote:
I have been trying to run a python program and I get the following
error:
Traceback (most recent call last):
Fil e "<string>", line 39, in ?
That doesn't look like a python program, File "<string>" means it's an
embedded script. When a script is embedded it is responsibility of the
caller (blender application) to setup correct path to modules.
File "/home/Larry/.blender/scripts/bzflag/__init__.py", line 22, in ?
import BZfileRead
File "/home/Larry/.blender/scripts/bzflag/BZfileRead.py", line 24, in ?
import BZsceneWriter
File "/home/Larry/.blender/scripts/bzflag/BZsceneWriter.py", line 25, in ?
import BZcommon
File "/home/Larry/.blender/scripts/bzflag/BZcommon.py", line 24, in ?
import math
ImportError: No module named math

[snip]
So what's up?? :)


Try to insert
==============
import sys
print sys.path, sys.version, sys.executable
==============
right before the failing "import math". The next step is most likely to
RTFM how to properly setup python embedded into blender. If everything
looks as described in the manual, it's a bug in blender.

May 23 '06 #4
WIdgeteye <No**@none.none> wrote:

On Tue, 23 May 2006 12:40:49 +1000, Ben Finney wrote:

Ok this is weird. I checked:
/usr/local/lib/python2.3/lib-dynload/math.so

Just as you have on your system and it's there.
So why in the heck isn't it loading with:
import math ????

This is strange.


Is the Python that you are running actually 2.3? Some Linux systems have
both Python 1 and a Python 2 installed. Typing "python" at a command line
often gets Python 1, because the vendor's configuration scripts assume
that.

However, that doesn't answer the question, because even Python 1.5 should
have a module called "math".
--
- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
May 24 '06 #5
Tim Roberts wrote:
WIdgeteye <No**@none.none> wrote:

On Tue, 23 May 2006 12:40:49 +1000, Ben Finney wrote:

Ok this is weird. I checked:
/usr/local/lib/python2.3/lib-dynload/math.so

Just as you have on your system and it's there.
So why in the heck isn't it loading with:
import math ????

This is strange.


Is the Python that you are running actually 2.3? Some Linux systems have
both Python 1 and a Python 2 installed. Typing "python" at a command line
often gets Python 1, because the vendor's configuration scripts assume
that.


Maybe he's running a UK-based distro which has
renamed the math module to maths? (I have to work
really hard to remember *not* to put the "s" on the
end when I import it!

;-)

TJG

May 24 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: M. Lavasani | last post by:
Hi I am trying to test Python-2.3. Any solution for this problem please: >>>gmake test case $MAKEFLAGS in \ *-s*)...
11
by: Sambo | last post by:
I have the following module: ------------------------------- import math def ac_add_a_ph( amp1, ph1, amp2, ph2 ): amp3 = 0.0 ph3 = 0.0 ac1 = ( 0, 0j ) ac2 = ( 0, 0j )
0
by: çÌÏÔÏ× áÒÔÅÍ | last post by:
Hello! I'm trying to install the web application written with Python, and have the trouble with module math.so: # lwp-request http://localhost/site/code/edit.py Mod_python error:...
8
by: brad | last post by:
How does one make the math module spit out actual values without using engineer or scientific notation? I get this from <code>print math.pow(2,64)</code>: 1.84467440737e+19 I want this:...
17
by: Albert Hopkins | last post by:
This issue may have been referred to in news:<mailman.1864.1196703799.13605.python-list@python.orgbut I didn't entirely understand the explanation. Basically I have this: 6.0 nan 6.0 nan ...
5
by: aguirre.adolfo | last post by:
Hi, I am a very newbie who would very much appreciate some hints. Python 2.52. on Windows XP for now. Soon on Ubuntu 8 I am teaching myself Python following free tutorials. I can solve...
5
by: Tzury Bar Yochay | last post by:
What is the reason math.pow yields OverflowError while python itself can calculate these large numbers. e.g: 1e+308 Traceback (most recent call last): File "<stdin>", line 1, in <module>...
0
by: Akira Kitada | last post by:
Hi Marc-Andre, Thanks for the suggestion. I opened a ticket for this issue: http://bugs.python.org/issue4204 Now I understand the state of the multiprocessing module, but it's too bad to see...
0
by: M.-A. Lemburg | last post by:
On 2008-10-25 20:19, Akira Kitada wrote: Thanks. The errors you are getting appear to be related to either some missing header files or a missing symbol definition to enable these - looking...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.