Setting up OOP linking for quick reference between files

I've downloaded a project from github, and am trying to figure out how to setup Pycharm to know where the files are, and what functions are located in them. I've worked with IDE's before that when right-clicking a function, show what file it originates from and what line. Currently, there are a bunch of errors highlighted because the PythonPath is not setup correctly in the IDE. How can I set up something like this in the Pycharm Community Edition? Any suggestions are appreciated.

4 comments
Comment actions Permalink

Hi,

Let me try answering your questions, and sorry if I misunderstood something:

1.

>to know where the files are, and what functions are located in them

Isn't that what you're looking for?

 

2. 

>I've worked with IDE's before that when right-clicking a function, show what file it originates from and what line.

I believe you're talking about "Go to declaration": https://www.jetbrains.com/help/pycharm/navigating-through-the-source-code.html#go_to_declaration

 

3.

>Currently, there are a bunch of errors highlighted because the PythonPath is not setup correctly in the IDE. How can I set up something like this in the Pycharm Community Edition?

I assume you don't have project interpreter configured correctly. Please see the following resources:

https://www.jetbrains.com/help/pycharm/configuring-python-interpreter.html

https://www.youtube.com/watch?v=5rSBPGGLkW0&list=PLQ176FUIyIUZ1mwB-uImQE-gmkwzjNLjP&index=3&t=73s

1
Comment actions Permalink

Thanks for the help Andrew. I didn't realize the Structure tab contained the variables and functions in a list, and assumed it was another hierarchy of the files. I'm still having trouble getting rid of the errors related to the $PYTHONPATH or Python Interpreter as it is called in the Pycharm settings. I downloaded motmot off of github, and when trying to change the Interpreter path to "/usr/lib/python2.7" it doesn't let me click OK. The current Interpreter path is "/usr/lib/python3.5" which isn't the python version motmot is using. Motmot is located in the directory "/usr/lib/python2.7/dist-packages/motmot". Also, I'm using the Linux version of Pycharm Community.

 

These are the steps I'm doing:

File --> Settings --> Project: motmot --> Project Interpreter --> Gear Symbol --> Add

 

 

http://code.astraw.com/motmot.pdf

0
Comment actions Permalink

Not sure I understand what are you trying to do. Seems like you're pointing to the python package "motmot" instead of the interpreter. You should point it to python executable. It's location can be varied depending on how you installed it.

Try to find the path to your python 2 executable in your system terminal first, confirm it's version with `python -V`, and then specify this executable in PyCharm

1
Comment actions Permalink

You are correct, I pointed it to the python executable and the errors were corrected. Thanks again

0

Please sign in to leave a comment.