I want to try out PyCharm for sage mathematics development. Normally I run eclipse to do sage development, but now I want to try it with PyCharm.
To launch eclipse with sage environment variables, in command line I normally do the following:
sage -sh
cd /path/to/eclipse
./eclipse
The first line loads the sage environment variables, the remainder launches eclipse. How can I do the same thing for pyCharm? (note I am using a Mac and Ubuntu for sage development; the commands above are agnostic to both OSes)
I normally alias using built-in application launcher (open) from OS X:
Then I can type:
Though you can't (easily) pass args to PyCharm, if you want a quick way to open files (without needing to use full pathnames to the file), this does the trick.
Useful information for some:
On Linux, installing PyCharm as a snap package automatically creates the command-line launcher named pycharm-professional, pycharm-community, or pycharm-educational. The Tools | Create Command-line Launcher command is therefore not available.
open /Applications/PyCharm\ CE.app/
opens up the primary Pycharm Dialogue box to choose the project..worked for me with
macOS 10.13.6
&Pycharm 2018.1
Update
It is now possible to create command line launcher automatically from JetBrains Toolbox. This is how you do it:
Generate shell scripts
;Shell script location
textbox with the location where you want the launchers to reside. You have to do this manually it will not fill automatically at this time!On Mac the location could be
/usr/local/bin
. For the novices, you can use any path inside the PATH variable or add a new path to the PATH variable in your bash profile. Useecho $PATH
to see which paths are there.Note! It did not work right away for me, I had to fiddle around a little before the scripts were generated. You can go to the gearbox of the IDEA (PyCharm for example) and see/change the launcher name. So for PyCharm, the default name is
pycharm
but you can change this to whatever you prefer.Original answer
If you do not use the toolbox you can still use my original answer.
~~For some reason, the
Create Command Line Launcher
is not available anymore in 2019.1.~~ Because it is now part of JetBrains ToolboxThis is how you can create the script yourself:
If you already used the charm command before use
type -a charm
to find the script. Change the pycharm version in the file paths. Note that the numbering in the first variableRUN_PATH
is different. You will have to look this up in the dir yourself.If you did not use the charm command before, you will have to create it.
Create the charm file somewhere like this:
/usr/local/bin/charm
Then add this code (change version number to your version as explained above):
This worked for me on my 2017 imac macOS Mojave (Version 10.14.3).
Open your ~/.bash_profile:
nano ~/.bash_profile
Append the alias:
alias pycharm="open /Applications/PyCharm\ CE.app"
Update terminal:
source ~/.bash_profile
Assert that it works:
pycharm
To open PyCharm from the terminal in Ubuntu 16.04, cd into
which in my case was
and then type: