PyCharm Project Setup

All other Source.Python topics and issues.
User avatar
Hymns For Disco
Member
Posts: 32
Joined: Wed Nov 22, 2017 7:18 am
Contact:

PyCharm Project Setup

Postby Hymns For Disco » Mon Dec 24, 2018 9:21 am

A while ago, I was working on a source-python plugin in PyCharm, and had the project nicely setup to recognise the sp packages, but also, most importantly, under the project interpreter tab, if I installed a site package, it would automatically install it to the source-python site-packages folder allowing me to use that package in my plugin. Coming back to it now, I have no idea how to set it up to do this again. I see that I can configure the project interpreter to be a virtual environment (which I believe source-python uses), but again I have no idea how to configure this to recognise the sp installation. I guess I had figured this stuff out originally, but that was about a year ago and it seems I am lost again, so hopefully we can make this thread a resource for other people trying to get started with PyCharm.
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Re: PyCharm Project Setup

Postby satoon101 » Mon Dec 24, 2018 12:52 pm

You might check out my reply here:
viewtopic.php?f=9&t=1314
Image
User avatar
Hymns For Disco
Member
Posts: 32
Joined: Wed Nov 22, 2017 7:18 am
Contact:

Re: PyCharm Project Setup

Postby Hymns For Disco » Mon Dec 24, 2018 9:57 pm

satoon101 wrote:You might check out my reply here:
viewtopic.php?f=9&t=1314

I did read this post when I originally set up my project, and read it again this time. That all works to set up the SP modules, but what im more concerned with configuring the interpreter so that installing site packages through PyCharm will actually install them to the source-python folder and make them usable. I somehow had this setup working before, but I don't remember what I did :(
Image
When installing a site package (ie pymesh) through this tool, it will only install it to my regular python installation (as you would expect from the way its configured), and thus I cannot use pymesh in my plugin since it will fail to import it. However I previously had this configured so that it would automagically install the site package into addons\source-python\packages\site-packages allowing me to use that package import in my plugins. Since my plugin(s) require many site packages to function, it was very convenient to install them this way, but I seem to be lost in getting that working again. From what I understand, source-python ships with an (isolated?) python environment in the addons\source-python\Python3 directory and PyCharm supports setting the project interpreter as a virtual env seen here
Image
, but I really don't know how to configure this to recognise the SP python environment.

Hopefully this makes it more clear what I am after, basically the site packages installation is the main tool I am wanting
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Re: PyCharm Project Setup

Postby satoon101 » Mon Dec 24, 2018 10:18 pm

I am currently on holiday and will be moving later this week, as well, so I won't be able to help further till next week at the earliest.
Image

Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 14 guests