Skip to content
This repository has been archived by the owner on Apr 26, 2023. It is now read-only.

PyCharm IDE

yaizar edited this page Apr 20, 2017 · 11 revisions

PyCharm IDE

Getting started

  • 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 (File -> New Project. Enter your Scipion directory in Location).

Debugging

There is a couple of commands that we need to run before starting PyCharm in order to be able to debug and use the "Attach to local process" option. A handy way is to modify PyCharm's init script:

  1. Find PyCharm's init script
$ which charm
/usr/local/bin/charm
  1. Open the init script as root
$ sudo vim /usr/local/bin/charm
  1. 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':
...
  1. Start pycharm from your terminal with your new debug option - will prompt you to enter your password.
$ charm debug
[sudo] password for <your-user>:
  1. Happy debugging! 👽
Clone this wiki locally