Using PyCharm with Anaconda Python — RCG Handbook

Using PyCharm with Anaconda Python

PyCharm is installed on all our Ubuntu 16 workstations.

  1. Change your shell to bash.
  2. Logout, then log back in to ensure you pick up the changes.
  3. Download Anaconda. Save it in /local-scratch for faster access.
  4. Run the installer by typing bash /local-scratch/Anaconda_installer_whateverversion.sh.
  5. When prompted for an installation directory, enter /local-scratch/myanaconda (or any other directory name that does not yet exist).
  6. Conda should prompt you to activate it. Answer “yes”. This should not require a password. If you [sudo] asks for your password, you are probably out of disk space or you have exceeded your home directory quota. See our Disk Quota page for troubleshooting tips.
  7. Use conda install to obtain OpenCV, cudatoolkit, tensorflow, scikit-learn or whatever else you need.
  8. Point PyCharm at Anaconda’s bin/python2.7 or bin/python3.6 (see below).

Warning

/local-scratch is not backed up. Keep backups of important work in your shared lab file space or SFU Vault.

Telling PyCharm to Use Anaconda Python (new projects)

When creating a new project, the “Select Python Interpreter” dialog box will appear. Fill in the path to your Anaconda Python binary, e.g. /local-scratch/anaconda/bin/python2.7 and click [OK].

http://www.rcg.sfu.ca/_static/img/workstations/pycharm-new-project-interpreter.png

Telling PyCharm to Use Anaconda Python (existing projects)

With an existing project open, choose the File menu => Settings…* => Project: YourProject => [gear icon] => **Add Local.

Fill in the path to your Anaconda Python binary, e.g. /local-scratch/anaconda/bin/python2.7 and click [OK]. The first time you do this, PyCharm will spend several minutes scanning available modules.
http://www.rcg.sfu.ca/_static/img/workstations/pycharm-existing-project-interpreter-small.png