latest attempt on a Mac
  • Vote Up0Vote Down ShaneShane
    Posts: 3Member
    Hello,

    but when I run the script (./createbooktype --check-versions --database sqlite $HOME/mybooktype) I keep getting this error:







    p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Menlo; color: #000000; background-color: #ffffff}
    span.s1 {font-variant-ligatures: no-common-ligatures}



      File "./createbooktype", line 33


        print msg


                ^


    SyntaxError: Missing parentheses in call to 'print'. Did you mean print(print msg)?



    I am stumped as to how to solve this. Could anyone give a suggestion please? Thank you!
  • 5 Comments sorted by
  • Vote Up0Vote Down Daniel JamesDaniel James
    Posts: 833Member, Sourcefabric Team
    Hi Shane,
    I had not experienced this error on GNU/Linux, it sounds like you might be using Python 3 to run a script written for Python 2. What does this command output please?

    python --version
    Post edited by Daniel James at 2018-06-21 05:31:37
  • Vote Up0Vote Down ShaneShane
    Posts: 3Member
    Ok, sure enough, it is Python 3 - Python 3.6.3 :: Anaconda, Inc.
    p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Menlo; color: #000000; background-color: #ffffff}
    span.s1 {font-variant-ligatures: no-common-ligatures}
  • Vote Up0Vote Down Daniel JamesDaniel James
    Posts: 833Member, Sourcefabric Team
    Hi Shane,

    This probably means you only have Python 3 installed, or it is set as the default. For the time being you need to have Python 2.7.x installed to run Booktype. Please see http://docs.python-guide.org/en/latest/starting/install/osx/ for some tips.

    Cheers!

    Daniel
  • Vote Up0Vote Down ShaneShane
    Posts: 3Member
    Ahh, I see. Can I utilize virtualenv to install Booktype? If so, would I do the following?:

    virtualenv -p /usr/bin/python2.7 mybooktypeproject
    source mybooktypeproject/bin/activate
    then;
    easy_install pip
    pip install -r booktype/requirements/dev.txt

    Again, thanks!
  • Vote Up0Vote Down Daniel JamesDaniel James
    Posts: 833Member, Sourcefabric Team
    Hi Shane,

    A virtualenv is optional. If you are installing Booktype on a machine running lots of other Python programs (such as your desktop machine) it would be beneficial, to prevent conflicting versions of Python dependencies being installed for some other program. If you are installing on a server dedicated to running Booktype it is probably not necessary.

    As for the -p argument to the virtualenv command, that might be required if Python 2.7 is not the default on your machine. On GNU/Linux, the python command is usually a symlink to /usr/bin/python2.7 but that may not be the case on your Mac.

    While installing pip, you might as well upgrade your copy of setuptools:
    easy_install -U setuptools
    Please see the GNU/Linux install guide for more tips, as this is better tested than the OS X instructions:


    Cheers!

    Daniel