# Setting up dev environment for tk-multi-starterapp on MacOS

**URL:** <https://community.shotgridsoftware.com/t/setting-up-dev-environment-for-tk-multi-starterapp-on-macos/12180>\
**Category:** Pipeline Integrations\
**Tags:** fptr-tk\
**Created:** [April 20, 2021, 3:43pm UTC](https://community.shotgridsoftware.com/t/setting-up-dev-environment-for-tk-multi-starterapp-on-macos/12180 "2021-04-20T15:43:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kramester](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/kramester/32/271_2.png) [@kramester](https://community.shotgridsoftware.com/u/kramester)\
**Post date:** [April 20, 2021, 3:43pm UTC](https://community.shotgridsoftware.com/t/setting-up-dev-environment-for-tk-multi-starterapp-on-macos/12180/1 "2021-04-20T15:43:59Z")

</div>

Im trying to set up a dev environment to run the **build\_resources.sh** file so that I can customize the UI using QtDesigner. I cant seem to get the right combination of qt and pyside tools installed to be able to run the sh script. Do you have a procedure you can share?

This is my current process:

```auto
brew install qt5
brew link qt5 --force
(switch into a py2.7 venv)
pip install PySide

```

It fails during this PySide install, complains about Qt QTGUI, Qt QTXML, Qt QTCORE libraries not being found.

---

<div class="post-metadata">

**Author:** ![kramester](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/kramester/32/271_2.png) [@kramester](https://community.shotgridsoftware.com/u/kramester)\
**Post date:** [April 26, 2021, 5:17pm UTC](https://community.shotgridsoftware.com/t/setting-up-dev-environment-for-tk-multi-starterapp-on-macos/12180/3 "2021-04-26T17:17:20Z")

</div>

Update on this - I’ve given up trying to successfully install PySide. PySide2 installs without issue using `pip install PySide2` so now I’m attempting to modify the **build\_resources.sh** to use the **pyside2-uic** and **pyside2-rcc**. Here is my modified script:

```auto
# The path to output all built .py files to:
UI_PYTHON_PATH=../python/app/ui

# Helper functions to build UI files
function build_qt {
    echo " > Building " $2

    # compile ui to python
    $1 $2 -o $UI_PYTHON_PATH/$3.py

    # replace PySide imports with tank.platform.qt and remove line containing Created by date
    sed -i "" -e "s/from PySide2 import/from sgtk.platform.qt5 import/g" -e "/# Created:/d" $UI_PYTHON_PATH/$3.py
    sed -i "" -e "s/from PySide2./from sgtk.platform.qt5./g" -e "/# Created:/d" $UI_PYTHON_PATH/$3.py
}

function build_ui {
    build_qt "pyside2-uic --from-imports" "$1.ui" "$1"
}

function build_res {
    build_qt "pyside2-rcc" "$1.qrc" "$1_rc"
}

# build UI's:
echo "building user interfaces..."
build_ui dialog
# add any additional .ui files you want converted here!

# build resources
echo "building resources..."
build_res resources

```

This works BUT there’s an issue with the way sgtk imports Qt that I cannot import it the way the complier writes out the imports. This doesnt work:

```auto
from sgtk.platform.qt5.QtCore import *
from sgtk.platform.qt5.QtGui import *
from sgtk.platform.qt5.QtWidgets import *

```

I get a **ImportError: No module named QtCore** error. So is there either 1) a way to run the UIC so that the compiled UI would work with imports like `from sgtk.platform.qt5 import QtCore, QtGui, QtWidgets` or 2) modfiy the import statement to import all the Qt modules as if it was done with a `import *` type statement?

---

<div class="post-metadata">

**Author:** ![kramester](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/kramester/32/271_2.png) [@kramester](https://community.shotgridsoftware.com/u/kramester)\
**Post date:** [April 26, 2021, 9:34pm UTC](https://community.shotgridsoftware.com/t/setting-up-dev-environment-for-tk-multi-starterapp-on-macos/12180/4 "2021-04-26T21:34:07Z")

</div>

inserting `import sgtk.platform.qt5 as PySide2` seems to do the trick. Like this:

```auto
import sgtk.platform.qt5 as PySide2

from PySide2.QtCore import *
from PySide2.QtGui import *
from PySide2.QtWidgets import *

```

---

<div class="post-metadata">

**Author:** ![kramester](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/kramester/32/271_2.png) [@kramester](https://community.shotgridsoftware.com/u/kramester)\
**Post date:** [May 14, 2021, 8:57pm UTC](https://community.shotgridsoftware.com/t/setting-up-dev-environment-for-tk-multi-starterapp-on-macos/12180/5 "2021-05-14T20:57:32Z")

</div>

So I’ve run into an issue with this method. Using **pyside2-rcc** doesnt seem to build a resource\_rc.py file that works. None of the images contained in that resource file appear in the compiled app. If i use the old resource file compiled by SG using **pyside-rcc** the images appear fine. This is of course an issue because I cant add or change any resources or ALL my images disappear.

Help! How do I set up a proper environment for this? I want to develop some apps!
