Installing standard python packages (pypi)

Post Python examples to help other users.
User avatar
Zeus
Member
Posts: 52
Joined: Sat Mar 24, 2018 5:25 pm
Location: Denver
Contact:

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
Ayuto
Project Leader
Posts: 2195
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.

viewtopic.php?p=11341#p11341

Return to “Code examples / Cookbook”

Who is online

Users browsing this forum: No registered users and 5 guests