importerror

Testing for ImportErrors in Python

We're having a real problem with people checking in code that doesn't work because something's been refactored. Admittedly, this is partly because our developers don't really have any good tools for finding these kinds of mistakes easily. Are there any tools to help find ImportErrors in Python? Of course, the correct answer here is "y...

Why does import of ctypes raise ImportError?

Python 2.6.2 (r262:71605, Apr 14 2009, 22:40:02) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import ctypes Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Python26\lib\ctypes\__init__.py", line 17, in <module> from struct import ca...

unable to import libxml2mod from the python script

File "/usr/local/lib/python2.5/site-packages/libxml2.py", line 1, in <module> import libxml2mod ImportError: /usr/local/lib/python2.5/site-packages/libxml2mod.so: undefined symbol:xmlTextReaderSetup >>> import libxml2mod >>> import libxml2 >>> on Python Prompt it works fine !! can anyone has idea why my program is not wor...

Miscellaneous import errors with Djapian

After installing Djapian ten different ways and following 5 completely different tutorials, it's time to ask for help. Ok, the vanilla way: I go to http://code.google.com/p/djapian/wiki/Installation and follow the instructions to a tee, installing Djapian 2.0. joshua@staging-server:/var/www$ python pri*/pro*/my*/manage.py shell Python ...

ImportError: No module named smb

PySamba is a Python library that provides a full wrapper for the Samba CLI library provided with samba-3.0.24. It includes a Python module that hides the complexity of the lower layer (SMB), providing high-level commands like Mkdir or DiskAvail. PySamba allows the developer to interface to any samba-capable device much like Python's ftpl...

Jython 2.5.1, Eclipse & os.path

I have imported the Jython2.5.1 standalone jar into my build path in Eclipse. Whenever I run any Jython code from within Eclipse, that uses the os.path module, the app barfs: 'Execution failed. Traceback (most recent call last): File "<string>", line 1, in <module> File "../lib/python/threading.py", line 6, in <module> import traceb...

How do I distinguish "module not found" from "module threw exception" on ImportError?

In Python, import does_not_exist raises ImportError, and import exists exists.py: import does_not_exist will also raise ImportError. How should I tell the difference in code? ...

Accessing py2exe program over network in Windows 98 throws ImportErrors

I'm running a py2exe-compiled python program from one server machine on a number of client machines (mapped to a network drive on every machine, say W:). For Windows XP and later machines, have so far had zero problems with Python picking up W:\python23.dll (yes, I'm using Python 2.3.5 for W98 compatibility and all that). It will then ...

ImportError: cannot import name NumpyTest

I am trying to read a *.wav file using scipy. I do it in the following way: import scipy.io x = scipy.io.wavfile.read('/usr/share/sounds/purple/receive.wav') As a result I get the following error message: Traceback (most recent call last): File "test3.py", line 1, in <module> import scipy.io File "/usr/lib/python2.5/site-pack...

PyQt 4.7 - ImportError after installing on Windows.

I've been trying to install PyQt 4.7 on Vista, but I am getting an ImportError when I try to do: from PyQt4 import QtCore, QtGui. ImportError: DLL load failed: The specified module could not be found. I've checked my System Path, and C:\Python31\Lib\site-packages\PyQt4\bin is on there. I can't run any of the examples, but the Des...

Works using Django development server, but throws import error with Apache using mod_wsgi

I have a Django project that works fine with the development server that comes with it. No errors are produced at all when I use "django manage.py runserver" and the app works fine, but when I try to use it with mod_wsgi and Apache the browser displays "Internal Server Error" with a 500 error code and it generates an import error in t...

Python setuptools import error (Using NetBeans)

Hi, I tried to find a question that would answer to this question but wasn't succesful, so I made a new question. I'm trying to compile my old Python Tic Tac Toe game in NetBeans, but I get the error message ImportError: No module named setuptools In my actual code I haven't imported a module named setuptools. As much as I understan...

python ImportError: No module named primes

hey all, im really new to python, im trying to import a third party module called primes.py, i have placed this module C:\Python26\Lib ( the location where i installed python) i then have another file which is trying to import this module, this file is located at C:\Python26 in my python file i have the following two lines import prime...

Django + Virtualenv: manage.py commands fail with ImportError of project name.

This is blowing my mind because it's probably an easy solution, but I can't figure out what could be causing this. So I have a new dev box and am setting everything up. I installed virtualenv, created a new environment for my project under ~/.virtualenvs/projectname Then, I cloned my project from github into my projects directory. Noth...

Python: ImportError no module named urllib

I just rented a VPS from Linode, it has python2.5 and ubuntu 8.04 When I ho to python shell python import urllib I get ImportError: No module named urllib What can be the reason? How can I add this module to python? Isn't it prepackaged with the basic version? Can it be pythonpath problem? How I can test pythonpath? ...

ImportError and Django driving me crazy

OK, I have the following directory structure (it's a django project): -> project --> app and within the app folder, there is a scraper.py file which needs to reference a class defined within models.py I'm trying to do the following: import urllib2 import os import sys import time import datetime import re import BeautifulSoup sys...

New at Python: GLPK not building properly / Python ImportError

This is a beginner question, and a follow-up to this one, where I was pointed to GLPK. I'm trying to get PyGLPK, a Python binding for the GNU Linear Programming Kit up and running, but no matter what I do, I can't seem to build and install GLPK so that Python finds it correctly. This comes after running ./configure, make, and sudo make...

Problem trying to install PyCurl on Mac Snow Leopard

Hi, My app needs to use PyCurl, so i tried to install it on my Mac but i found a lot of problems and error :( Requirement: First of all i've to say that the version of Python working on my Mac is 32 bit based, because i need to use WxPython, that needs 32 bit Python. For doing this i used: defaults write com.apple.versioner.python Pre...

Python - problem in importing new module - libgmail

Hi all, I downloaded Python module libgmail from sourceforge and extracted all the files in the archive. The archive had setup.py, so I went to that directory in command prompt and did setup.py install I am getting the following error message I:\libgmail-0.1.11>setup.py install Traceback (most recent call last): File "I:\libgmail...

python: importing modules with incorrect import statements => unexhaustive info from resulting ImportError

Hi there, I have a funny problem I'd like to ask you guys ('n gals) about. I'm importing some module A that is importing some non-existent module B. Of course this will result in an ImportError. This is what A.py looks like import B Now let's import A >>> import A Traceback (most recent call last): File "<stdin>", line 1, in <modu...