Re: problem with import path on a python C extension

2009-02-09 Thread Carsten Haese
fredbasset1...@gmail.com wrote: > I can only get it to work if I copy the .so file to the directory > where daemon.py is and change the import to "import diomodule". And to supplement my previous reply, another solution is to make sure that /root/project/drivers/dio is in your PYTHONPATH. Then you

Re: problem with import path on a python C extension

2009-02-09 Thread Carsten Haese
fredbasset1...@gmail.com wrote: > [...] > So my question is why can't Python locate the new extension module > when I try to import it with "import project.drivers.dio.diomodule"? This import statement binds the module to the name "project.drivers.dio.diomodule". It does not bind anything to the na

problem with import path on a python C extension

2009-02-09 Thread fredbasset1000
Hi All, I've written a simple Python extension module in C, but Python is having problems trying to locate it when I import it into an existing Python file. In my example, I wrote a C extension called "diomodule" which exists in the directory : /root/project/drivers/dio/ diomodule.c. It has comp

Re: problem with import / namespace

2008-05-24 Thread Gabriel Genellina
En Sat, 24 May 2008 08:57:37 -0300, ohad frand <[EMAIL PROTECTED]> escribió: > Thanks for your reply but it stil didnt work: > i opened python shell, changed active directory to \\one and imported tmp1. > now the correct file is loaded. > now i deleted tmp1 > i dir os.chdir(\\two) and imported tmp

Re: problem with import / namespace

2008-05-24 Thread ohad frand
Hi Laszlo Thanks for your reply but it stil didnt work: i opened python shell, changed active directory to \\one and imported tmp1. now the correct file is loaded. now i deleted tmp1 i dir os.chdir(\\two) and imported tmp1 again. now the incorrect file is loaded (the same one as before). i did one

Re: problem with import / namespace

2008-05-21 Thread Laszlo Nagy
ohad frand wrote Hi Thanks for the answer. I probably didnt write the problem accurately but it is not as you described. (i already read before the section that you pointed and it didnt help me) the problem is that i dont want to import a file from different directory but only from the same di

Re: problem with import / namespace

2008-05-21 Thread ohad frand
Hi Thanks for the answer. I probably didnt write the problem accurately but it is not as you described. (i already read before the section that you pointed and it didnt help me) the problem is that i dont want to import a file from different directory but only from the same directory. \\1\tmp2.py i

Re: problem with import / namespace

2008-05-21 Thread Laszlo Nagy
When you try to import a module, python starts to search for it. The was it does the search is very well defined. It mostly depends on the current directory and sys.path. You can read more about this here: "The was it" -> "The way it" - inside your app.py file either make sure that the curre

Re: problem with import / namespace

2008-05-21 Thread Laszlo Nagy
ohad frand wrote: Hi I have a problem that the solution to it must be very simple but i couldnt fint it's answer in the internet so far (i searched for couple of days) the problme is as follows: i have two directories e.g. "\\1" and "\\2" in each directory i have two files with the same names

problem with import / namespace

2008-05-21 Thread ohad frand
Hi I have a problem that the solution to it must be very simple but i couldnt fint it's answer in the internet so far (i searched for couple of days) the problme is as follows: i have two directories e.g. "\\1" and "\\2" in each directory i have two files with the same names e.g. "tmp1.py" and "tm

Problem with import

2008-02-11 Thread Victor Lin
Hi, I got some problem with import. I have some python file that should be executed. Something like unit-test or other small tool. The project is not so small. So I want to separate these files into different packages. Might like this: project/ run_task.py pkg1/ __init__.py

Re: problem with import in python 2.2.3

2007-05-17 Thread Anthony Irwin
Hi Guys, Thanks for the replies I ended up rewriting my code to use the time.strftime() library but unfortunately the MySQLdb module I use needs python 2.3 or higher so it looks like I have to update python on the older system anyway. -- Kind Regards, Anthony Irwin http://www.irwinresources.

Re: problem with import in python 2.2.3

2007-05-17 Thread Simon Brunning
On 5/17/07, Anthony Irwin <[EMAIL PROTECTED]> wrote: > Does anyone know why the datetime module is not being found in python > 2.2.3 and how I can make the script work in the older version of python? The datetime modules was added in Python 2.3 - that's why you aren't finding it. This might help

Re: problem with import in python 2.2.3

2007-05-16 Thread Gabriel Genellina
En Thu, 17 May 2007 00:37:26 -0300, Anthony Irwin <[EMAIL PROTECTED]> escribió: > ./backup_all_mysql_databases.py > Traceback (most recent call last): >File "./backup_all_mysql_databases.py", line 5, in ? > from datetime import date > ImportError: No module named datetime > > Does anyon

problem with import in python 2.2.3

2007-05-16 Thread Anthony Irwin
Hi, I have written a python script that works perfectly in python 2.4.4 and python 2.4.3 but when I try to use the same script on an older system with python 2.2.3 I get the following error. ./backup_all_mysql_databases.py Traceback (most recent call last): File "./backup_all_mysql_databases

Re: problem with import autotest ...

2006-05-19 Thread Ben Finney
"bravegag" <[EMAIL PROTECTED]> writes: > I have a script that works just fine on linux but when I try to > debug from Windows using Eclipse and PyDEV plugin then it does not > work. The Python version is the same 2.3.x , and command line is > roughly the same. 2.3.x is not a version. Which versio

problem with import autotest ...

2006-05-19 Thread bravegag
Hi all, Please beware I am new to Python and have little experience with it. I have a script that works just fine on linux but when I try to debug from Windows using Eclipse and PyDEV plugin then it does not work. The Python version is the same 2.3.x , and command line is roughly the same. from

Re: python newb has problem with import statements

2006-03-19 Thread danielmcbrearty
that was indeed the problem. Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: python newb has problem with import statements

2006-03-19 Thread Peter Otten
[EMAIL PROTECTED] wrote: > the init file looks like this: > > (docs and comments skipped) > > print "in pymedia" # added by me to see > __all__= [ 'muxer', 'audio', 'video', 'removable' ] > import muxer, audio, video, removable > > but I can't import submodules of pymedia: The file with the c

python newb has problem with import statements

2006-03-19 Thread danielmcbrearty
Hi Old hand at perl, giving python a try. Trying to get pymedia running on my winxp box. Have installed activestate python 2.4 and pymedia using precompiled installers. Problem is it SEEMS that the __init__.py is not getting run when I import a module. So, I have pymedia installed and it import

Re: Problem with import "from omniORB import CORBA, PortableServer"

2005-04-11 Thread Stefan Seefeld
[EMAIL PROTECTED] wrote: Thank for the reply, I think your right my problem is the what version to us, I want to write some Python scripts calling Corba Objects what do i need ? omnipython-1.5.2-1 this looks like *really* old (and obsolete) stuff... omniORBpy 2.5 omniORB 4.0.5 Python 2.4.1 These l

Re: Problem with import "from omniORB import CORBA, PortableServer"

2005-04-11 Thread gerald . maher
Thank for the reply, I think your right my problem is the what version to us, I want to write some Python scripts calling Corba Objects what do i need ? omnipython-1.5.2-1 omniORBpy 2.5 omniORB 4.0.5 Python 2.4.1 Is this correct ? i want to excuat the example C:\omniORBpy-2.5-win32-python2.3\om

Re: Problem with import "from omniORB import CORBA, PortableServer"

2005-04-11 Thread Steve Holden
[EMAIL PROTECTED] wrote: Hi, I am trying to excuate the follwong code: [ import sys from omniORB import CORBA, PortableServer ] I get the following error: [ Traceback (most recent call last): File "C:\omniORBpy-2.5-win32-python2.3\omniORBpy-2.5\examples\echoMyTest\example_echo_coloc.py", line 9,

Problem with import "from omniORB import CORBA, PortableServer"

2005-04-11 Thread gerald . maher
Hi, I am trying to excuate the follwong code: [ import sys from omniORB import CORBA, PortableServer ] I get the following error: [ Traceback (most recent call last): File "C:\omniORBpy-2.5-win32-python2.3\omniORBpy-2.5\examples\echoMyTest\example_echo_coloc.py", line 9, in ? from omniORB

Re: problem with import pylab from a website

2005-01-20 Thread John Hunter
> "jean" == jean rossier <[EMAIL PROTECTED]> writes: jean> Hello All, I am facing a problem while importing pylab jean> library(in a .py program file) via web browser however the jean> same program works when I execute it from the command jean> prompt. jean> Error message

problem with import pylab from a website

2005-01-19 Thread jean . rossier
Hello All, I am facing a problem while importing pylab library(in a .py program file) via web browser however the same program works when I execute it from the command prompt. my configuration : Fedora Core 3 Apache 2.0 python 2.3.4 postgresql 7.3.4 mod_python-3.1.3-5 Error message we get: [W