My editors can't find Ruby or Python3

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
Old Geek
Level 1
Level 1
Posts: 20
Joined: Wed Sep 30, 2020 5:55 pm
Location: Canada

My editors can't find Ruby or Python3

Post by Old Geek »

Scite and geany use to work without configuration in the past. But now a can't execute anything from these editors.

But i got no problem of execution with the terminals.
Last edited by LockBot on Thu May 25, 2023 10:00 pm, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Linux Mint 21
Cinnamon
I7 intel
User avatar
karlchen
Level 23
Level 23
Posts: 18209
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: My editors can't find Ruby or Python3

Post by karlchen »

Perhaps you fiddled around a bit too much with Ruby outside the APT software management system, thus causing some unwanted side effects to other applications like e.g to your editors? -> Why you should'nt using linux packaging to install Ruby
Image
The people of Alderaan have been bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine for 771 days now.
Lifeline
Old Geek
Level 1
Level 1
Posts: 20
Joined: Wed Sep 30, 2020 5:55 pm
Location: Canada

Re: My editors can't find Ruby or Python3

Post by Old Geek »

And it would effect python too.... :roll:
Linux Mint 21
Cinnamon
I7 intel
User avatar
karlchen
Level 23
Level 23
Posts: 18209
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: My editors can't find Ruby or Python3

Post by karlchen »

Hello, Old Geek.

Just checked it here on my current system.
Geany is version is 1.37.1. - Cannot check Scite, because it is not installed here.

Geany 1.37.1 still defaults to invoking python as python. But by default there is no /usr/bin/python on this system any longer, only /usr/bin/python3.
Result:
When trying to compile a Python .py file, Geany complains that python cannot be found.
When trying to execute a Python .py file, Geany complains that python cannot be found.

Solution:
Go to the menu "Create". Select the item "Configure commands to create".
For Python change the commands for compiling and executing from python to python3.

Result:
Compiling and executing .py scripts from inside Geany works.

I would not be amazed if the same issue existed in Scite as well. The steps to solution should be similar then.

Regards,
Karl
Image
The people of Alderaan have been bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine for 771 days now.
Lifeline
Old Geek
Level 1
Level 1
Posts: 20
Joined: Wed Sep 30, 2020 5:55 pm
Location: Canada

Re: My editors can't find Ruby or Python3

Post by Old Geek »

Solution:
Go to the menu "Create". Select the item "Configure commands to create".
For Python change the commands for compiling and executing from python to python3.
i have the 1.38 version. i have [ file, edit, search, view, document, project, build, tools, help ]

I can't find "Create" .

I still can figuring out why Ruby is working with the terminal.
Linux Mint 21
Cinnamon
I7 intel
User avatar
karlchen
Level 23
Level 23
Posts: 18209
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: My editors can't find Ruby or Python3

Post by karlchen »

Hello, Old Geek.

Argh. One more instance, where translating back from my localized German speaking system to English does not give the genuine English term.
I bet that the English term was actually "Build". So the menu item should be "Build" and the item in this menu very likely reads "Configure build commands".

The cause why "python" is not found on more recent Ubuntu/Debian based systems is this:
+ python used to be a symlink pointing to python2 (directory /usr/bin)
+ python2 has disappeared from more recent Ubuntu/Debian systems. So has the symlink python.
+ So now you have to invoke python3.
+ Alternatively, you might create a symlink named python pointing to python3.

Karl
Image
The people of Alderaan have been bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine for 771 days now.
Lifeline
Old Geek
Level 1
Level 1
Posts: 20
Joined: Wed Sep 30, 2020 5:55 pm
Location: Canada

Re: My editors can't find Ruby or Python3

Post by Old Geek »

I made the change
no result.

Other weird thing i can't open the build-in terminal of geany.

I still have this error message when i am trying ruby
/tmp/geany_run_script_LQGRW1.sh: 7: ruby: not found


------------------
(program exited with code: 127)
Press return to continue
Linux Mint 21
Cinnamon
I7 intel
Old Geek
Level 1
Level 1
Posts: 20
Joined: Wed Sep 30, 2020 5:55 pm
Location: Canada

Re: My editors can't find Ruby or Python3

Post by Old Geek »

when i launch geany this way, it's working :

Code: Select all

geany -c /tmp/xxx 
I did the same thing with scite and it work for both interpreters...
Linux Mint 21
Cinnamon
I7 intel
User avatar
karlchen
Level 23
Level 23
Posts: 18209
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: My editors can't find Ruby or Python3

Post by karlchen »

Hello, Old Geek.

The Geany commandline option -c /tmp/xxx tells Geany on every startup to use the directory /tmp/xxx in order to create and save its configuration file geany.conf and some template files (cf. man geany).

The fact that using a new Geany configuration directory and hence a fresh Geany configuration makes Geany find python makes me wonder whether
+ either your current ~/.config/geany/geany.conf file is corrupted
+ or whether your current geany configuration is not owned by you, but by e.g. user root

Therefore I would like to suggest the following steps:
  • Close all open applications, specifically Scite and Geany of course.
  • Open a terminal window.
  • Execute the command

    Code: Select all

    sudo chown -R $USER:$USER $HOME
    precisely as it has been typed here.
    The command will re-instate your normal user account as the owner of everything inside your $HOME directory.
    This should have precisely 0 negative side effect, because your $HOME directory and everything inside it should be owned by you anyway.
  • Once the command has completed successfully, you log off from the graphical desktop.
  • Log back in.
  • Try Geany and Scite and please let us know, whether the reported problem invoking Ruby and Python still persist.
    In case your default configurations work correctly again, incorrect file ownership was the root cause.
    In case the old problems still persist, the root cause must be something else.
HTH,
Karl
--
P.S.:
Old Geek wrote: Sat Nov 26, 2022 9:45 amI have the 1.38 version.
Just updated my Geany to 1.38 as well.
Image
The people of Alderaan have been bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine for 771 days now.
Lifeline
Old Geek
Level 1
Level 1
Posts: 20
Joined: Wed Sep 30, 2020 5:55 pm
Location: Canada

Re: My editors can't find Ruby or Python3

Post by Old Geek »

same problem.

But it is working correctly if i am calling these programs with a terminal
Linux Mint 21
Cinnamon
I7 intel
User avatar
karlchen
Level 23
Level 23
Posts: 18209
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: My editors can't find Ruby or Python3

Post by karlchen »

Hello, Old Geek.

Your terse reply
same problem
does this mean that you tried the steps which I had given to you 2 posts above, but that they did not correct your Geany and Scite problems?

In your initial post you wrote:
Old Geek wrote: Fri Nov 25, 2022 9:37 amScite and geany use to work without configuration in the past. But now a can't execute anything from these editors.
When did this work last?
What has been changed, before your current problems with Geany and Scite started?

Note:
Geany and Scite will never work without configuration. In case you did not configure anything explicitly, both will use their default configuration files.

What precisely have you tried to find out why Geany, if started with its default configuration in ~/.config/geany/, behaves differently from Geany, if started by telling it to create a new configuration in /tmp/xxx/?

Have you e.g. compared the 2 geany.conf files in ~/.config/geany/ and in /tmp/xxx/?
If you did, what were the differences?
If you have not done so, please, do so and report back.

Also, you may like to share your Linux Mint System Information with us. Should have been the first thing to share from the very start by the way.
The steps how to do so can be found in this post over there: viewtopic.php?f=90&t=318644

Regards,
Karl
Image
The people of Alderaan have been bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine for 771 days now.
Lifeline
Old Geek
Level 1
Level 1
Posts: 20
Joined: Wed Sep 30, 2020 5:55 pm
Location: Canada

Re: My editors can't find Ruby or Python3

Post by Old Geek »

It's seem starting Firefox with a program from inside an editor is not a good idea. My guess: It create permanent zombie process unless you are setting firefox to always start with a new session.

And Ruby get tie up by this zombie process until you are restarting with a new session.

it is a guess because i close all my open files in Geany.

One of these 2 things did fixes the problem.

Thank for the assistance. it was a weird problem.
Linux Mint 21
Cinnamon
I7 intel
Locked

Return to “Software & Applications”