Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
- 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
1b. Generate Pycharm's command line launcher
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!