473,287 Members | 1,582 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,287 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 4324
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
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.