This repository was archived by the owner on Apr 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 48
PyCharm IDE
fonsecareyna82 edited this page Jul 17, 2018
·
11 revisions
- Download PyCharm's community version here. Install following the instructions for your platform.
- Clone Scipion git repository in your machine:
git clone https://github.com/I2PC/scipion.git
- Create a new Scipion project (Choose "open" in the open project dialog and select your scipion directory).
There is a couple of commands that we need to run before starting PyCharm in order to be able to debug Scipion and use the "Attach to local process" option. A handy way is to generate PyCharm's command line launcher and modify it:
1a. Edit .bashrc file and include LD_LIBRARY_PATH= /software/lib/
1b. Generate Pycharm's command line launcher
Click on Tools > Create command line launcher...
and type the desired path to the script.
1c. Find PyCharm's command line launcher if already have one
$ which charm
/usr/local/bin/charm
- Open the init script as root
$ sudo vim /usr/local/bin/charm
- In the function
def process_args(argv):
, add the code in bold. Remember to replace<your-scipion-home>
with the right path and save your changes:
... elif arg == 'merge' and i == 0: args.append(arg) elif arg == 'debug': os.system("export LD_LIBRARY_PATH=<your-scipion-home>/software/lib/") os.system("echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope") elif arg == '-l' or arg == '--line': ...
- Start pycharm from your terminal with your new debug option - will prompt you to enter your password.
$ charm debug
[sudo] password for <your-user>:
- Happy debugging!