473,545 Members | 666 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

distutils help

Hello,

I thought this would be easy but I guess I didn't get the distutil
feeling. I am trying to write a setup for install my package but I don't
understand how to do that.

organisation:

setup.py
/bin/
gdcm.py
_gdcm.so
libvtkgdcmPytho n.so
/gdcmPython/
gdcm.pth
How do you specify setup you want to install library ? Do you use
'data_files' ? Same thing for gdcm.pth is this a 'data_files' also ?

Thanks
Mathieu

Jul 18 '05 #1
1 2642
What is the purpose of DISTUTILS_DEBUG , if I set it to one, I cannot get
anything to run ?

For instance:

"""
from distutils.core import setup

import glob

thefiles = []
for afile in glob.glob('data dir/*'):
if afile.endswith( '.not'): continue
thefiles.append (afile)

print "Packaging up", thefiles

setup(name='jus tdata', data_files = [ [ 'foodir', thefiles ] ] )
"""

Here's an example of how this works:

[alex@lancelot tryp]$ ls datadir
aa.yes bb.not cc.yes
[alex@lancelot tryp]$ python setup.py bdist
Then try it with

export DISTUTILS_DEBUG =1

I get:

Packaging up ['bin/libgdcmijpeg8.s o', 'bin/libgdcmijpeg12. so',
'bin/libgdcmljpeg.so ', 'bin/libgdcm.so', 'bin/libvtkgdcm.so',
'bin/_gdcm.so', 'bin/libvtkgdcmPytho n.so']
Distribution.pa rse_config_file s():
options (after parsing config files):
no commands known yet
options (after parsing command line):
option dict for 'bdist' command:
{}
running bdist
Distribution.ge t_command_obj() : creating 'bdist' command object
Distribution.ge t_command_obj() : creating 'build' command object
Distribution.ge t_command_obj() : creating 'bdist_dumb' command object
bdist.run: format=gztar, command=bdist_d umb, rest=[]
running bdist_dumb
running build
Distribution.ge t_command_obj() : creating 'install' command object
installing to build/bdist.linux-i686/dumb
running install
pre-finalize_{unix, other}:
prefix: None
exec_prefix: None
home: None
install_base: None
install_platbas e: None
root: build/bdist.linux-i686/dumb
install_purelib : None
install_platlib : None
install_lib: None
install_headers : None
install_scripts : None
install_data: None
compile: None
Traceback (most recent call last):
File "setup.py", line 12, in ?
setup(name='jus tdata', data_files = [ [ 'foodir', thefiles ] ] )
File "/usr/lib/python2.2/distutils/core.py", line 138, in setup
dist.run_comman ds()
File "/usr/lib/python2.2/distutils/dist.py", line 902, in run_commands
self.run_comman d(cmd)
File "/usr/lib/python2.2/distutils/dist.py", line 922, in run_command
cmd_obj.run()
File "/usr/lib/python2.2/distutils/command/bdist.py", line 135, in run
self.run_comman d(cmd_name)
File "/usr/lib/python2.2/distutils/cmd.py", line 330, in run_command
self.distributi on.run_command( command)
File "/usr/lib/python2.2/distutils/dist.py", line 922, in run_command
cmd_obj.run()
File "/usr/lib/python2.2/distutils/command/bdist_dumb.py", line 81,
in run
self.run_comman d('install')
File "/usr/lib/python2.2/distutils/cmd.py", line 330, in run_command
self.distributi on.run_command( command)
File "/usr/lib/python2.2/distutils/dist.py", line 921, in run_command
cmd_obj.ensure_ finalized()
File "/usr/lib/python2.2/distutils/cmd.py", line 112, in ensure_finalize d
self.finalize_o ptions()
File "/usr/lib/python2.2/distutils/command/install.py", line 252, in
finalize_option s
self.dump_dirs( "pre-finalize_{unix, other}")
File "/usr/lib/python2.2/distutils/command/install.py", line 350, in
dump_dirs
val = getattr(self, opt_name)
File "/usr/lib/python2.2/distutils/cmd.py", line 107, in __getattr__
raise AttributeError, attr
AttributeError: no_compile
Could someone please fix the documentation saying that one should not
use it.

Thanks
Mathieu

Mathieu Malaterre wrote:
Hello,

I thought this would be easy but I guess I didn't get the distutil
feeling. I am trying to write a setup for install my package but I don't
understand how to do that.

organisation:

setup.py
/bin/
gdcm.py
_gdcm.so
libvtkgdcmPytho n.so
/gdcmPython/
gdcm.pth
How do you specify setup you want to install library ? Do you use
'data_files' ? Same thing for gdcm.pth is this a 'data_files' also ?

Thanks
Mathieu


Jul 18 '05 #2

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

Similar topics

3
1953
by: Isaac Jones | last post by:
Hello Python Community. I bring greetings from the Haskell community (http://www.haskell.org) ;) There has been a lot of discussion of late about creating a grand-unified build & distribution system for "3rd party" Haskell libraries (those not distributed with the compilers). Python's Distutils has come up a few times. The Haskell...
0
1321
by: Jorge Godoy | last post by:
Hi! For the following setup.py, I get this error: byte-compiling /var/tmp/bhsys-buildroot/usr/lib/python2.3/site-packages/bhsys/Impressao.py to Impressao.pyc byte-compiling /var/tmp/bhsys-buildroot/usr/lib/python2.3/site-packages/bhsys/bhsys.py to bhsys.pyc running install_scripts
15
4101
by: Colin J. Williams | last post by:
The distutils download page has: -------------------------------------------------------- Current stable release The current stable release is Distutils 1.0.2; you can download it as: * Distutils-1.0.2.tar.gz (source distribution) (233k) * Distutils-1.0.2.zip (source distribution) (274k) * Distutils-1.0.2.win32.exe (Windows installer)...
0
1747
by: Christopher De Vries | last post by:
The predominant operating system in my workplace is Solaris, with a bit of Linux and MacOS X thrown in. As such people expect to install new software with the sequence: ../configure make make install I've written some python modules and scripts which I packaged as a source distribution with distutils and sent it to some of my colleagues
1
1704
by: Terry Hancock | last post by:
Some time ago, I got the idea that I wanted to build image resources from vector graphic originals, instead of marshalling hundreds of tiny little icon images by hand. I wrote "BuildImage" to do this for me, and so far, it works very well, so I'm trying to make it easier to use and available to more developers. There is a brief (and...
0
1854
by: Maarten Sneep | last post by:
I'm trying to build PyBison on Mac OS X, and I'm running into some problems with the distutils. Just for starters: PyBison requires Pyrex. This is not a problem, and Pyrex seems to work without problems, at least the primes sample module shows a nice 25 to 30 fold speed increase over the pure python version. I used the distutils to...
7
4264
by: vedrandekovic | last post by:
Hello again, Is there any patch for python "distutils", for this ImportError: cannot import name log Regards, Vedran
3
1718
by: Rick Muller | last post by:
I need some distutils help. I currently run a python library (PyQuante) that, until recently, had all of its modules in a single directory, called "PyQuante". The setup command in my setup.py module had a single "packages" line: packages = , I moved some of the routines into Basis and IO subdirectories of PyQuante, and amended the...
0
1445
by: newbie73 | last post by:
OS: Vista Python 2.5.2.2 (ActiveState Software Installation) Running latest Cygwin release The error generated is pasted below - please help. - Luis ***************************************
0
7467
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...
0
7656
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. ...
1
7419
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5971
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5326
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...
0
3450
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...
0
3442
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1879
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
0
703
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.