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)
Inside the IDE, you can click in:
You can launch
Pycharm
from Mac terminal using the open command. Just typeopen /path/to/App
You're right that the JetBrains help page isn't very clear. On OS X, you'll want to use the launcher at:
Or, for community edition:
Unfortunately, adding a symlink to this binary wouldn't work for me (the launcher would crash). Setting an alias worked, though. Add this in your
.bash_profile
(or whatever shell you use):Then, you can run commands with simply
pycharm
.With this you can do things like open a project:
Or open a specific line of a file in a project:
Or view the diff of two files (they don't need to be part of a project):
Note that I needed to pass absolute paths to those files or PyCharm couldn't find them..
After installing on kubuntu, I found that my pycharm script in
~/bin/pycharm
was just a desktop entry:Obviously, I could not use this to open anything from the command line:
But there's a hint in the desktop entry file. Looking in
/snap/pycharm-community/
, I found/snap/pycharm-community/current/bin/pycharm.sh
. I removed~/bin/pycharm
(actually renamed it to have a backup) and then didwhere again, I found the start of the path by inspecting the desktop entry script I had to start with.
Now I can open files with pycharm from the command line. I don't know what I messed up during install this time; the last two times I've done fresh installs, it's had no trouble.
Use Tools -> Create Command-line Launcher which will install a python script where you can just launch the current working folder using charm .
Very important!
Anytime you upgrade your pyCharm you have to re-create that command line tool since its just a python script that points to a pyCharm configuration which might be outdated and will cause it to fail when you attempt to run
charm .
Navigate to the directory on the terminal
cd [your directory]
Navigate to the directory on the terminal
use
charm .
to open the project in PyCharmSimplest and quickest way to open a project in PyCharm