Page 1 of 1

Does anyone use PyCharm?

Posted: Fri Sep 02, 2016 12:06 pm
by Kill
Hello,

If so, can You please tell me how to make it autocomeplete?

Re: Does anyone use PyCharm?

Posted: Fri Sep 02, 2016 12:42 pm
by Mahi
I suggest you google... :p

Re: Does anyone use PyCharm?

Posted: Fri Sep 02, 2016 12:48 pm
by Kill
Mahi wrote:I suggest you google... :p


I google more than You can think :P

Re: Does anyone use PyCharm?

Posted: Fri Sep 02, 2016 2:24 pm
by iPlayer
I use PyCharm.

1) Settings
Image

2) Project Structure
Image

3) +Add Content Root Image
4) Select addons/source-python/packages/source-python in your SP installation
Image

5) Using +Add Content Root, also add addons/source-python/packages/site-packages and addons/source-python/packages/custom

Re: Does anyone use PyCharm?

Posted: Fri Sep 02, 2016 2:29 pm
by Kill
Thanks a lot iPlayer!

Re: Does anyone use PyCharm?

Posted: Fri Sep 02, 2016 2:54 pm
by satoon101
Don't add external libraries like ../addons/source-python/package/source-python/ as Content Roots, add them as external libraries. To do this, go into Project Interpreter, click the "gear" on the right side of the Project Interpreter line, and select "More...". Then, while your interpreter is highlighted, there are 5 buttons on the bottom left. Click the one on the right (out of those 5). The text for it, when hovering over, should say "Show paths for the selected interpreter". Once in there, click the plus-sign on the bottom left and select the directory you wish to add.

Re: Does anyone use PyCharm?

Posted: Fri Sep 02, 2016 2:58 pm
by iPlayer
Didn't know that! Learning something new every day, huh

Re: Does anyone use PyCharm?

Posted: Fri Sep 02, 2016 3:05 pm
by Kill
satoon101 wrote:Don't add external libraries like ../addons/source-python/package/source-python/ as Content Roots, add them as external libraries. To do this, go into Project Interpreter, click the "gear" on the right side of the Project Interpreter line, and select "More...". Then, while your interpreter is highlighted, there are 5 buttons on the bottom left. Click the one on the right (out of those 5). The text for it, when hovering over, should say "Show paths for the selected interpreter". Once in there, click the plus-sign on the bottom left and select the directory you wish to add.



I can't "apply" this. Thanks tho :)

Re: Does anyone use PyCharm?

Posted: Fri Sep 02, 2016 3:06 pm
by satoon101
? Not sure why you couldn't. What's stopping you?

Re: Does anyone use PyCharm?

Posted: Fri Sep 02, 2016 3:18 pm
by satoon101
Ok, sorry, on Windows, the 5 buttons are on the upper right and are listed vertically. Choose the bottom one of those 5. And the plus-sign on the next page is on the upper right, as well.

I'm assuming that might have been your issue, but "I can't apply this" doesn't really help to solve the situation.

Re: Does anyone use PyCharm?

Posted: Fri Sep 02, 2016 4:05 pm
by Kill
satoon101 wrote:Ok, sorry, on Windows, the 5 buttons are on the upper right and are listed vertically. Choose the bottom one of those 5. And the plus-sign on the next page is on the upper right, as well.

I'm assuming that might have been your issue, but "I can't apply this" doesn't really help to solve the situation.


This is what i meant, I can't apply the configuration
Image

Re: Does anyone use PyCharm?

Posted: Fri Sep 02, 2016 4:07 pm
by satoon101
There's nothing to Apply. I'm assuming this is on the Project Interpreter screen itself. The Apply button will only be active if you are actually changing the interpreter you are using. You shouldn't be doing that at all in what I posted. You're just modifying the existing interpreter.

*Edit: ok, I was wrong, you should have to apply when adding additional external libraries. But, the Apply button will only activate once you have done so. If the button is not activating, there is something wrong with your installation. I have tested this on both the community and professional versions on Windows and on Mac (professional version only), and they all work the same.

Re: Does anyone use PyCharm?

Posted: Fri Sep 02, 2016 6:37 pm
by iPlayer
satoon101 wrote:Don't add external libraries ... as Content Roots

Well, might also notify necavi of this. He told me to do so back in the day :tongue:

Re: Does anyone use PyCharm?

Posted: Fri Sep 02, 2016 6:47 pm
by satoon101
It's in BackRaw's post here, too:
viewtopic.php?f=31&t=863&p=5410#p5410

I have even used that method in the past, before I knew better. I mean, it does "work". But, all the extra directories in the project structure really annoyed me, since they aren't an actual part of my project. So, I did a quick google search on how to add directories into the External Libraries, and found this method. I have been much happier ever since :)

Re: Does anyone use PyCharm?

Posted: Fri Sep 02, 2016 7:15 pm
by iPlayer
On the bright side, I can quickly look up sources of the Python-side of Source.Python. And good thing these extra directories are not commited to the repo nor deployed. Though if they were, I guess I'd find out about interpreter's external libs way before now.

Re: Does anyone use PyCharm?

Posted: Fri Sep 02, 2016 7:49 pm
by satoon101
You still have quick access, as they are listed in the External Libraries right underneath. Plus, Ctrl-B (command-B on Mac) takes you to the object's declaration.

Re: Does anyone use PyCharm?

Posted: Thu Sep 08, 2016 6:16 pm
by BackRaw
satoon101 wrote:Don't add external libraries like ../addons/source-python/package/source-python/ as Content Roots, add them as external libraries. To do this, go into Project Interpreter, click the "gear" on the right side of the Project Interpreter line, and select "More...". Then, while your interpreter is highlighted, there are 5 buttons on the bottom left. Click the one on the right (out of those 5). The text for it, when hovering over, should say "Show paths for the selected interpreter". Once in there, click the plus-sign on the bottom left and select the directory you wish to add.

Didn't know that either - thanks!