473,695 Members | 1,941 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.p y", 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 16375
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.p y", 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
6297
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*) LD_LIBRARY_PATH=/net/ia64/lavasani/Python-2.3:/usr/local/lib/hpux32:/usr/local/lib CC='gcc' LDSHARED='gcc -shared' OPT='-DNDEBUG -g -O3 -Wall -Wstrict-prototypes' ./python -E ./setup.py -q build;; \
11
7355
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
4380
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: "PythonHandler edit::handler" Traceback (most recent call last):
8
2332
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: 18,446,744,073,709,551,616 I'm lazy... I don't want to convert it manually :)
17
2159
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 Before I did not know what to expect, but I certainly didn't expect
5
13534
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 problems using arithmetic, but when I try to upgrade the programs using math libraries nothing seems to work. I downloaded a 2002 tutorial from Zelle "An Introduction to Computer Science" where he uses a "import math" statement to calculate a square...
5
4388
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> OverflowError: math range error 10000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000
0
1947
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 math, mmap and readline modules, that worked fine before, cannot be built anymore.
0
1811
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 at the ticket, you seem to have resolved all this already :-)
0
8625
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9113
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8841
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8822
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7658
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6488
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5838
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4339
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2269
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.