1

I develop in Python 3.6 and Flask. I'm currently working with a SQLAnywhere database and have installed the Python package sqlanydb. I have also installed the SQLAnywhere17 driver for Mac OSX.

Up until earlier this week I was developing normally, until I decided to update my Mac from Yosemite to High Sierra. I was unaware of SIP at the time, and so I may have made a premature decision in upgrading.

Since I've upgraded I've been unable to develop as normal because when sourcing the SQLAnywhere17 files, it adds a path to the DYLD_LIBRARY_PATH. However, when I run my flask application in flask's development server with

export FLASK_APP=modules
export FLASK_DEBUG=1
flask run

It purges all of the SQLAnywhere 17 dyld files that were added to my environment, and I get a could not load dbcapi error.

I'm looking for a solution where I don't have to disable SIP because I understand that the purpose of the protection is important. I would just like to be able to disable it for running my flask application.

My Python 3.6 files and site-packages are located in /usr/local. From this article I learned I can see which files are being protected by SIP with ls -alO. However, when I run this command on /usr/local and all the directories within, and it seems that none of the files are being protected. The /usr/local directory itself has sunlink where the protected would be on SIP protected files. I'm not sure what that means.

  • 1
    How do you know that SIP is to blame? You should try disabling it at least temporarily as a test. /usr/local is indeed specifically excluded from SIP. – Wowfunhappy Feb 23 '18 at 22:02
  • Yeah, good point. Let me try that and get back to you. – Michael Feb 23 '18 at 22:18
  • Sorry, for the late response. I just disabled SIP and ran my flask application using the method above. I did not encounter the error, and my flask app was able to run fine. Therefore, SIP seems to be causing this error. So then I wonder if Flask's default development server is using binaries that aren't located in /usr/local. – Michael Feb 26 '18 at 19:33
  • Seems that way! I'm not actually familiar with Flask, so I can't provide an actual answer. You could try disabling only the part of SIP you need (experiment to see what works): forums.developer.apple.com/thread/17452 – Wowfunhappy Feb 26 '18 at 22:30

You must log in to answer this question.

Browse other questions tagged .