Installing Source.Python with pip on linux

Please post any questions about developing your plugin here. Please use the search function before posting!
User avatar
khaimovmr
Member
Posts: 52
Joined: Fri Aug 25, 2017 3:15 am
Contact:

Installing Source.Python with pip on linux

Postby khaimovmr » Fri Aug 25, 2017 2:01 pm

Hy guys!

I'm developing on linux with vim so the main autocompletion scheme for me is to get the Source.Python package installed the right way (pip or a deb-package). So that source.python package will be visible globally or in a separate virtualenv.
Is there a link to pass to the pip to install source.python?

Was somebody solved this problem earlier?

Thanks, guys.
inf
Junior Member
Posts: 20
Joined: Mon Aug 07, 2017 2:46 am

Re: Installing Source.Python with pip on linux

Postby inf » Fri Aug 25, 2017 4:13 pm

I use vscode, what I did to get the autocompletions to work was set up a venv and copy the source.python modules to lib/site-packages. This worked for me, not sure how vim works.
User avatar
khaimovmr
Member
Posts: 52
Joined: Fri Aug 25, 2017 3:15 am
Contact:

Re: Installing Source.Python with pip on linux

Postby khaimovmr » Fri Aug 25, 2017 5:35 pm

inf wrote:I use vscode, what I did to get the autocompletions to work was set up a venv and copy the source.python modules to lib/site-packages. This worked for me, not sure how vim works.

That's working out fine for vim. Thanks, inf!
There is only still a problem when i'm using an interactive python shell - for example, if i'm importing an auth module in it - then it's raising an exception "ImportError: No module named '_cvars'", but i think that might be because of the Boost.Python nature of Source.Python package.
User avatar
Ayuto
Project Leader
Posts: 2193
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: Installing Source.Python with pip on linux

Postby Ayuto » Fri Aug 25, 2017 7:12 pm

You can't really run the Source.Python packages within a Python shell as they heavily rely on source engine stuff, which is exposed by our Boost.Python modules/packages. Those modules/packages are loaded by the core.dll/so, which can only be loaded as a plugin by a source server.
User avatar
khaimovmr
Member
Posts: 52
Joined: Fri Aug 25, 2017 3:15 am
Contact:

Re: Installing Source.Python with pip on linux

Postby khaimovmr » Fri Aug 25, 2017 8:31 pm

Ayuto wrote:You can't really run the Source.Python packages within a Python shell as they heavily rely on source engine stuff, which is exposed by our Boost.Python modules/packages. Those modules/packages are loaded by the core.dll/so, which can only be loaded as a plugin by a source server.

That's right.
Just found out that i've been mistaken and previous workaround doesn't work with vim. I've had to copy all the files from the source.python package to my plugin directory for vim autocompletion to work.

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 17 guests