Search code examples
pythonlinuxphpsh

Installing phpsh on Turnkey Linux and cannot built setup.py


I've got a virtual machine running a Turnkey Linux lamp stack and I've been trying to install phpsh for testing out bits of php development.

I've downloaded the source from github like so

git clone git://github.com/facebook/phpsh.git

But then when I cd into the phpsh folder and try to build the setup.py using:

python setup.py build

I get the error message:

Traceback (most recent call last):
File "setup.py", line 13, in <module>
p = Popen(["make", "-C", make_dir])
File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1259, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory 

Which kind of makes sense since there is no /usr/lib/python2.7 directory.

There is, however, an etc/python2.7 directory which makes me think this is where it should be looking when trying to build the setup.py.

I have had a look in the setup.py file using the nano editor and couldn't find any reference to the python2.7 directory which makes me think that something else is telling it where to look - but what?

Any suggestions would be greatly appreciated.

Cheers.


Solution

  • [update] I know this question is old. But FWIW v14.0 TurnKey Linux has phpsh pre-installed on LAMP/LAPP based appliances.

    FWIW I can reproduce this issue on TurnKey LAMP 13.0

    However, Python should be there (in /usr/lib/python2.7). At least it is on my test server. FWIW have a look at the output of:

    whereis python
    

    /usr/lib/python2.7 should be one of the many results returned (again at least it was on mine).

    If you reread the error message, the file that is missing (which it's complaining about it) is 'make'!

    Try this:

    apt-get update && apt-get install build-essential
    

    Then you should find that

    python setup.py build
    

    now completes successfully! :)