forum.vmspython.org Forum Index forum.vmspython.org
Forum system
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

python-messaging

 
Post new topic   Reply to topic    forum.vmspython.org Forum Index -> Python for OpenVMS
View previous topic :: View next topic  
Author Message
franz2014



Joined: 12 Dec 2014
Posts: 4

PostPosted: Fri Dec 12, 2014 11:03 am    Post subject: python-messaging Reply with quote

I'm new to Python.
I'm trying to install module python-messaging
https://github.com/pmarti/python-messaging

Before that I have successfully installed "nose" because it is a requirement for python-messaging

Both the installations complete with no errors but "messaging" is
not installed.
At the end of python-messaging installation I find a build/lib...
directory in the path where I have uncompressed the kit.
I also tried to copy the path messaging/lib/... under python_root[local.messaging]
but the maximum that I have got is (for example):
>>> from messaging.sms import pdu
>>> p = pdu()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'module' object is not callable

also, if I do:
>>> import sys
>>> sys.path
I get:
['', '/CNUCE_ROOT5/SENDSMSALL/py/python-messaging-master/dist/python_messaging-0.5.12-py2.7.egg', '/python_root/lib', '/python_root/local', '/python_root/lib/python2.7/site-packages']

where probabily the path:
/CNUCE_ROOT5/SENDSMSALL/py/python-messaging-master/dist/python_messaging-0.5.12-py2.7.egg
has been added by the installation procedure.

The above is just to let you the scenario.
So.. I'm asking some help from this forum.
Back to top
View user's profile Send private message
jfp



Joined: 12 Jul 2004
Posts: 618

PostPosted: Sat Dec 13, 2014 9:00 pm    Post subject: Reply with quote

Hello,

it seem that the correct usage is
Code:
from messaging.sms.pdu import Pdu
p = Pdu()


Generally to install a pure python module, you can do
Code:
python setup.py build
and look at the build/lib directory (put the module directory in you pythonpath)
or directly
Code:
python setup.py install
which install the library in
/python_root/lib/python2.7/site-packages

Jean-François
Back to top
View user's profile Send private message Send e-mail Visit poster's website
franz2014



Joined: 12 Dec 2014
Posts: 4

PostPosted: Mon Dec 29, 2014 9:38 am    Post subject: Reply with quote

Hi Jean-François,

I didn't have time to play with python until now.
Sorry for this delay in acknowledge your answer.

I have followed step by step your suggestion.

If I try to install the 'messaging' module by 'python setup.py install' I found a complete directory tree under
dir PYTHON_ROOT:[lib.python2^.7.site-packages]

nose-1^.3^.4-py2^.7^.egg.DIR;1
python_messaging-0^.5^.12-py2^.7^.egg.DIR;1

At this point if I list the modules with the python help "modules" command
I see the module 'nose' but I don't see the module 'messaging'

Infact

>>> from messaging.sms.pdu import Pdu

doesn't work

So I have copied the messaging.build.lib directory tree under
python_root:[local]

Now I can see the messaging module listed, but I get the following
error when I try to use it:

>>> from messaging.sms.pdu import Pdu
>>> p = Pdu()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: __init__() takes at least 3 arguments (1 given)
>>>

So... at this point I wish you, and everybody is reading this post, a Happy New Year!!

Francesco
Back to top
View user's profile Send private message
franz2014



Joined: 12 Dec 2014
Posts: 4

PostPosted: Mon Dec 29, 2014 12:13 pm    Post subject: Reply with quote

Hi Jean-François,

it seems to work!
I'm running the tests scripts and they work fine.

It remains the fact that the installation with
'python setup.py install'
didn't produce a valid module (also if python setup build and python setup install worked without any error), but this is less important
for me at the moment... I have to learn python... Smile

Thank you for your support!

I wish you a Happy New Year!

Francesco



Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vmspython.org Forum Index -> Python for OpenVMS All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group