Page 1 of 1

Installing Source.Python with pip on linux

Posted: Fri Aug 25, 2017 2:01 pm
by khaimovmr
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.

Re: Installing Source.Python with pip on linux

Posted: Fri Aug 25, 2017 4:13 pm
by inf
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.

Re: Installing Source.Python with pip on linux

Posted: Fri Aug 25, 2017 5:35 pm
by khaimovmr
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.

Re: Installing Source.Python with pip on linux

Posted: Fri Aug 25, 2017 7:12 pm
by Ayuto
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.

Re: Installing Source.Python with pip on linux

Posted: Fri Aug 25, 2017 8:31 pm
by khaimovmr
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.