Re: [Distutils] numpy build fails in distutils code
On Oct 14, 2006, at 6:27 PM, Robert Kern wrote: Actually it is a problem in disutils, one that is AFAIK fixed in 2.4.4c1 (and the same patch is in the 2.5 branch and on the trunk). What happens is that the binary release of Python for OSX is built as a universal binary and uses compiler flags that the compiler toolchain on OSX 10.3.9 doesn't understand. Distutils tries to remove those flags on 10.3.9, but I forgot a number of settings that need to be cleaned up. Perfect, that's what I suspected was happening. I'll just wait for 2.5.1 then. Thanks a lot! Jay P. ___ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
[Distutils] numpy build fails in distutils code
I've tried asking this on the numpy list (a few times), but unfortunately no response. Since the error *appears* to be inside distutils, I thought maybe someone here would recognize it. Anyway, I'm trying to build the lastest numpy RC with Python 2.5 on OS X 10.3.9, and this is the fun that occurrs: jayparlar$ python setup.py build Running from numpy source directory. F2PY Version 2_3296 blas_opt_info: FOUND: extra_link_args = ['-Wl,-framework', '-Wl,Accelerate'] define_macros = [('NO_ATLAS_INFO', 3)] extra_compile_args = ['-faltivec', '-I/System/Library/Frameworks/vecLib.framework/Headers'] lapack_opt_info: FOUND: extra_link_args = ['-Wl,-framework', '-Wl,Accelerate'] define_macros = [('NO_ATLAS_INFO', 3)] extra_compile_args = ['-faltivec'] running build running config_fc running build_src building py_modules sources creating build creating build/src.macosx-10.3-fat-2.5 creating build/src.macosx-10.3-fat-2.5/numpy creating build/src.macosx-10.3-fat-2.5/numpy/distutils building extension numpy.core.multiarray sources creating build/src.macosx-10.3-fat-2.5/numpy/core Generating build/src.macosx-10.3-fat-2.5/numpy/core/config.h customize NAGFCompiler customize AbsoftFCompiler customize IbmFCompiler Could not locate executable g77 Could not locate executable f77 Could not locate executable gfortran Could not locate executable f95 customize GnuFCompiler customize Gnu95FCompiler customize G95FCompiler customize GnuFCompiler customize Gnu95FCompiler customize NAGFCompiler customize NAGFCompiler using config C compiler: gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 compile options: '-I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -Inumpy/core/src -Inumpy/core/include -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c' gcc: _configtest.c gcc: cannot specify -o with -c or -S and multiple compilations gcc: cannot specify -o with -c or -S and multiple compilations failure. removing: _configtest.c _configtest.o numpy/core/setup.py:50: DeprecationWarning: raising a string exception is deprecated raise ERROR: Failed to test configuration Traceback (most recent call last): File setup.py, line 89, in module setup_package() File setup.py, line 82, in setup_package configuration=configuration ) File /Users/jayparlar/Desktop/numpy-1.0rc2/numpy/distutils/core.py, line 174, in setup return old_setup(**new_attr) File /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/core.py, line 151, in setup dist.run_commands() File /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/dist.py, line 974, in run_commands self.run_command(cmd) File /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/dist.py, line 994, in run_command cmd_obj.run() File /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/command/build.py, line 112, in run self.run_command(cmd_name) File /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/cmd.py, line 333, in run_command self.distribution.run_command(command) File /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/dist.py, line 994, in run_command cmd_obj.run() File /Users/jayparlar/Desktop/numpy-1.0rc2/numpy/distutils/command/build_src.py, line 87, in run self.build_sources() File /Users/jayparlar/Desktop/numpy-1.0rc2/numpy/distutils/command/build_src.py, line 106, in build_sources self.build_extension_sources(ext) File /Users/jayparlar/Desktop/numpy-1.0rc2/numpy/distutils/command/build_src.py, line 212, in build_extension_sources sources = self.generate_sources(sources, ext) File /Users/jayparlar/Desktop/numpy-1.0rc2/numpy/distutils/command/build_src.py, line 270, in generate_sources source = func(extension, build_dir) File numpy/core/setup.py, line 50, in generate_config_h raise ERROR: Failed to test configuration ERROR: Failed to test configuration Jay-Computer:~/Desktop/numpy-1.0rc2 jayparlar$ It's failing on this: result = config_cmd.try_run(tc,include_dirs=[python_include], library_dirs = default_lib_dirs) if not result: raise ERROR: Failed to test configuration Here, config_cmd is a distutils.command.config.try_run Does anyone recognize this error? I'm looking in the direction of the gcc: cannot specify -o with -c or -S and multiple compilations as the root of my problem. Some weird combination of gcc3.3, Python2.5 and OS X 10.3.9 seems to be causing it. I'd really appreciate any insight into this, but totally understand if no one has any ideas :) Jay P. ___ Distutils-SIG maillist - Distutils-SIG@python.org
Re: [Distutils] numpy build fails in distutils code
On 10/14/06, Phillip J. Eby [EMAIL PROTECTED] wrote: At 11:10 AM 10/14/2006 -0400, Jay Parlar wrote: I've tried asking this on the numpy list (a few times), but unfortunately no response. Since the error *appears* to be inside distutils, I thought maybe someone here would recognize it. Nope, it's a numpy.distutils error; notice that the bottom of the traceback is all from numpy code. Distutils also has no config command, so that bit's coming from numpy.distutils also. Yeah, the exception is generated in numpy code, but the reason the exception is being raised is because of the 'if not result' check. The 'result' variable gets its value assigned by the config_cmd.try_run() method, which comes from distutils. The relevant numpy code that creates the 'config_cmd' object is: def get_cmd(cmdname, _cache={}): if not _cache.has_key(cmdname): import distutils.core dist = distutils.core._setup_distribution if dist is None: from distutils.errors import DistutilsInternalError raise DistutilsInternalError( 'setup distribution instance not initialized') cmd = dist.get_command_obj(cmdname) _cache[cmdname] = cmd return _cache[cmdname] Could it be that the Python 2.5 universal binary is compiled with a different version of gcc? Would that cause an error? My gcc is 3.3, but if the 2.5 binary was built on OS X Tiger, then the gcc was probably 4.0. Would distutils look at that when trying to build code? Jay P. ___ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
[Distutils] Twisted and easy_install
I'm having trouble doing an install of the newest Twisted from the Cheeseshop, using easy_install. I took a quick look through the archives of distutils-sig, and couldn't find anything. I'm running on OS X 10.3.9, latest version of setuptools (did an 'easy_install -U setuptools' right before I tried installing Twisted). I've pasted the result below. Any thoughts? Searching for twisted Reading http://www.python.org/pypi/twisted/ Couldn't find index page for 'twisted' (maybe misspelled?) Scanning index of all packages (this may take a while) Reading http://www.python.org/pypi/ Reading http://www.python.org/pypi/Twisted/2.1.0 Reading http://www.twistedmatrix.com Reading http://twistedmatrix.com/projects/core/ Best match: Twisted 2.1.0 Downloading http://tmrc.mit.edu/mirror/twisted/Twisted/2.1/Twisted-2.1.0.tar.bz2 Processing Twisted-2.1.0.tar.bz2 Running Twisted-2.1.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-ssfbd7/Twisted-2.1.0/egg-dist-tmp--DvGj- Traceback (most recent call last): File /Library/Frameworks/Python.framework/Versions/2.4/bin/easy_install, line 7, in ? sys.exit( File /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/setuptools-0.6a9-py2.4.egg/setuptools/command/easy_install.py, line 1138, in main setup(script_args = ['-q','easy_install', '-v']+argv, **kw) File /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/distutils/core.py, line 149, in setup dist.run_commands() File /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/distutils/dist.py, line 946, in run_commands self.run_command(cmd) File /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/distutils/dist.py, line 966, in run_command cmd_obj.run() File /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/setuptools-0.6a9-py2.4.egg/setuptools/command/easy_install.py, line 230, in run self.easy_install(spec, not self.no_deps) File /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/setuptools-0.6a9-py2.4.egg/setuptools/command/easy_install.py, line 317, in easy_install return self.install_item(spec, download, tmpdir, deps) File /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/setuptools-0.6a9-py2.4.egg/setuptools/command/easy_install.py, line 338, in install_item dists = self.install_eggs(spec, download, tmpdir) File /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/setuptools-0.6a9-py2.4.egg/setuptools/command/easy_install.py, line 532, in install_eggs return self.build_and_install(setup_script, setup_base) File /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/setuptools-0.6a9-py2.4.egg/setuptools/command/easy_install.py, line 807, in build_and_install self.run_setup(setup_script, setup_base, args) File /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/setuptools-0.6a9-py2.4.egg/setuptools/command/easy_install.py, line 796, in run_setup run_setup(setup_script, args) File /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/setuptools-0.6a9-py2.4.egg/setuptools/sandbox.py, line 26, in run_setup DirectorySandbox(setup_dir).run( File /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/setuptools-0.6a9-py2.4.egg/setuptools/sandbox.py, line 63, in run return func() File /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/setuptools-0.6a9-py2.4.egg/setuptools/sandbox.py, line 29, in lambda {'__file__':setup_script, '__name__':'__main__'} File setup.py, line 113, in ? File ./twisted/python/dist.py, line 69, in setup File /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/distutils/core.py, line 149, in setup dist.run_commands() File /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/distutils/dist.py, line 946, in run_commands self.run_command(cmd) File /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/distutils/dist.py, line 966, in run_command cmd_obj.run() File /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/setuptools-0.6a9-py2.4.egg/setuptools/command/bdist_egg.py, line 167, in run self.run_command(egg_info) File /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/distutils/cmd.py, line 333, in run_command self.distribution.run_command(command) File /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/distutils/dist.py, line 966, in run_command cmd_obj.run() File /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/setuptools-0.6a9-py2.4.egg/setuptools/command/egg_info.py, line 129, in run writer(self, ep.name, os.path.join(self.egg_info,ep.name)) File
Re: [Distutils] Twisted and easy_install
On 2/5/06, Bob Ippolito [EMAIL PROTECTED] wrote: On Feb 5, 2006, at 10:22 AM, Phillip J. Eby wrote: [snip] Twisted does some interesting mangling of the build_ext process in order to support optional extensions, that are only determined at build time. I've been meaning to add a facility to do this in setuptools, but it's not done yet, and in any case Twisted would have to *use* that facility in order for it to work. I'm afraid Twisted isn't supportable by easy_install at the present time. Not only that, but the top-level script for Twisted isn't distutils based. It is a script that invokes several setup.py files for each of the subprojects if given build or install as options, and otherwise takes totally different arguments. Even if it did install with easy_install it would be a little misleading since Twisted requires Zope.Interface and has a bunch of extras (like SSL or serial support). Twisted really could use a good refactor to support setuptools, but the core team isn't interested in doing that. I believe Zope.Interface is not compatible with setuptools also. I'm not sure why... I think it's the distribution name or something. That's more or less what I figured. I mostly wanted to post the error message because it's non-obvious what went wrong, and wanted to make sure someone in the know saw it. I think I still remember how to install packages the old fashioned way, something or other about 'setup.py install' :) Jay P. ___ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
Re: [Distutils] py2exe and eggs
Sorry to relaunch this topic, but I continue to have general problems with eggs and py2exe. Is there any way that easy_install can be used to install an egg, but un-egg it, ie. install it into a directory in site-packages, as would normally be done if just distutils were being used? I love that RuleDispatch and PyProtocols are now distributed as eggs, but if I could somehow install them without them being eggs, that'd be very useful (to me, and some colleagues). Or is my only option right now to check them out of SVN, modify setup.py, and install like that? Jay P. On 8/16/05, Jay Parlar [EMAIL PROTECTED] wrote: On 8/16/05, Kevin Dangoor [EMAIL PROTECTED] wrote: Your eggs.pth should appear in the generated exe directory, right next to your exe file itself, and should have the names of the eggs without any other path on them (just the basename). That's exactly what I've got, but it's a no-go. I'll keep trying. On 8/16/05, Phillip J. Eby [EMAIL PROTECTED] wrote: If all else fails, 'import site; addsitedir(.)' might do the trick. That seems to work about as well as sys.path.append(.), but I still need to do individual pkg_resources.require(...) calls in my main file. I guess until py2exe becomes egg aware, it's all going to be nasty hacks anyway. Thanks for all the help. Jay P. ___ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
Re: [Distutils] py2exe and eggs
I followed the steps, but I believe I'm missing something basic about eggs in general. The py2exe result now has the two egg files in it, but the only way I'm actually able to import them is by doing: sys.path.append('.') pkg_resources.require(RuleDispatch) pkg_resources.require(PyProtocols) at the top of my main .py file. That doesn't seem like the right thing to do... pkg_resources.find_distributions(.) can find the distibutions fine, but how do I tell the runtime that it should look on . for eggs, without having to append to sys.path? Thanks, Jay P. On 8/16/05, Kevin Dangoor [EMAIL PROTECTED] wrote: On 8/16/05, Jay Parlar [EMAIL PROTECTED] wrote: Any solutions to this? I don't mind a solution that requires me to add something to setup.py that can automatically find any of the eggs I use, but I'd really like to avoid adding something to setup.py for *each* egg I use. My solution to this is ugly, but it's not much code (about 50 lines of trivial stuff) and didn't require delving into py2exe itself. py2exe really tries to minimize your distribution size and get rid of all unused modules. My method takes the eggs wholesale, so it's not quite as space efficient. Here's what I do: 1) get the list of Distributions using pkg_resources.require(), as Phillip suggests 2) keep track of the packages in the egg (using the egg's metadata.get_metadata_lines('top_level.txt')) 3) if the egg is pointing to a directory, add all of the files there to data_files. If it's a zipped up egg, just add the .egg file to data_files 4) finally, after building the exe, I create a new library.zip file that doesn't contain the packages found in step 2. (So, it's not a minimal set of packages and modules, but it at least isn't duplicating packages!) It's not pretty, but it does work. And, in my case, this process works with both py2exe and py2app and was less work than modifying both of those packages to do something with the eggs. Kevin ___ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
Re: [Distutils] py2exe and eggs
On 8/16/05, Kevin Dangoor [EMAIL PROTECTED] wrote: Your eggs.pth should appear in the generated exe directory, right next to your exe file itself, and should have the names of the eggs without any other path on them (just the basename). That's exactly what I've got, but it's a no-go. I'll keep trying. On 8/16/05, Phillip J. Eby [EMAIL PROTECTED] wrote: If all else fails, 'import site; addsitedir(.)' might do the trick. That seems to work about as well as sys.path.append(.), but I still need to do individual pkg_resources.require(...) calls in my main file. I guess until py2exe becomes egg aware, it's all going to be nasty hacks anyway. Thanks for all the help. Jay P. ___ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig