473,750 Members | 2,213 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ImportError with packages

I'm running into import problems trying to create a
package that is similiar in layout to the one in the
docs described here:

http://www.boost.org/libs/python/doc...ating_packages

So my package layout is as follows:

xyzzy/
__init__.py
research/
__init__.py
_research.so
stats.pyc

My __init__.py file contains 2 lines:

from stats import *
from _research import *

With the directory containing 'xyzzy' on my
PYTHONPATH, the following occurs:

Python 2.4.2 (#2, Nov 3 2005, 11:35:03)
[GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-52)] on linux2
Type "help", "copyright" , "credits" or "license" for more
information.
import xyzzy.research Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "xyzzy/research/__init__.py", line 2, in ?
from _research import *
ImportError: No module named _research

Running python with the -vv switch shows python does
indeed look at _research.so but does not load it.

However if I put the directory containing _research.so
on my PYTHONPATH the following command is successful:
import _research


Thanks for any help you can offer,

Marc

Nov 3 '05 #1
0 1277

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
17714
by: x-herbert | last post by:
Hi, I have a small test to "compile" al litle script as a WMI-Tester. The script include a wmi-wrapper and "insert" the Win32-modeles. here the code: my "WMI-Tester.py" ----- import wmi
0
1319
by: Cousin Stanley | last post by:
I __had__ a __working__ installation of the GTK Runtime and PyGTK using Python23 under Win98, but managed to muck it up, I think but couldn't swear to it, with a separate install of wGlade for Windows which has since been un-installed .... I've also un-installed/re-installed both the GTK Runtime and PyGTK from the original packages .... GTK Runtime 2.2.4.1 PyGTK 2.0 win32
1
10736
by: Askari | last post by:
Hi, I have this error when I want snashot of my screen with : Traceback (most recent call last): File "C:\Documents and Settings\Assembleur_MAN\Bureau\CasseTete (PyGame).py", line 1121, in ? import ImageGrab File "C:\Python23\Lib\site-packages\PIL\ImageGrab.py", line 29, in ? grabber = Image.core.grabscreen File "C:\Python23\Lib\site-packages\PIL\Image.py", line 39, in
2
4007
by: Stephane Roy | last post by:
Hi, Did someone installed and used successfully drPython on Cygwin? The installation requires wxpython. I tried many different alternatives (source, binary, etc) but so far the best I get is the following. Traceback (most recent call last): File "drpython.py", line 45, in ? import wx, wx.stc
6
3429
by: Laszlo Zsolt Nagy | last post by:
Sorry, I realized that the import zlib was not executed from my (working) service. So here is the question: why can't I use zlib from a win32 service? Is there any way to make it working? >------------- >Python could not import the service's module > File "T:\Python\Projects\NamedConnector\Service.py", line 17, in ? > from Processor import * > File "c:\Python\Projects\NamedConnector\Processor.py", line 35, in ?
2
2181
by: Adam Blinkinsop | last post by:
I'm writing a set of modules to monitor remote system services, and I'm having a problem running my test scripts. When I pass the scripts into python, like so: -- $ PYTHONPATH="${TARGET_DIR}" python test.py -- I get an ImportError:
0
4381
by: çÌÏÔÏ× áÒÔÅÍ | last post by:
Hello! I'm trying to install the web application written with Python, and have the trouble with module math.so: # lwp-request http://localhost/site/code/edit.py Mod_python error: "PythonHandler edit::handler" Traceback (most recent call last):
6
22475
by: samn | last post by:
i compiled and installed the release version of python 2.5 for linux to a directory accessible to 2 computers, configured with --prefix=/usr/arch (which is accessible to both machines). the installation went fine and when i run python on one machine i can do from hashlib import * without a problem. on the other machine i get the following error: Traceback (most recent call last): File "<stdin>", line 1, in <module> File...
2
5913
by: Simon Forman | last post by:
Hello, I just installed Matplotlib (and NumPy) on a windows XP machine, and I'm getting the following traceback when I try to use the TkAgg backend. Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) on win32 Type "help", "copyright", "credits" or "license" for more information. Traceback (most recent call last):
0
2404
by: Barak, Ron | last post by:
Hi, I'm trying to compile using py2exe, and am getting the following: $ python_win Setup.py py2exe running py2exe creating c:\Documents and Settings\rbarak\rbarak_devel\dpm09\build creating c:\Documents and Settings\rbarak\rbarak_devel\dpm09\build\bdist.win32 creating c:\Documents and Settings\rbarak\rbarak_devel\dpm09\build\bdist.win32\winexe creating c:\Documents and...
0
9000
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, 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...
0
9577
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, 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...
0
9396
jinu1996
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...
1
6804
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6081
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();...
0
4713
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4887
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3322
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2804
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.