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

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 1261

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

Similar topics

2
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
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 ...
1
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 ?...
2
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...
6
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? ...
2
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}"...
0
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:...
6
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...
2
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,...
0
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...
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: 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
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
tracyyun
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...
0
agi2029
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,...
0
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...

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.