LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-17-2016, 03:00 AM   #1
mdooligan
Member
 
Registered: Feb 2009
Location: Vancouver BC
Distribution: Mandrake10/ArchHackery/Gentoo
Posts: 179

Rep: Reputation: 22
./configure error: what's wrong with these lines?


Here's the error messages:
Code:
checking for Python include path...   File "<string>", line 1
    import distutils.sysconfig;                                    print distutils.sysconfig.get_python_inc();
                                                                                 ^
SyntaxError: invalid syntax

checking Python linker flags...   File "<string>", line 1
    from distutils.sysconfig import *;                       from string import join;                       print join(get_config_vars('VERSION'))
                                                                                                                     ^
SyntaxError: invalid syntax
  File "<string>", line 1
    from distutils.sysconfig import *;                                    from string import join;                                    print '-L' + PREFIX + '/lib',                                    '-lpython';
                                                                                                                                               ^
SyntaxError: invalid syntax
and these are the corresponding lines from configure:
Code:
  # Check for Python include path
  # if PYTHON_INCLUDES is set, do not do anything
  echo "\$PYTHON=$PYTHON"
  if test $python_found = yes; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python include path" >&5
$as_echo_n "checking for Python include path... " >&6; }

      if test -z "$PYTHON_INCLUDES"; then
          python_path=`$PYTHON -c "import distutils.sysconfig; \
                                   print distutils.sysconfig.get_python_inc();"`
          if test -n "${python_path}"; then
              python_path="-I$python_path"
          fi
          PYTHON_INCLUDES=$python_path
      fi

      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_INCLUDES" >&5
$as_echo "$PYTHON_INCLUDES" >&6; }

  fi

  # Check for Python linker flags
  # if PYTHON_LIBS is set, do not do anything
  if test $python_found = yes; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking Python linker flags" >&5
$as_echo_n "checking Python linker flags... " >&6; }

      if test "x$PYTHON_LIBS" = "x"; then
          # (makes two attempts to ensure we've got a version number
          # from the interpreter)
          py_version=`$PYTHON -c "from distutils.sysconfig import *; \
                      from string import join; \
                      print join(get_config_vars('VERSION'))"`
          if test "x$py_version" = "xNone"; then
              if test "x$PYTHON_VERSION" != "x"; then
                  py_version=$PYTHON_VERSION
              else
                  py_version=`$PYTHON -c "import sys; \
                              print sys.version[:3]"`
              fi
          fi

          PYTHON_LIBS=`$PYTHON -c "from distutils.sysconfig import *; \
                                   from string import join; \
                                   print '-L' + PREFIX + '/lib', \
                                   '-lpython';"`$py_version
      fi

      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_LIBS" >&5
$as_echo "$PYTHON_LIBS" >&6; }

  fi
I know python is finicky about whitespace so I twiddled with that, but it did nothing. This is from a proper package tarball too.
 
Old 02-17-2016, 03:09 AM   #2
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
It may be an issue with the python version you have vs. whatever was used by the authors.
 
Old 02-17-2016, 07:09 AM   #3
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,852
Blog Entries: 1

Rep: Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868
If you're lucky, you will find an option like --without-python or similar.
 
Old 02-18-2016, 03:03 AM   #4
mdooligan
Member
 
Registered: Feb 2009
Location: Vancouver BC
Distribution: Mandrake10/ArchHackery/Gentoo
Posts: 179

Original Poster
Rep: Reputation: 22
Quote:
Originally Posted by NevemTeve View Post
If you're lucky, you will find an option like --without-python or similar.
Indeed. That's what I did: with-python=no.

Python2.7 vs 3.x I guess. They changed something syntactically? *shakes head* The way python parses -c commands? I have 2.7 and 3.something. I couldn't get it to use either one.

OK. Thank you very much. I'll move along...
 
Old 02-18-2016, 08:57 AM   #5
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,774

Rep: Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081
Quote:
Originally Posted by mdooligan View Post
Python2.7 vs 3.x I guess. They changed something syntactically?
Yes, specifically the print statement is changed in 3.x to a function call.

Print Is A Function
 
Old 02-18-2016, 09:41 AM   #6
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,852
Blog Entries: 1

Rep: Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868
(If python3 had an other name (boa, for example) people wouldn't think that python and python3^W boa are compatible.)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP 5.4 configure error: wrong mysql library version or lib not found stephenb Linux - Server 2 03-27-2013 08:38 AM
[SOLVED] php 5.3 - configure: error: wrong mysql library version or lib not found. kingkashif Linux - Software 3 09-20-2011 03:52 AM
configure error: configure: error: cannot execute: /usr/local/bin/arm-apple-darwin-ld GunNam Linux - General 0 10-24-2008 08:26 PM
Adding buildscripts or ./configure lines to packages piete Slackware 18 09-12-2008 12:24 PM
./configure What am i doing wrong? tied2 Linux - Software 10 09-16-2002 06:02 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:20 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration