1

I am very new to Python and am trying to learn it so that I can write Mercurial hooks (https://www.mercurial-scm.org/wiki/MercurialApi).

I downloaded PyCharm by Jetbrains with the hope that I could start writing a python script and have the IDE autocomplete for me so I could see what available functions objects have etc. I started with this:

#!/usr/bin/env python

from mercurial import ui, hg
# change . to the path to the repo
repo = hg.repository(ui.ui(), '.')

ui.warn('asdfsadf')

However, as no Python Interpreter is configured, I can't autocomplete (or, at least that's what I think the issue is). I do have Mercurial installed, and when I do pip list I do see the library listed, but PyCharm doesn't know about it. How do I configure thing so that the libraries I want recognized by the IDE get recognized? I know that there are settings which can be set, but I don't understand which ones I want for my purpose.

user1015214
  • 2,733
  • 10
  • 36
  • 66

1 Answers1

0

I found that this post How do I import modules in pycharm? helped me a lot to add the appropriate project interpreter.

user1015214
  • 2,733
  • 10
  • 36
  • 66