port select python and config error
Mark Brethen
mark.brethen at gmail.com
Sun Oct 28 22:03:56 UTC 2018
It looks to me that it failed because the source does not provide a ‘setup.py’ configuration file. Apple must provide a default setup.
Mark Brethen
mark.brethen at gmail.com
> On Oct 28, 2018, at 4:50 PM, Mark Brethen <mark.brethen at gmail.com> wrote:
>
> brethen-air:~ marbre$ port select --summary
> Warning: port definitions are more than two weeks old, consider updating them by running 'port selfupdate'.
> Name Selected Options
> ==== ======== =======
> clang none mp-clang-6.0 none
> cython none cython36 none
> gcc none mp-gcc7 none
> ipython py34-ipython none
> llvm none mp-llvm-3.4 mp-llvm-6.0 none
> mpi none mpich-mp-fortran none
> nosetests none nosetests36 none
> pip pip34 none
> py-sympy py36-sympy py36-sympy none
> python python27 python26-apple python27 python27-apple python36 none
> python2 python27 python26-apple python27 python27-apple none
> python3 python36 python36 none
> wxWidgets none wxWidgets-3.0 none
>
> With macports python 2.7 it’s a different error:
>
> :info:build /opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: can't open file 'setup.py': [Errno 2] No such file or directory
> :info:build Command failed: cd "/opt/local/var/macports/build/_Users_marbre_ports_math_reduce/libreduce/work/Reduce-svn4765-src/generic/libreduce/x86_64-mac_10.12_sierra-darwin16.7.0" && /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 setup.py --no-user-cfg build
> :info:build Exit code: 2
> :error:build Failed to build libreduce: command execution failed
> :debug:build Error code: CHILDSTATUS 96796 2
> :debug:build Backtrace: command execution failed
> :debug:build while executing
> :debug:build "system {*}$notty {*}$nice $fullcmdstring"
> :debug:build invoked from within
> :debug:build "command_exec build"
> :debug:build (procedure "portbuild::build_main" line 8)
> :debug:build invoked from within
> :debug:build "$procedure $targetname"
> :error:build See /opt/local/var/macports/logs/_Users_marbre_ports_math_reduce/libreduce/main.log for details.
>
> <main.log>
>
>
> Mark Brethen
> mark.brethen at gmail.com
>
>
>
>> On Oct 28, 2018, at 4:25 PM, Ryan Schmidt <ryandesign at macports.org> wrote:
>>
>>
>>
>> On Oct 28, 2018, at 16:08, Mark Brethen wrote:
>>
>>> Quite by accident I have discovered a flaw with my libreduce port as regards to "port select —set python". I had not set a default python version before I built the reduce libraries, unaware it was using apple's system python 2.7 to build. However, when I set a python version using port select —set python and add the python group, libreduce fails at configure. There is a file ‘ac_python_devel.m4’ in the source directory that is throwing the error (see attached). I’m not sure why builds with apple’s python and not macports.
>>>
>>> <main.log><ac_python_devel.m4>
>>
>> Which version of python did you select?
>>
>> The error shown in your log is:
>>
>> :info:configure checking for python... /opt/local/bin/python
>> :info:configure checking for a version of Python >= '2.1.0'... File "<string>", line 1
>> :info:configure import sys, string; ver = string.split(sys.version)[0]; print ver >= '2.1.0'
>> :info:configure ^
>> :info:configure SyntaxError: invalid syntax
>> :info:configure no
>>
>> If I pass that code to MacPorts python2.7 it works fine. If I pass it to MacPorts python3.5 it shows an invalid syntax error, because it is: python3 changed the syntax of the print command. It's now a function, not a language construct, so parentheses need to be used.
>>
>> In addition, string.split is gone in python3.
>>
>> Code that works with both python2 and python3 is:
>>
>> import sys, string; ver = sys.version.split()[0]; print(ver >= '2.1.0')
>>
>> You might suggest that to the developers of this software.
>>
>> Using a string comparison operator on version numbers is probably wrong too.
>>
>> If the configure script's code wasn't compatible with python3, who knows if the rest of the project's python code is. If it's not, easiest to just force the port to use /usr/bin/python. Setting "configure.python /usr/bin/python" might do that.
>>
>
More information about the macports-dev
mailing list