473,692 Members | 2,089 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error Message "ImportErro r: No module named *****"

1 New Member
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 "ImportErro r: 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 "ImportErro r: 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 4348
6,596 Recognized Expert Expert
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

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 "/usr/share/games/pysol/src/pysol.py", line 47, in ? from main import main File "/usr/share/games/pysol/src/main.py", line 48, in ?
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 this PEP material? Docstrings, Documentation and test cases are to be provided later.
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 Traceback (most recent call last): File "<pyshell#0>", line 1, in -toplevel-
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 error "Module not found", on the initial line of instantiation of it. Anybody..?
by: Bob | last post by:
Are they different names for the same concept ?
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 environment for Python 2.3.3) and our extensions (C++ code) on Windows with Microsoft Visual C++ 6.0 compiler to generate the extended Python interpreter. It works well on Linux and for the basic Python modules and our special modules on Windows. But...
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 cPickle. I've also tried using pickle (instead of cPickle), but I get the same response. Below is the code. I'll put the rest of my comments after the code
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 through several files before it crashes, then suddently giving me this output: *** glibc detected *** python: munmap_chunk(): invalid pointer: 0xb34ac008 *** ======= Backtrace: =========
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 context: http://www.nabble.com/f2py-Error---module-crashes-after-several-iterations...-tp20128015p20131768.html
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...
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...
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
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,...
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...
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...
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();...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.