473,387 Members | 1,812 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,387 software developers and data experts.

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
libvtkgdcmPython.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 2631
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('datadir/*'):
if afile.endswith('.not'): continue
thefiles.append(afile)

print "Packaging up", thefiles

setup(name='justdata', 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.so', 'bin/libgdcmijpeg12.so',
'bin/libgdcmljpeg.so', 'bin/libgdcm.so', 'bin/libvtkgdcm.so',
'bin/_gdcm.so', 'bin/libvtkgdcmPython.so']
Distribution.parse_config_files():
options (after parsing config files):
no commands known yet
options (after parsing command line):
option dict for 'bdist' command:
{}
running bdist
Distribution.get_command_obj(): creating 'bdist' command object
Distribution.get_command_obj(): creating 'build' command object
Distribution.get_command_obj(): creating 'bdist_dumb' command object
bdist.run: format=gztar, command=bdist_dumb, rest=[]
running bdist_dumb
running build
Distribution.get_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_platbase: 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='justdata', data_files = [ [ 'foodir', thefiles ] ] )
File "/usr/lib/python2.2/distutils/core.py", line 138, in setup
dist.run_commands()
File "/usr/lib/python2.2/distutils/dist.py", line 902, in run_commands
self.run_command(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_command(cmd_name)
File "/usr/lib/python2.2/distutils/cmd.py", line 330, in run_command
self.distribution.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_command('install')
File "/usr/lib/python2.2/distutils/cmd.py", line 330, in run_command
self.distribution.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_finalized
self.finalize_options()
File "/usr/lib/python2.2/distutils/command/install.py", line 252, in
finalize_options
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
libvtkgdcmPython.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
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...
0
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...
15
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: *...
0
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...
1
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...
0
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...
7
by: vedrandekovic | last post by:
Hello again, Is there any patch for python "distutils", for this ImportError: cannot import name log Regards, Vedran
3
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...
0
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
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...

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.