43

When I double-click on pycharm.sh, Ubuntu lets me choose between "Run in Terminal" and "Run". What is the difference between these options?

1
  • One potential issue by Run itself is that it sometimes could not load those packages that require bash environment, such as tensorflow in Pycharm(e.g. github.com/tensorflow/tensorflow/issues/9530), but it could Run in Terminal could achieve that. But it requires to launch Pycharm everytime from command line, therefore I vote up @Sachin G. 's answer
    – Jason
    Sep 5, 2018 at 23:06

9 Answers 9

75

To make it a bit more user-friendly: After you've unpacked it, go into the directory, and run bin/pycharm.sh. Once it opens, it either offers you to create a desktop entry, or if it doesn't, you can ask it to do so by going to the Tools menu and selecting Create Desktop Entry...

Then close PyCharm, and in the future you can just click on the created menu entry. (or copy it onto your Desktop)

To answer the specifics between Run and Run in Terminal: It's essentially the same, but "Run in Terminal" actually opens a terminal window first and shows you console output of the program. Chances are you don't want that :)

(Unless you are trying to debug an application, you usually do not need to see the output of it.)

14

The question is already answered, Updating answer to add the PyCharm bin directory to $PATH var, so that pycharm editor can be opened from anywhere(path) in terminal.

Edit the bashrc file,

nano .bashrc

Add following line at the end of bashrc file

export PATH="<path-to-unpacked-pycharm-installation-directory>/bin:$PATH"

Now you can open pycharm from anywhere in terminal

pycharm.sh

1
  • pycharm.sh: command not found Jan 16, 2023 at 16:13
3

For Pycharm CE 2018.3 and Ubuntu 18.04 with snap installation:

env BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/pycharm-community_pycharm-community.desktop /snap/bin/pycharm-community %f

I get this command from KDE desktop launch icon.

pychar-ce-command

Sorry for the language but I am a Spanish developer so I have my system in Spanish.

3

As mentioned in the above answer, by updating the bashrc file you can run the pycharm.sh from anywhere on the linux terminal.

But if you love the icon and wants the Desktop shortcuts for the Pycharm on Ubuntu OS then follow the Below steps,

 Quick way to create Pycharm launcher. 
     1. Start Pycharm using the pycharm.sh cmd from anywhere on the terminal or start the pycharm.sh located under bin folder of the pycharm artifact.
     2. Once the Pycharm application loads, navigate to tools menu and select “Create Desktop Entry..”
     3. Check the box if you want the launcher for all users.
     4. If you Check the box i.e “Create entry for all users”, you will be asked for your password.
     5. A message should appear informing you that it was successful.
     6. Now Restart Pycharm application and you will find Pycharm in Unity dash and Application launcher.."
1

First, go to that folder which is containing pycharm.sh and open terminal from there. Then type

./pycharm.sh

this will open pycharm.

bin folder contains pycharm.sh file.

1

You can launch PyCharm from terminal using pycharm-community or pycharm-professional if installed via snap. See here for more details: Location of PyCharm after install PyCharm as snap package

1

Official docs says if you have installed pycharm at this location: /opt/pycharm/bin/pycharm.sh then you can make it callable from terminal by using this command:

ln -s /opt/pycharm/bin/pycharm.sh /usr/local/bin/pycharm
0

Yes just go to terminal cd Downloads ls cd pycharm-community-2021.2.2 (your pycharm version) ls cd bin ls ./pycharm.sh

It will open your continued pycharm project

1
  • Your submission doesn't seem to answer the question (difference between "Run in Terminal" and "Run").
    – Phu Ngo
    Oct 20, 2021 at 4:18
0

I did the edit and added the PATH for my Pycharm in .bashrc but I was still getting the error "pycharm.sh: command not found". After trying several other things the following command resolved the issue which creates a symbolic link.

sudo ln -s /snap/pycharm-community/267/bin/pycharm.sh /usr/local/bin/pycharm

The first is location to the exact path to pycharm.sh and the second is user bin which should be on PATH env by default

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.