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 

Adding new module under site-packages

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



Joined: 11 Oct 2012
Posts: 18
Location: Wellington, NZ

PostPosted: Tue Jun 04, 2013 2:52 am    Post subject: Adding new module under site-packages Reply with quote

Hi

I would like to use the requests.1.2.3 package in python on VMS.
After downloading the tar.gz and converting it to a zipfile on Windows (with underscores for dots in the filename) I unzipped the directory tree on our Itanium test machine. Because of ODS2/ODS5 issues I had to rename all the directories in the branch to lowercase name with uppercase DIR.

python setup.py build ran successfully.

python setup.py install failed (partly because of directory paths including the invalid python2.7 dot).

How should one go about doing the install please?

...
byte-compiling build/bdist.openvms-0-HP_Integrity_rx2800_i2__(1.60GH/egg/requests/__init__.py to __init__.pyc
creating build/bdist.openvms-0-HP_Integrity_rx2800_i2__(1.60GH/egg/EGG-INFO
copying requests.egg-info/PKG-INFO -> build/bdist.openvms-0-HP_Integrity_rx2800_i2__(1.60GH/egg/EGG-INFO
copying requests.egg-info/SOURCES.txt -> build/bdist.openvms-0-HP_Integrity_rx2800_i2__(1.60GH/egg/EGG-INFO
copying requests.egg-info/dependency_links.txt -> build/bdist.openvms-0-HP_Integrity_rx2800_i2__(1.60GH/egg/EGG-INFO
copying requests.egg-info/top_level.txt -> build/bdist.openvms-0-HP_Integrity_rx2800_i2__(1.60GH/egg/EGG-INFO
creating 'dist/requests-1.2.3-py2.7.egg' and adding 'build/bdist.openvms-0-HP_Integrity_rx2800_i2__(1.60GH/egg' to it
removing 'build/bdist.openvms-0-HP_Integrity_rx2800_i2__(1.60GH/egg' (and everything under it)
Processing requests-1.2.3-py2.7.egg
removing '/python_root/lib/python2.7/site-packages/requests-1.2.3-py2.7.egg' (and everything under it)
error removing /python_root/lib/python2.7/site-packages/requests-1.2.3-py2.7.egg: /python_root/lib/python2.7/site-packages/requests-1.2.3-py2
error removing /python_root/lib/python2.7/site-packages/requests-1.2.3-py2.7.egg: /python_root/lib/python2.7/site-packages/requests-1.2.3-py2
error removing /python_root/lib/python2.7/site-packages/requests-1.2.3-py2.7.egg: /python_root/lib/python2.7/site-packages/requests-1.2.3-py2
error removing /python_root/lib/python2.7/site-packages/requests-1.2.3-py2.7.egg: /python_root/lib/python2.7/site-packages/requests-1.2.3-py2
error removing /python_root/lib/python2.7/site-packages/requests-1.2.3-py2.7.egg: /python_root/lib/python2.7/site-packages/requests-1.2.3-py2
error removing /python_root/lib/python2.7/site-packages/requests-1.2.3-py2.7.egg: /python_root/lib/python2.7/site-packages/requests-1.2.3-py2
error removing /python_root/lib/python2.7/site-packages/requests-1.2.3-py2.7.egg: /python_root/lib/python2.7/site-packages/requests-1.2.3-py2
error removing /python_root/lib/python2.7/site-packages/requests-1.2.3-py2.7.egg: /python_root/lib/python2.7/site-packages/requests-1.2.3-py2
Extracting requests-1.2.3-py2.7.egg to /python_root/lib/python2.7/site-packages
Adding requests 1.2.3 to easy-install.pth file

Thanks
Colin Brown
Back to top
View user's profile Send private message
jfp



Joined: 12 Jul 2004
Posts: 636

PostPosted: Tue Jun 04, 2013 7:40 am    Post subject: Reply with quote

Hi Colin,

To extract a tar or tar.gz file I used the following procedure which correctly generate file/directory name:

Code:
$ type tarextract.com
$ def PYTHON_FILENAME_UNIX_ONLY 1
$ python sys$command: 'p1'
import tarfile
import sys
import vms.crtl
tarfile.open(vms.crtl.from_vms(sys.argv[1])).extractall()
$ deass PYTHON_FILENAME_UNIX_ONLY
$


If the "python setup.py build" command correctly work, you just have to backup the generated package (generaly [.build.lib...]) into a directory which is include in the pythonpath.


JF
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Colin Brown



Joined: 11 Oct 2012
Posts: 18
Location: Wellington, NZ

PostPosted: Tue Jun 04, 2013 11:39 pm    Post subject: Reply with quote

Ahh - success:

$set def build
$set def lib
$dir
requests.DIR;1
$python
Python 2.7.3+ (default, Jan 13 2013, 14:31:4Cool [DECC] on OpenVMS
Type "help", "copyright", "credits" or "license" for more information.
>>> import shutil
>>> shutil.copytree('requests','python_root/lib/site-packages/requests')

is the easiest way I could find to do it Very Happy

Thanks
Colin
Back to top
View user's profile Send private message
Colin Brown



Joined: 11 Oct 2012
Posts: 18
Location: Wellington, NZ

PostPosted: Wed Jun 05, 2013 1:07 am    Post subject: Reply with quote

That shutil line should have read:

shutil.copytree('requests','python_root/lib/python2.7/site-packages/requests')
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