Skip to main content

How to Setup PyCharm?

Note: Choose Professional version.

PyCharm Setup

  • First, you need to connect HPC cluster and add a preferred anaconda version with a virtual environment if you have one into /kuacc/users/username/.bashrc file.

CODE
vi /kuacc/users/username/.bashrc
module load anaconda/3.21.05
source activate virt_name

  • Then, reserve a node by salloc command.

CODE
salloc -A users -p mid--qos=users -c 4 --gres=gpu:1 --mem=64G --time=1-00 -w be12

  • By this command, a compute node is reserved with 64GB RAM, 4cores, one gpu for one day.

  • By w parameter, you can pick your node. If you pick a node, you won’t need to setup everytime you use PyCharm.

  • You can change slurm parameters by your needs. Please check HPC Cluster documents.

  • You need to keep terminal open while you are working with PyCharm.

  • Find IP address of compute node on login. If you don’t choose a specific node, you also need to check which node was reserved.

CODE
squeue -u username
cat /etc/hosts|grep computename

Exp:
cat /etc/hosts|grep be12
172.20.242.112 be12 be12.kuacc.ku.edu.tr

  • After you reserve a compute node, open PyCharm.

pycharm-1.JPG

  • Open All Settings under Customize

pycharm-2.JPG

  • Open Python Interpreter

pycharm-3.JPG

  • Check Settings icon next to Python Interpreter and choose “Add..”

  • In “Add Python Interpreter” window, choose “SSH Interpreter

pycharm-4.JPG

  • Write Host=compute Node IP, your username and hit “Next”

pycharm-5.JPG

  • Accept ssh key and continue.

pycharm-6.JPG

  • Write your password and hit “Next”.

pycharm-7.JPG

  • In the Add Python Interpreter window, choose Python in the selected Anaconda folder. (/kuacc/apps/anaconda/version/bin/python)

pycharm-8.JPG

  • Then, hit Finish.

pycharm-9.JPG

  • On the Settings screen, Python Interpreter will be as follows.

pycharm-10.JPG

  • Then, hit the “New Project” button and create a new project with the previously configured interpreter.

pycharm-11.JPG

  • Please choose a project location in your KUACC home. Your codes will be stored in this location. Hit Create

pycharm-12.JPG

  • The project will be as seen in the screenshot.

pycharm-13.JPG

  • You can see the compute node settings at the “External Libraries” Tab.

pycharm-14.JPG

  • If you run the default code, you can check if the setup is working. “Hi, PyCharm” message is seen on the Run screen.

pycharm-16.JPG

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.