[Distutils] Problem installing setuptools under virtual python environment
I am on a Cent OS shared system (i.e. I don't have root) with python 2.4 and am having trouble setting up setuptools in a virtual environment. I start by setting up the virtual environment: $/usr/bin/python2.4 virtual-python.py --prefix=~/apps/python Creating /fslhome/ddw28/apps/python/lib/python2.4 Creating /fslhome/ddw28/apps/python/lib/python2.4/site-packages Creating /fslhome/ddw28/apps/python/include/python2.4 Creating /fslhome/ddw28/apps/python/bin Copying /usr/bin/python2.4 to /fslhome/ddw28/apps/python/bin You're now ready to download ez_setup.py, and run /fslhome/ddw28/apps/python/bin/python ez_setup.py then I add ~/apps/python/bin to my PATH and run the setup script with the following errors $ sh setuptools-0.6c9-py2.4.egg error: can't create or remove files in install directory The following error occurred while trying to add or remove files in the installation directory: [Errno 13] Permission denied: '/usr/lib/python2.4/site-packages/test-easy-install-5267.write-test' The installation directory you specified (via --install-dir, --prefix, or the distutils default setting) was: /usr/lib/python2.4/site-packages/ ... I get the right answer when I run which: $ which python ~/apps/python/bin/python I also created a symlink ~/apps/python/bin/python2.4 - ~/apps/python/bin/python and get the same errors (this fixed a similar problem I had before on a different machine). Can anybody think of what might be going wrong? Thanks, dan ___ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
Re: [Distutils] Get install prefix for module at runtime
On Wed, Sep 16, 2009 at 5:40 PM, Wolodja Wentland wentl...@cl.uni-heidelberg.de wrote: On Tue, Sep 15, 2009 at 17:38 +0200, Wolodja Wentland wrote: My question is: How to reliably access data files from a module in foo? Approach 2 - writing a build.py file at installation time - The last question made me think, that Approach 1 works for the three standard installation schemes, but fails miserably if the user decides to do anything fancy. I implemented this approach like this: Sorry for the late reply, Is this a good approach? Is there anything i can do better? The idea of providing your own install command seems good, except that I find writing all informations in a .py overkill. In the same way the option --record works, you can memorize all installation locations into a simple ConfigParser-like file you add to the files that are installed in Python in your package. Your code can then read the .cfg file it at execution time using __file__ to get your paths. Although with this approach you have to be careful if your package is distributed in some environments (py2exe, setuptools eggs) where you might be located in a zipped file. What are your target platforms ? Tarek ___ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
[Distutils] non-ascii characters in long description
I have non-ascii characters in my long description (as I just fixed a bug in my package that had to do with non-ascii characters). I did all the right things like opening my changelog and readme with codecs.open(..., encoding='utf-8') and so. But I ran into the following setuptools problem: When calling python setup.py --long-description, setuptools effectively does a print long_description, which works with a utf8 string, but fails with a unicode string. When uploading to pypi, setuptools calls unicode() on my long description, which fails with a utf8 string and works with a unicode string. So if I do long_description=my_unicode_string, --long-description fails and if I do long_description=my_unicode_string.encode('utf-8') the pypi upload fails. In the end I used the dirty UltraMagicString() hack from http://stackoverflow.com/questions/1162338/whats-the-right-way-to-use-unicode-metadata-in-setup-py Any suggestions? Reinout -- Reinout van Rees - rein...@vanrees.org - http://reinout.vanrees.org Software developer at http://www.thehealthagency.com Military engineers build missiles. Civil engineers build targets ___ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
Re: [Distutils] non-ascii characters in long description
On Thu, Sep 17, 2009 at 2:46 PM, Reinout van Rees rein...@vanrees.org wrote: I have non-ascii characters in my long description (as I just fixed a bug in my package that had to do with non-ascii characters). I did all the right things like opening my changelog and readme with codecs.open(..., encoding='utf-8') and so. But I ran into the following setuptools problem: When calling python setup.py --long-description, setuptools effectively does a print long_description, which works with a utf8 string, but fails with a unicode string. When uploading to pypi, setuptools calls unicode() on my long description, which fails with a utf8 string and works with a unicode string. Mmm, I've fixed that problem in Distutils code in 2.6+ IIRC Are you sure this code is in setuptools and not in distutils ? can you provide a traceback ? Tarek -- Tarek Ziadé | http://ziade.org | オープンソースはすごい! ___ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
Re: [Distutils] non-ascii characters in long description
On 2009-09-17, Tarek Ziadé ziade.ta...@gmail.com wrote: On Thu, Sep 17, 2009 at 2:46 PM, Reinout van Rees rein...@vanrees.org wrote: I have non-ascii characters in my long description (as I just fixed a bug in my package that had to do with non-ascii characters). I did all the right things like opening my changelog and readme with codecs.open(..., encoding='utf-8') and so. But I ran into the following setuptools problem: When calling python setup.py --long-description, setuptools effectively does a print long_description, which works with a utf8 string, but fails with a unicode string. When uploading to pypi, setuptools calls unicode() on my long description, which fails with a utf8 string and works with a unicode string. Mmm, I've fixed that problem in Distutils code in 2.6+ IIRC Ah, I'm still using 2.5 mostly. Are you sure this code is in setuptools and not in distutils ? can you provide a traceback ? You're completely right: distutils (at least the upload to pypi bug). Here's the traceback: Traceback (most recent call last): File setup.py, line 47, in module 'lasttagdiff = zest.releaser.lasttagdiff:main'], File /opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/core.py, line 151, in setup dist.run_commands() File /opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/dist.py, line 986, in run_commands self.run_command(cmd) File /opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/dist.py, line 1006, in run_command cmd_obj.run() File /opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/setuptools-0.6c9-py2.5.egg/setuptools/command/register.py, line 9, in run File /opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/command/register.py, line 48, in run self.send_metadata() File /opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/command/register.py, line 162, in send_metadata auth) File /opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/command/register.py, line 257, in post_to_server value = unicode(value).encode(utf-8) UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 6030: ordinal not in range(128) Reinout -- Reinout van Rees - rein...@vanrees.org - http://reinout.vanrees.org Software developer at http://www.thehealthagency.com Military engineers build missiles. Civil engineers build targets ___ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
Re: [Distutils] non-ascii characters in long description
On Thu, Sep 17, 2009 at 3:31 PM, Reinout van Rees rein...@vanrees.org wrote: On 2009-09-17, Tarek Ziadé ziade.ta...@gmail.com wrote: On Thu, Sep 17, 2009 at 2:46 PM, Reinout van Rees rein...@vanrees.org wrote: I have non-ascii characters in my long description (as I just fixed a bug in my package that had to do with non-ascii characters). I did all the right things like opening my changelog and readme with codecs.open(..., encoding='utf-8') and so. But I ran into the following setuptools problem: When calling python setup.py --long-description, setuptools effectively does a print long_description, which works with a utf8 string, but fails with a unicode string. When uploading to pypi, setuptools calls unicode() on my long description, which fails with a utf8 string and works with a unicode string. Mmm, I've fixed that problem in Distutils code in 2.6+ IIRC Ah, I'm still using 2.5 mostly. Are you sure this code is in setuptools and not in distutils ? can you provide a traceback ? You're completely right: distutils (at least the upload to pypi bug). Here's the traceback: Traceback (most recent call last): File setup.py, line 47, in module 'lasttagdiff = zest.releaser.lasttagdiff:main'], File /opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/core.py, line 151, in setup dist.run_commands() File /opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/dist.py, line 986, in run_commands self.run_command(cmd) File /opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/dist.py, line 1006, in run_command cmd_obj.run() File /opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/setuptools-0.6c9-py2.5.egg/setuptools/command/register.py, line 9, in run File /opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/command/register.py, line 48, in run self.send_metadata() File /opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/command/register.py, line 162, in send_metadata auth) File /opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/command/register.py, line 257, in post_to_server value = unicode(value).encode(utf-8) UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 6030: ordinal not in range(128) Yes that's the one I've fixed. You have to backport a fix in your setup.py if python 2.6 You can register.patch post_to_server to pre-process all values in the data argument, so they are all in unicode, then call the real one. That's hackish, but at least unicode() won't break anymore when called on already decoded strings eg unicode objects. Tarek Reinout -- Reinout van Rees - rein...@vanrees.org - http://reinout.vanrees.org Software developer at http://www.thehealthagency.com Military engineers build missiles. Civil engineers build targets ___ Distutils-SIG maillist - distutils-...@python.org http://mail.python.org/mailman/listinfo/distutils-sig -- Tarek Ziadé | http://ziade.org | オープンソースはすごい! ___ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
Re: [Distutils] setup.cfg new format proposal
At 12:41 PM 9/17/2009 +0200, Tarek Ziadé wrote: Also, if I understand clearly the idea, I find it rather cryptic to add conditions to each dependency like what Sridhar has shown. That's actually not how it would work; you simply put section headings inside the extras_require field, rather than having multiple sections in setup.cfg. Then, the static metadata is just the existing PKG-INFO format. Setuptools already supports section headings in extras_require, it just doesn't (yet) automatically install the contents of those sections based on platform/python version; you'd have to explicitly request easy_install somepackage[platform.win32,pyver-2.6] at the moment. But adding automatic defaulting of those flags would be pretty trivial, once their format was officially defined. See http://peak.telecommunity.com/DevCenter/setuptools#declaring-extras-optional-features-with-their-own-dependencies for more details. ___ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
Re: [Distutils] non-ascii characters in long description
On 2009-09-17, Tarek Ziadé ziade.ta...@gmail.com wrote: Yes that's the one I've fixed. You have to backport a fix in your setup.py if python 2.6 You can register.patch post_to_server to pre-process all values in the data argument, so they are all in unicode, then call the real one. Thanks for the info. I've added your hint to the stackoverflow page so that it is findable right there. Reinout -- Reinout van Rees - rein...@vanrees.org - http://reinout.vanrees.org Software developer at http://www.thehealthagency.com Military engineers build missiles. Civil engineers build targets ___ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
Re: [Distutils] Get install prefix for module at runtime
On Thu, Sep 17, 2009 at 12:55 PM, Tarek Ziadé ziade.ta...@gmail.com wrote: On Wed, Sep 16, 2009 at 5:40 PM, Wolodja Wentland wentl...@cl.uni-heidelberg.de wrote: On Tue, Sep 15, 2009 at 17:38 +0200, Wolodja Wentland wrote: My question is: How to reliably access data files from a module in foo? Approach 2 - writing a build.py file at installation time - The last question made me think, that Approach 1 works for the three standard installation schemes, but fails miserably if the user decides to do anything fancy. I implemented this approach like this: Sorry for the late reply, Is this a good approach? Is there anything i can do better? The idea of providing your own install command seems good, except that I find writing all informations in a .py overkill. In the same way the option --record works, you can memorize all installation locations into a simple ConfigParser-like file you add to the files that are installed in Python in your package. Your code can then read the .cfg file it at execution time using __file__ to get your paths. Although with this approach you have to be careful if your package is distributed in some environments (py2exe, setuptools eggs) where you might be located in a zipped file. On a second thaught, if the file already exists in you package with default values it's simpler : you might be able to alter it on-the-fly by overriding the build_py command instead of the install command and AFAIR, you won't be bothered by setuptools' monkey patches. ___ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
Re: [Distutils] non-ascii characters in long description
On Thu, Sep 17, 2009 at 03:46:27PM +0200, Tarek Ziadé wrote: On Thu, Sep 17, 2009 at 3:31 PM, Reinout van Rees rein...@vanrees.org wrote: On 2009-09-17, Tarek Ziadé ziade.ta...@gmail.com wrote: On Thu, Sep 17, 2009 at 2:46 PM, Reinout van Rees rein...@vanrees.org wrote: I have non-ascii characters in my long description (as I just fixed a bug in my package that had to do with non-ascii characters). I did all the right things like opening my changelog and readme with codecs.open(..., encoding='utf-8') and so. But I ran into the following setuptools problem: When calling python setup.py --long-description, setuptools effectively does a print long_description, which works with a utf8 string, but fails with a unicode string. When uploading to pypi, setuptools calls unicode() on my long description, which fails with a utf8 string and works with a unicode string. Mmm, I've fixed that problem in Distutils code in 2.6+ IIRC ... Traceback (most recent call last): ... File /opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/command/register.py, line 257, in post_to_server value = unicode(value).encode(utf-8) UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 6030: ordinal not in range(128) Yes that's the one I've fixed. You have to backport a fix in your setup.py if python 2.6 I think you mean = 2.6; I was seeing this problem with 2.6.2. It's good to know this is going to be fixed in 2.7. You can register.patch post_to_server to pre-process all values in the data argument, so they are all in unicode, then call the real one. This sounds mysterious; I'll wait and look at Reinout's package in a while (assuming he choses to do this). That's hackish, but at least unicode() won't break anymore when called on already decoded strings eg unicode objects. Marius Gedminas -- Westheimer's Discovery: A couple of months in the laboratory can frequently save a couple of hours in the library. signature.asc Description: Digital signature ___ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
Re: [Distutils] non-ascii characters in long description
On Thu, Sep 17, 2009 at 01:58:34PM +, Reinout van Rees wrote: On 2009-09-17, Tarek Ziadé ziade.ta...@gmail.com wrote: Yes that's the one I've fixed. You have to backport a fix in your setup.py if python 2.6 You can register.patch post_to_server to pre-process all values in the data argument, so they are all in unicode, then call the real one. Thanks for the info. I've added your hint to the stackoverflow page so that it is findable right there. Thanks! Could you mention the name of your package so I could look at actual code? (That assumes you're going to replace UltraMagicString with Tarek's suggested workaround.) Marius Gedminas -- To stay awake all night adds a day to your life. -- Stilgar (Frank Herbert _Children_of_Dune_) signature.asc Description: Digital signature ___ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
Re: [Distutils] Get install prefix for module at runtime
On Thu, Sep 17, 2009 at 18:51 +0200, Tarek Ziadé wrote: you might be able to alter it on-the-fly by overriding the build_py command instead of the install command That worked perfectly! Thanks again for the help and pointers you gave me. I really appreciate that. The solution i came up with is: --- snip --- class build_py(_build_py): build_py command This specific build_py command will modify module 'foo.build_config' so that it contains information on installation prefixes afterwards. def build_module (self, module, module_file, package): if type(package) is StringType: _package = string.split(package, '.') elif type(package) not in (ListType, TupleType): raise TypeError, \ 'package' must be a string (dot-separated), list, or tuple if ( module == 'build_info' and len(_package) == 1 and package[0] == 'foo'): iobj = self.distribution.command_obj['install'] with open(module_file, 'w') as module_fp: module_fp.write('# -*- coding: UTF-8 -*-\n\n') module_fp.write(DATA_DIR = '%s'\n%( os.path.join(iobj.install_data, 'share'))) module_fp.write(LIB_DIR = '%s'\n%(iobj.install_lib)) module_fp.write(SCRIPT_DIR = '%s'\n%(iobj.install_scripts)) _build_py.build_module(self, module, module_file, package) --- snip --- I might change the 'detect my module' logic a little because i rely on python short circuit evaluation a bit too much. I have some final questions: 1. Is the distutils API i am using here likely to change? 2. Is there a better way to access install_{lib,scripts,data} than going through the install command object available from distribution? 3. Could you include something like this in distutils? My idea on how to handle this would be to define an additional argument 'foo_bar' for core.setup() which will take a user defined dotted module name in which information like this will be saved. So if a user defines: core.setup( ... foo_bar : 'foo.build_info', ... ) A file lib_prefix/foo/build_info.py will be injected into the library or an already one would be altered according to user defined string templates. Something like this would end module.__file__ hacks once and for all and is IMHO a much cleaner way to advertise this information to libraries/application than trying to take care of this externally. so long Wolodja Wentland signature.asc Description: Digital signature ___ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
Re: [Distutils] distutils bdist_rpm and %postun section of spec file
Hi, as rule of thumb (followed now by all major distros) you should not put any script in %postun, %postinst etc sections. Regards, Antonio Hello, I am looking for some advise in creating rpm package using bdist_rpm. I have managed to create post_install part using information http://stackoverflow.com/questions/1321270/how-to-extend-distutils-with-a-s imple-post-install-script Now i would like to add some code to %postun part of spec file to revert changes done by my post_install command. Is there a way to add it in setup.py or do i have to manually edit spec file? ___ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
[Distutils] [buildout] recipes useful to setup a whole machine
Hi All, I have a hair-brained notion of using a buildout to set up an entire machine. Has anyone done this before? (Jim, didn't you say ZC do this a lot?) From where I'm sitting, I'm looking for a few recipes: - what's the best download cmmi recipe out there? - what's the best recipe for running other buildouts? - is there a recipe available anywhere for installing/removing packages using aptitude? cheers, Chris -- Simplistix - Content Management, Batch Processing Python Consulting - http://www.simplistix.co.uk ___ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
Re: [Distutils] [buildout] recipes useful to setup a whole machine
On Thu, Sep 17, 2009 at 5:11 PM, Chris Withers ch...@simplistix.co.uk wrote: I have a hair-brained notion of using a buildout to set up an entire machine. Has anyone done this before? (Jim, didn't you say ZC do this a lot?) No, we use buildouts to build rpms. Jim -- Jim Fulton ___ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
Re: [Distutils] [buildout] recipes useful to setup a whole machine
Jim Fulton wrote: On Thu, Sep 17, 2009 at 5:11 PM, Chris Withers ch...@simplistix.co.uk wrote: I have a hair-brained notion of using a buildout to set up an entire machine. Has anyone done this before? (Jim, didn't you say ZC do this a lot?) No, we use buildouts to build rpms. Ah, okay, do you have an automated machine setup process for the resulting rpms or do you just install them by hand? cheers, Chris -- Simplistix - Content Management, Batch Processing Python Consulting - http://www.simplistix.co.uk ___ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
Re: [Distutils] setup.cfg new format proposal
On Thu, 17 Sep 2009 07:05:46 -0700, Tarek Ziadé ziade.ta...@gmail.com wrote: On Thu, Sep 17, 2009 at 3:53 PM, P.J. Eby p...@telecommunity.com wrote: At 12:41 PM 9/17/2009 +0200, Tarek Ziadé wrote: Also, if I understand clearly the idea, I find it rather cryptic to add conditions to each dependency like what Sridhar has shown. That's actually not how it would work; you simply put section headings inside the extras_require field, rather than having multiple sections in setup.cfg. Then, the static metadata is just the existing PKG-INFO format. could you provide a full example, taking back theses thread examples ? I think PJE was referring to something like this: $ cat foo.egg-info/requires.txt argparse lxml [tests] nose [python-lt-26] multiprocessing [platform-eq-win32] pywin32 which is defined in setup.py like this: $ cat setup.py [...] setup( [...] install_requires['argparse', 'lxml'], extras_require={'tests': ['nose'], 'python-lt-26': ['multiprocessing'], 'platform-eq-win32': ['pywin32']} [...] ) Currently you have to manually specify, say, easy_install foo[platform-eq-win32,python-lt-26] if you are installing on Windows Python 2.5. But with a little modification, this can be made automatic. Zope packages makes use of this kind of 'extras' feature a lot .. eg: easy_install foo[tests] would also install nose. Setuptools already has this feature. I suggest we make this a standard of doing things and extend the extras syntax to implement conditional dependencies. -srid ___ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
Re: [Distutils] non-ascii characters in long description
Marius Gedminas, on 2009-09-17: On Thu, Sep 17, 2009 at 01:58:34PM +, Reinout van Rees wrote: On 2009-09-17, Tarek Ziadé ziade.ta...@gmail.com wrote: Yes that's the one I've fixed. You have to backport a fix in your setup.py if python 2.6 You can register.patch post_to_server to pre-process all values in the data argument, so they are all in unicode, then call the real one. Thanks for the info. I've added your hint to the stackoverflow page so that it is findable right there. Thanks! Could you mention the name of your package so I could look at actual code? (That assumes you're going to replace UltraMagicString with Tarek's suggested workaround.) That is zest.releaser. See http://svn.plone.org/svn/collective/zest.releaser/trunk http://pypi.python.org/pypi/zest.releaser -- Maurits van Rees | http://maurits.vanrees.org/ Work | http://zestsoftware.nl/ This is your day, don't let them take it away. [Barlow Girl] ___ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
Re: [Distutils] [buildout] recipes useful to setup a whole machine
On Thu, Sep 17, 2009 at 6:06 PM, Chris Withers ch...@simplistix.co.uk wrote: Jim Fulton wrote: On Thu, Sep 17, 2009 at 5:11 PM, Chris Withers ch...@simplistix.co.uk wrote: I have a hair-brained notion of using a buildout to set up an entire machine. Has anyone done this before? (Jim, didn't you say ZC do this a lot?) No, we use buildouts to build rpms. Ah, okay, do you have an automated machine setup process for the resulting rpms or do you just install them by hand? We use a combination of cobbler and yum. Jim -- Jim Fulton ___ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
Re: [Distutils] Problem installing setuptools under virtual python environment
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 dan wrote: I am on a Cent OS shared system (i.e. I don't have root) with python 2.4 and am having trouble setting up setuptools in a virtual environment. I start by setting up the virtual environment: $/usr/bin/python2.4 virtual-python.py --prefix=~/apps/python Creating /fslhome/ddw28/apps/python/lib/python2.4 Creating /fslhome/ddw28/apps/python/lib/python2.4/site-packages Creating /fslhome/ddw28/apps/python/include/python2.4 Creating /fslhome/ddw28/apps/python/bin Copying /usr/bin/python2.4 to /fslhome/ddw28/apps/python/bin You're now ready to download ez_setup.py, and run /fslhome/ddw28/apps/python/bin/python ez_setup.py I'm pretty sure the right answer to your question is Use virtualenv.py instead of virtual-python.py. AFAIK, virtual-python.py is unsupported any longer, and virtualenv.py pre-installs setuptools for you. Tres. - -- === Tres Seaver +1 540-429-0999 tsea...@palladion.com Palladion Software Excellence by Designhttp://palladion.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFKsvKG+gerLs4ltQ4RAicRAJ4gTqQtiJM5/UIvKOUEhsAZovpiqgCePcQQ mTZbgS1zVzG15WFn08p5i+0= =/nbS -END PGP SIGNATURE- ___ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
[Distutils] stdeb-0.3 error
sudo easy_install stdeb # brought in stdeb 0.3 $ cd myappdir # where my setup.py is located $# following http://github.com/astraw/stdeb/ quickstart 1 $ python -c import stdeb; execfile('setup.py') sdist_dsc \ cd `find deb_dist -mindepth 1 -maxdepth 1 -type d` \ dpkg-buildpackage -rfakeroot -uc -us \ cd ../.. echo .deb created successfully in deb_dist/ Traceback (most recent call last): File string, line 1, in module File setup.py, line 41, in module sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)), bin)) NameError: name '__file__' is not defined = The error is coming from the setup.py line: import imp import sys import os import glob from distutils.core import setup, Command from distutils.command.install import install if os.name == 'nt': import py2exe sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)), bin)) === I do not get this error when I run setup.py normally for other commands like 'sdist'. How can I fix this? Regards, Gerry ___ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
Re: [Distutils] stdeb-0.3 error
Gerry Reno wrote: sudo easy_install stdeb # brought in stdeb 0.3 $ cd myappdir # where my setup.py is located $# following http://github.com/astraw/stdeb/ quickstart 1 $ python -c import stdeb; execfile('setup.py') sdist_dsc \ cd `find deb_dist -mindepth 1 -maxdepth 1 -type d` \ dpkg-buildpackage -rfakeroot -uc -us \ cd ../.. echo .deb created successfully in deb_dist/ Traceback (most recent call last): File string, line 1, in module File setup.py, line 41, in module sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)), bin)) NameError: name '__file__' is not defined You can use something more elaborate like python -c import stdeb,sys;f='setup.py';sys.argv[0]=f;execfile(f,{'__file__':f,'__name__':'__main__'}) sdist_dsc for the first line. ___ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig