472,371 Members | 1,609 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Error Message "ImportError: No module named *****"

Although I have been using Macs for a quarter of a century and was doing scientific programming in the '60's I am VERY new to Python on the Mac. I have been writing some very simple applications and running them using IDLE.

To start with the applications worked OK. However, as time has progressed, the error message "ImportError: No module named ****" has been generated with increasing frequency.

It has now become impossible to use Python effectively. For example, I create a small file called MiniLibrary.py and save it to the desktop. I type at the >>> prompt, in the terminal window import MiniLibrary.

At one time this would have generated a new file MiniLibrary.pyc on the desktop and returned a new prompt >>>. No longer. Now the error message "ImportError: No module named MiniLibrary".

Further information: I am running Python 2.5.1. The computer is a Dual G5 Power PC running OSX 10.4.10. Can anyone help? I am at my wits end and quietly contemplating giving up all attempts at scientific programming on a Mac.
Nov 2 '07 #1
1 4127
bartonc
6,596 Expert 4TB
Good morning, Prof.

What you need to understand is that there are certain places that Python looks for modules to import: the entire disk is not searched. The key to your problem is having the interpreter start up in the "current working directory" - the directory where you are working on your script.

I'm not a Mac guy, but it sounds like you, at one time, where able to make your "desktop" look like the current working directory when Python was started.

The trick is to let IDLE handle all of this stuff in the beginning.
  1. Edit and save files - someplace better than the desktop
  2. Use the Run menu:Run module command to run your script
  3. Leave importing at the >>> prompt for much later

Hope that helps.
Nov 2 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Sebastian Stelzer | last post by:
Hi, I'am a beginner in Python and I have got a problem with the TKInter module. When I want to start e.g. pysol, I get following output: Traceback (most recent call last): File...
12
by: Georg Brandl | last post by:
Hello, in follow-up to the recent "dictionary accumulator" thread, I wrote a little module with several subclassed dicts. Comments (e.g. makes it sense to use super), corrections, etc.? Is...
0
by: Bill Davy | last post by:
Hello, I am using SWIG-1.3.24 to make an extension (called SHIP) to Python2.4.1 and then running under IDLE (if that makes any difference) but when I "import SHIP" I get: >>> import SHIP ...
0
by: Neal | last post by:
Hi I am trying to use a 3rd party DLL in my app, (WebService and/or WebApp) I set the references to it, use its public functions and properties OK in Dev mode but when I run it, i get the...
5
by: Bob | last post by:
Are they different names for the same concept ?
0
by: Terry Tang | last post by:
Hi There, We are extending Python interpreter to support special functions of our tools. What we did is to compile Python's source code (which is got from the an installation on a Linux...
4
by: Daniel | last post by:
Hello, I'm trying to build a very simple IPC system. What I have done is create Data Transfer Objects (DTO) for each item I'd like to send across the wire. I am serializing these using...
0
by: John [H2O] | last post by:
Hello, I have a module created from a Fortran file to read in unformatted binary fortran output. It works fine for some datasets, but crashes with others. The strange thing is it will loop...
0
by: John [H2O] | last post by:
I can try, would you mind giving very brief instructions on how to 'run it under gdb'... thanks! I'll post results over at numpy-discussions. Robert Kern-2 wrote: -- View this message in...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...

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.