Installing standard python packages (pypi)

Post Python examples to help other users.
User avatar
Posts: 51
Joined: Sat Mar 24, 2018 5:25 pm
Location: Chicago

Installing standard python packages (pypi)

Postby Zeus » Sun Mar 25, 2018 2:24 am

On Linux, you can do this with pip

Code: Select all

$ pip install -t <srcds_base_path>/addons/source-python/packages/custom/ <package>

For example:

Code: Select all

$ apt-get install python-pip
$ pip install -t /usr/games/steam/tf2/tf/addons/source-python/packages/custom/ requests
$ pip install -t /usr/games/steam/tf2/tf/addons/source-python/packages/custom/ flask

This would not gaurentee that it will work with Source Python since there are certain limitations
User avatar
Project Leader
Posts: 2164
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: Installing standard python packages (pypi)

Postby Ayuto » Sun Mar 25, 2018 9:12 am

I would like to add this:
Ayuto wrote:Moreover, you need to use pip from a Python 3.6 installation, because SP embeds 3.6. You are currently using 3.5. This might work if the package doesn't contain anything that needs to be compiled, but if it does, it's mandatory to use the same versions.


Return to “Code examples / Cookbook”

Who is online

Users browsing this forum: No registered users and 1 guest