0

On a new setup of Ubuntu lts 20.04, I installed ipython thru anaconda3.

I decided to setup a desktop shortcut so that all I had to do was double-click an ipython icon and then the interpretor would pop-up. In windows this is quite straight forward. But being a newbie this has turned into a black hole with many wasted hours.

First, I figured out how to setup a script file to run in terminal to launch the interpretor. Once the the script was written, I checked the permissions->Execute (allow executing file as a program). I executed the script in a terminal window, it then opened another terminal window and ran the interpretor.

 file: ipython.sh
 #!/bin/bash
 gnome-terminal -- bash -c "ipython; exec bash"

Second, I figured out how to setup a desktop shortcut launcher. Once the .desktop file was written I right-clicked on the icon on the desktop and clicked on 'Allow launching'. The desktop icon then changed to the .png file I had saved in my pictures folder.

 file: ipython.desktop
 [Desktop Entry]
 Version=1.0
 Name=Ipython
 Comment=Ipython Interpretor
 Exec=/home/user/Desktop/ipython.sh
 Icon=/home/user/Pictures/ipython.png
 Type=Application
 Actions=new-window;preferences;
 Terminal=true

 [Desktop Action new-window]
 Name=New Window
 Exec=gnome-terminal --window

 [Desktop Action preferences]
 Name=Preferences
 Exec=gnome-terminal --preferences

This is where I'm stuck. When I double-click on the ipython.desktop icon, a terminal windows opens. The interpretor does not run; there are only 2 lines displayed in terminal:

 bash: ipython: command not found
 user@ubuntupc:~$

The 3 sources that got me this far are:

how can I open a extra console and run a program in it with one command?

https://linuxconfig.org/how-to-create-desktop-shortcut-launcher-on-ubuntu-20-04-focal-fossa-linux

.desktop files not launching from desktop in Ubuntu 20.04 LTS

One user (heynnema) suggested moving the files to different folders, but that didn't work. I'd like to find out if I'm going in the right direction or if this is more complicated then expected? I'm sure I will probably need to do this again in the future. Any help would be appreciated!

5
  • What is the output of type -a ipython?
    – Kulfy
    Jul 9, 2020 at 6:00
  • In a terminal window when I type 'python' the interpretor starts. Typing '-a ipython' the reply is '-a: command not found'. Typing 'ipython -a' the reply is about 50 lines explaining the syntax options for starting ipython. I hope this is what you were referring to.
    – ChicoCR
    Jul 9, 2020 at 20:27
  • type is the actual command. -a is the option and ipython is the parameter.
    – Kulfy
    Jul 11, 2020 at 8:08
  • Sorry, learn something new everyday. The output from the command is: "ipython is /home/'user'/anaconda3/bin/ipython". This was the default location used by the anaconda installer.
    – ChicoCR
    Jul 13, 2020 at 4:42
  • Does bash: ipython: command not found appear when you start terminal? What are the contents of /home/user/Desktop/ipython.sh?
    – Kulfy
    Jul 14, 2020 at 16:27

0

You must log in to answer this question.

Browse other questions tagged .