Skip to content

Srctools installation

Konclan edited this page Sep 3, 2022 · 1 revision

Srctools Installation

This installation is targeted towards Python 3.4+

Required modules:

  • cython
  • PyInstaller
  • importlib_resources (install version 1.1.0 with pip install importlib_resources==1.1.0)
  • aenum

Required programs:

  • Python 3.4+
  • Git (optional)
  • Visual Studio 2019-2020 (optional, necessary for compiling)

Installing:

download srctools

with git:

git clone https://github.com/TeamSpen210/srctools.git

without git:

install srctools

Note: If you didn't use git, replace /Users/[USERNAME]/srctools with the path to your srctools folder

cd /Users/[USERNAME]/srctools

If you installed Visual Studio, you can run this directly to install srctools:

python3 setup.py install

If you did not install Visual Studio, you will have to make a slight modification to setup.py

Remove lines 5-13 of setup.py

Remove the following lines:

try:
    from Cython.Build import cythonize
    c_ext = cpp_ext = '.pyx'
except ImportError:
    print('Cython not installed, not compiling Cython modules.')
    c_ext = '.c'
    cpp_ext = '.cpp'
    def cythonize(mod):
        return mod

And replace them with this:

def cythonize(m):
    return []
cy_ext = cpp_ext = ''

compile the postcompiler

python3 -m PyInstaller postcompiler.spec

Clone this wiki locally