PJA1
PJA1

Reputation: 21

Open IDLE from Linux server

I am learning by using IDLE directly from my Mac.

I tried to do the same thing on a Linux server that I have access to, but I couldn't open IDLE there.

Here are things that I have tried:

$ idle 
==> -bash: /usr/local/Python-2.7.3/bin/idle: /usr/local/python-2.7.3/bin/python2.7: bad interpreter: No such file or directory


$ /usr/local/Python-2.7.3/bin/idle
==> -bash: /usr/local/Python-2.7.3/bin/idle: /usr/local/python-2.7.3/bin/python2.7: bad interpreter: No such file or directory

What am I doing wrong?

Upvotes: 2

Views: 1368

Answers (2)

Paul
Paul

Reputation: 7335

Have you tried connecting to the server via ssh -X username@ipaddress

The -X tells ssh to forward X11 data.

As others have said, though your errors look more like the idle/python combo on the server is not quite correct. After you have fixed those problems you will likely need the -X option to ssh.

Upvotes: 1

janos
janos

Reputation: 124666

It seems your script has a first line like this:

#!/usr/local/python-2.7.3/bin/python2.7

But the file /usr/local/python-2.7.3/bin/python2.7 does not exist.

In most modern systems, if you change the first line of your script like this then it should work:

#!/usr/bin/env python2.7

When you write it this way, bash will use the python2.7 interpreter, wherever it is. This is the modern way of writing Python scripts, because if you hardcode paths like /usr/local/python-2.7.3/bin/python2.7 then the script will only work in systems where Python is installed at that exact location, which is not flexible.

UPDATE

Actually, on a closer look, it seems that maybe you just need to rename the /usr/local/Python-2.7.3 directory to /usr/local/python-2.7.3 on the server. That is, all lowercase.

Upvotes: 0

Related Questions