Throwing this out there.. woes with Python 3.2 sysconfig and more..

I recently started migrating a Pyramid app to py3.2 and hit a uWSGI build issue 
with the python installer;

sysconfig.get_config_var returns 'gcc-4.2', which doesn't exist on my system, 
but py2.7 reports 'llvm-gcc-4.2' correctly.

I got uwsgi to compile by setting env 'CC=gcc', causing the installer to avoid 
sysconfig and use the os.environ.get value instead.

Then hit another error; Pip error info didn't help me much, but easy_install 
reports 'ld: library not found for -lpython3.2m'. lpython3.2m doesn't exist but 
python3.2m does.

I can see there is a problem with the Py3.2 sysconfig and not the uwsgi 
installer, but I'm scratching my head to diagnose the second error and wonder 
if it's symptomatic of the first?

I suspect an Apple/Darwin issue with Python3 ..anyone seem similar problems?

Best, S






Transcript below:


### Py3.2 - Install via pip - mis-reports gcc as ``gcc-4.2``. Installer gets 
'None' for dumpversion because it doesn't exist.

Traceback (most recent call last):

  File "uwsgiconfig.py", line 304, in __init__

    gcc_major = int(gcc_version.split('.')[0])

ValueError: invalid literal for int() with base 10: 'None'


(py3)$ python
Python 3.2.2 (v3.2.2:137e45f15c0b, Sep  3 2011, 17:28:59) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from distutils import sysconfig
>>> sysconfig.get_config_var('CC')
'gcc-4.2'
>>> quit()
(py3)$ gcc-4.2 -dumpversion
-bash: gcc-4.2: command not found

(py3)$ llvm-gcc-4.2 -dumpversion
4.2.1
(py3)$ llvm-gcc -dumpversion
4.2.1
(py3)$ gcc -dumpversion
4.2.1



### Py2.7 reports CC correctly

(py3)$ deactivate; cd ../py27; . bin/activate;
(py27)$ python
Python 2.7.1 (r271:86832, Jun 16 2011, 16:59:05) 
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from distutils import sysconfig
>>> sysconfig.get_config_var('CC')
'llvm-gcc-4.2'
>>> quit()
(py27)$ llvm-gcc-4.2 -dumpversion
4.2.1



### Py3.2 - Install via pip with env ``export CC=gcc`` - now there is a linking 
error

*** error linking uWSGI ***·
·
----------------------------------------·
·
Command /Users/simonyarde/development/py3/bin/python -c "import 
setuptools;__file__='/Users/simonyarde/development/py3/build/uwsgi/setup.py';exec(compile(open(__file__).read().replace('\r\n',
 '\n'), __file__, 'exec'))" install --single-version-externally-managed 
--record 
/var/folders/pb/6qk5pbtd6klfd020q1wnkhb40000gn/T/pip-1inrqx-record/install-record.txt
 --install-headers /Users/simonyarde/development/py3/include/site/python3.2 
failed with error code 1 in /Users/simonyarde/development/py3/build/uwsgi·
·
Exception information:·
Traceback (most recent call last):·
  File 
"/Users/simonyarde/development/py3/lib/python3.2/site-packages/pip-1.1-py3.2.egg/pip/basecommand.py",
 line 104, in main·
    status = self.run(options, args)·
  File 
"/Users/simonyarde/development/py3/lib/python3.2/site-packages/pip-1.1-py3.2.egg/pip/commands/install.py",
 line 250, in run·
    requirement_set.install(install_options, global_options)·
  File 
"/Users/simonyarde/development/py3/lib/python3.2/site-packages/pip-1.1-py3.2.egg/pip/req.py",
 line 1133, in install·
    requirement.install(install_options, global_options)·
  File 
"/Users/simonyarde/development/py3/lib/python3.2/site-packages/pip-1.1-py3.2.egg/pip/req.py",
 line 577, in install·
    cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)·
  File 
"/Users/simonyarde/development/py3/lib/python3.2/site-packages/pip-1.1-py3.2.egg/pip/__init__.py",
 line 256, in call_subprocess·
    % (command_desc, proc.returncode, cwd))·
pip.exceptions.InstallationError: Command 
/Users/simonyarde/development/py3/bin/python -c "import 
setuptools;__file__='/Users/simonyarde/development/py3/build/uwsgi/setup.py';exec(compile(open(__file__).read().replace('\r\n',
 '\n'), __file__, 'exec'))" install --single-version-externally-managed 
--record 
/var/folders/pb/6qk5pbtd6klfd020q1wnkhb40000gn/T/pip-1inrqx-record/install-record.txt
 --install-headers /Users/simonyarde/development/py3/include/site/python3.2 
failed with error code 1 in /Users/simonyarde/development/py3/build/uwsgi·




### Py3.2 - Install via easy_install with env ``export CC=gcc``

*** uWSGI linking ***
gcc -o /Users/simonyarde/development/py3/bin/uwsgi  utils.o protocol.o socket.o 
logging.o master.o master_utils.o emperor.o notify.o mule.o subscription.o 
plugins.o lock.o cache.o queue.o event.o signal.o cluster.o rpc.o gateway.o 
loop.o lib/rbtree.o lib/amqp.o rb_timers.o main.o proto/base.o proto/uwsgi.o 
proto/http.o proto/fastcgi.o async.o ini.o yaml.o ldap.o snmp.o sendfile.o 
xmlconf.o sqlite3.o spooler.o plugins/python/python_plugin.o 
plugins/python/pyutils.o plugins/python/pyloader.o 
plugins/python/wsgi_handlers.o plugins/python/wsgi_headers.o 
plugins/python/wsgi_subhandler.o plugins/python/web3_subhandler.o 
plugins/python/pump_subhandler.o plugins/python/gil.o 
plugins/python/uwsgi_pymodule.o plugins/python/profiler.o 
plugins/python/symimporter.o plugins/ping/ping_plugin.o plugins/cache/cache.o 
plugins/nagios/nagios.o plugins/rrdtool/rrdtool.o plugins/carbon/carbon.o 
plugins/rpc/rpc_plugin.o plugins/fastrouter/fastrouter.o plugins/http/http.o 
plugins/ugreen/ugreen.o plugins/signal/signal_plugin.o 
plugins/syslog/syslog_plugin.o plugins/rsyslog/rsyslog_plugin.o 
plugins/logsocket/logsocket_plugin.o -lpthread -lm -rdynamic -lldap -lxml2 -lz 
-lpthread -licucore -lm -lsqlite3 -ldl -framework CoreFoundation 
-L/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/config-3.2m 
-lpython3.2m
ld: library not found for -lpython3.2m
collect2: ld returned 1 exit status
*** error linking uWSGI ***
error: Setup script exited with 1

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to