From 40fbe1abf160a54b2a91fe0267c7296c6585f27c Mon Sep 17 00:00:00 2001 From: Arksine Date: Tue, 22 Dec 2020 15:41:42 -0500 Subject: [PATCH] scripts: don't install system site packages in virtualenv This can create issues of the system includes conflicting packages. Create a symlink for the system "gpiod" instead. Signed-off-by: Eric Callahan --- scripts/install-moonraker.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/install-moonraker.sh b/scripts/install-moonraker.sh index ad3a661..b22fc11 100755 --- a/scripts/install-moonraker.sh +++ b/scripts/install-moonraker.sh @@ -57,7 +57,10 @@ create_virtualenv() rm -rf ${PYTHONDIR} fi - [ ! -d ${PYTHONDIR} ] && virtualenv -p /usr/bin/python3 --system-site-packages ${PYTHONDIR} + if [ ! -d ${PYTHONDIR} ]; then + virtualenv -p /usr/bin/python3 ${PYTHONDIR} + ln -s /usr/lib/python3/dist-packages/gpiod* ${PYTHONDIR}/lib/python*/site-packages + fi # Install/update dependencies ${PYTHONDIR}/bin/pip install -r ${SRCDIR}/scripts/moonraker-requirements.txt