Re: wxPython Phoenix build fail ("Could not build python extensions"?) in pyenv 3.5.1 on Linux
Michael Freeman <[email protected]>
| Newsgroups | gmane.comp.python.wxpython.devel |
|---|---|
| Message-ID | <[email protected]> |
Yes, thanks :) Now the build works both with your method and by adding the
build flag for the "pyenv" build. At last. A bit of struggle for me
because, although I'm familiar with building Linux software from source I'm
quite new to Python.
So Blender loads up OK using the "pyenv" Python, but both the build I did
in "pyenv" *AND* the build to a wheel in "venv" (the wheel install replaced
the pip built version) throws this error ...
"Blender Game Engine Started
Python script error - object 'Platter', controller 'Globals':
Traceback (most recent call last):
File "getrotation.py", line 21, in <module>
File
"/home/michaelzfreeman/Downloads/blender-2.77-a5261e0-linux-glibc219-x86_64/2.77/python/lib/python3.5/site-packages/wx/__init__.py",
line 17, in <module>
from wx.core import *
File
"/home/michaelzfreeman/Downloads/blender-2.77-a5261e0-linux-glibc219-x86_64/2.77/python/lib/python3.5/site-packages/wx/core.py",
line 12, in <module>
from ._core import *
ImportError:
/home/michaelzfreeman/Downloads/blender-2.77-a5261e0-linux-glibc219-x86_64/2.77/python/lib/python3.5/site-packages/wx/_core.cpython-35m-x86_64-linux-gnu.so:
symbol _ZNK8wxWindow7IsShownEv, version WXU_3.0 not defined in file
libwx_gtk2u_core-3.0.so.0 with link time reference
Python module can't be imported - object 'Platter', controller 'setPitch':
Traceback (most recent call last):
File
"/home/michaelzfreeman/DJ_Barney_Docs/Docs/Forge/Music/Beat-Research-Forge/DJ
Turntable Platter Phyics
Simulation/dj_turntable_platter_physics_simulation_96_WITH_WXPYTHON.blend/getrotation.py",
line 21, in <module>
File
"/home/michaelzfreeman/Downloads/blender-2.77-a5261e0-linux-glibc219-x86_64/2.77/python/lib/python3.5/site-packages/wx/__init__.py",
line 12, in <module>
__version__ = wx.__version__.VERSION_STRING
AttributeError: module 'wx' has no attribute '__version__'"
This could be a build flag: "wxPython-dev › wxpython-3.0.0.0 and libnotify"
- https://groups.google.com/forum/#!topic/wxpython-dev/DGMlB7Gi4ss
But not being familiar with the build process I'm not sure how to pass the
build option.
MichaelZFreeman
On Saturday, September 3, 2016 at 4:40:44 AM UTC+1, Robin Dunn wrote:
>
>
> I've just set up a new Ubuntu 16.04 VM and tried my recipe below using a
> Python 3.5 venv (just to make sure it's clear, that is not the same thing
> as the pyenv tool you are using) and it was successful. The build
> automatically will look in the base (system in this case) Python for
> headers and libs and things that are not in the venv, because it is using
> python itself to give the location of those things.
>
> There was one unexepected error on the first try, but it turned out that I
> hadn't installed one of the python -dev packages. I had installed
> libpython3.5-dev but not python3.5-dev. You'll also need python3.5-venv.
>
> On the other hand, a bit of googling turned up some similar issues with
> pyenv that you are having. Apparently it does not default to building
> Python with the --enable-shared configure flag, and so it static links
> everything into the python executable instead of creating the library that
> waf is looking for. The following link is about OSX, but other pages about
> the problem on Linux pointed to this page too.
>
> https://github.com/yyuu/pyenv/wiki/Home/_compare/45570ea%5E...45570ea
>
> HTH,
> Robin
>
>
> Michael Freeman wrote:
>
> Thanks. Same error. BTW, if you don't know already, "pyenv" installs a
> fully built installation of Python just as if I had downloaded the source
> code it myself from the Python site and built then installed.
>
> There's things like *"err: /usr/bin/ld: cannot find -lpython3.5"* in
> http://files.djbarney.org/config.log.txt
>
> Look at around line 102 ...
>
> *"-L/home/michaelzfreeman/.pyenv/versions/3.5.1/lib', '-lpython3.5'] not
> found".*If I'm correct, it's like the build script is looking for what
> should be the system libraries ("libpython3.5-dev") in the virtual
> environment and not finding them. I'll try setting some system variables to
> point the build to the correct python libraries.
>
> So where are all the Linux experts in this forum ? I really need to get
> this build working.
>
> MichaelZFreeman
>
> On Friday, September 2, 2016 at 12:44:24 AM UTC+1, Robin Dunn wrote:
>>
>> I don't know anything about pyenv, but is there any reason to not use
>> Python 3.5's built-in virtual environment tool? Make sure that Ubuntu's
>> Python 3.5 package and the corresponding -dev package are installed,
>> download a Phoenix source tar file, and then try something like this:
>>
>> mkdir ~/tmp-phoenix-build
>> cd ~/tmp-phoenix-build
>> pyvenv-3.5 my-py35
>> source my-py35/bin/activate
>> pip install -U pip setuptools six wheel
>> pip wheel wxPython_Phoenix-3.0.3.dev2472+78ae39a.tar.gz
>>
>> You should end up with a .whl file in ~/tmp-phoenix-build which you can
>> install in this or other compatible Python 3.5 environments (real or
>> virtual) on your machine.
>>
>> Robin
>>
>>
>> Michael Freeman wrote:
>>
>> OK. I looked at this again.
>>
>> First I don't know how to confirm that my Linux (Ubuntu Xenial) Python
>> waf build system (in a "pyenv") is actually fully functional. This should
>> be done first as I've only ever installed pure Python modules that need no
>> compiling. It could be A. a problem with my Python install. B. Problem with
>> system gcc compiler ... and any number of other system problems. So is
>> there a waf test file, or at least a known good compile on Linux of some
>> other Python module ?
>>
>> But meanwhile here's a little sleuthing. The "Checking for header
>> Python.h: :-(" I thought might be a massive clue. Thought I'd missed the
>> obvious ! But Python system "dev" package is installed. But ...
>>
>> "python-config --includes
>> -I/home/michaelzfreeman/.pyenv/versions/3.5.1/include/python3.5m
>> -I/home/michaelzfreeman/.pyenv/versions/3.5.1/include/python3.5m"
>>
>> Correct path to "Python.h".
>>
>> Then it gives the "Getting pyext flags from python-config: Could not
>> build python extensions" ... but ...
>>
>> "python-config --ldflags
>> -L/home/michaelzfreeman/.pyenv/versions/3.5.1/lib/python3.5/config-3.5m
>> -L/home/michaelzfreeman/.pyenv/versions/3.5.1/lib -lpython3.5m -lpthread
>> -ldl -lutil -lm -Xlinker -export-dynamic"
>>
>> "pyext" is installed and I can see it.
>>
>> But looking at "waf" config.log: http://files.djbarney.org/config.log
>>
>> ... (that I did not see before, don't why this it not reported to
>> console) shows the real meat of the errors starting at line 418 ...
>>
>> "['/usr/bin/g++', '-shared', '-pthread', 'test.cpp.1.o', '-o',
>> '/tmp/pip-build-k2pgcq1x/wxPython-Phoenix/build/waf/3.5/.conf_check_9814a9ffc41959a7044afc7703702a3d/testbuild/
>> testprog.cpython-35m-x86_64-linux-gnu.so', '-Wl,-Bstatic',
>> '-Wl,-Bdynamic', '-L/home/michaelzfreeman/.pyenv/versions/3.5.1/lib',
>> '-L/home/michaelzfreeman/.pyenv/versions/3.5.1/lib/python3.5/config-3.5m',
>> '-lpython3.5m', '-lpthread', '-ldl', '-lutil', '-lm']
>> err: /usr/bin/ld:
>> /home/michaelzfreeman/.pyenv/versions/3.5.1/lib/libpython3.5m.a(pylifecycle.o):
>> relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making
>> a shared object; recompile with -fPIC
>> /home/michaelzfreeman/.pyenv/versions/3.5.1/lib/libpython3.5m.a: error
>> adding symbols: Bad value
>> collect2: error: ld returned 1 exit status"
>>
>> Could be some kind of 64 bit/32bit mismatch ? But I'm wildly guessing
>> here.
>>
>> So I need to find a way of testing my build environment first before
>> proceeding (see top).
>>
>> Michael Z Freeman
>>
>>
>
--
You received this message because you are subscribed to the Google Groups "wxPython-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.