473,399 Members | 2,478 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,399 software developers and data experts.

missing collections module

Hi Experts,
I've installed python 2.4 and importing the module 'collections' in one of my script and the "No module named collections" message is displayed in command prompt.
I've read a thread with same topic(http://bytes.com/topic/python/answers/559775-missing-collections-module), where the suggestion was to upgrade the python version to 2.4 or 2.5.
But here i'm already in version 2.4, also i made a search for 'collections' on the directory, where python was installed, but nothing found.
Please can you suggest at the earliest.

Thanks,
Arun
Jan 25 '10 #1
5 1197
bvdet
2,851 Expert Mod 2GB
The collections module is new to Python 2.4 and should be found in the Lib subdirectory. I run Python 2.6 on my laptop, and it imports without problem.

BV
Jan 25 '10 #2
Hi BV,
Thanks for the response. I searched for 'collections.py' file in the whole directory where python was installed(including 'Python\Lib'), but search result is zero.

Thanks,
Arun
Jan 25 '10 #3
Glenton
391 Expert 256MB
Hi. I'm using python 2.6 on Ubuntu and also am able to import collections without any problem.

Where did you install from? What system are you using?
Jan 27 '10 #4
Hi Glenton,
I'm using python 2.4 on windows. The 'collections' module should be available from version 2.4, but it's missing.
-Arun
Jan 27 '10 #5
Glenton
391 Expert 256MB
Okay, forgive my skepticism. Do you have more than one version installed? Are you running Idle or what?

In the python prompt, try this:
Expand|Select|Wrap|Line Numbers
  1. import platform
  2. platform.python_version()
  3.  
Often what happens is that people have several versions on their machine, and the command to run a script uses a different version from the command prompt. This is a weird subtlety that sometimes trips people up.

For example most python commands from an IDE just specify python, and there'll be some environmental variable that converts python into python2.x or whatever.

Anyway, let us know what you get from the above command, and we'll see if that's the issue...
Jan 27 '10 #6

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

Similar topics

12
by: John Burton | last post by:
One of the reasons I like python so much is that the standard installation comes with a whole lot of libraries to do lots of useful things but there seem to be a few things missing from the...
2
by: njp | last post by:
BlankHi, How do I create a tightly coupled Object 1 such that when I update it in one collection, it is simultaneously and automatically updated in other collections? The collections are defined...
0
by: Gavin | last post by:
I am using collections in my project and have come up against some issues. My project is a web based thin client application. The main issue I have is with collections, I have all the users...
3
by: David Davidson | last post by:
I'm just wondering if anybody's seen a problem with their web server recently that's similar to the following: about two weeks ago some clients on our intranet started experiencing lost sessions -...
5
by: Philip Wagenaar | last post by:
I have a Windows Form application that monitors a directory using the System.IO.FileSystemWatcher. On the event created I run a sub that sends an xml file over http to a service. When I copy...
1
by: Shea Martin | last post by:
I am getting this error in a python script: File "/usr/sfw/lib/python2.3/site-packages/BTL/cache.py", line 12, in ? from collections import deque ImportError: No module named collections ...
25
by: Alex Popescu | last post by:
Hi all! I am pretty sure this has been asked a couple of times, but I don't seem to find it on the archives (Google seems to have a couple of problems lately). I am wondering what is the most...
4
by: Sid Price | last post by:
Hello, I have a class of objects (Device) that are managed by another object (Devices) with a collection class (DeviceCollection) inherited from Collections.Hashtable. Each of the Device objects...
3
by: fizilla | last post by:
Hello all! I have the following weird problem and since I am new to Python I somehow cannot figure out an elegant solution. The problem reduces to the following question: How to pickle a...
0
by: bearophileHUGS | last post by:
Several languages like Java, C# etc have a List type in the std lib. Python has a built-in list(), it's implemented as array dynamic on the right. Not too much time ago Hettinger has added a...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...
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
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,...

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.