Is that possible to specify python path in my Playground and Xcode project?
How do I ship my Swift App with Python and Python modules? It might be:
a macOS app
an iOS app
a pure swift executable running on Linux (maybe within a docker container).
2. How to draw matplotlib's plots in the Playground and macOS Apps
Is that possible to call matplotlib API and draw plots with Swift in a Xcode Playground or a macOS app? Is there any sample code or project to do that?
3. Data Science in Swift
Is there any recommended Swift package could be replaced/compatible with numpy, pandas, matplotlib, etc. when using PythonKit?
Hi @xareelee, quite interesting to see more data science interest in Swift! I encountered the same issue for some project I'm working on where I use PythonKit with Swift and Python is installed via Conda. Here's an internal note for the fix that I have been using so far in Xcode:
Note: add PYTHON_LIBRARY ENV variable to point to Conda Python in XCode for running/testing (From "Edit Scheme..."). Example /opt/miniconda3/envs/<yourenv>/lib/libpython3.8.dylib
To make this work, you also need to set "App Sandbox" (key: com.apple.security.app-sandbox ) to "NO" in the .entitlement file while development, and this only works for the project, not for Xcode Playground.
In my playground within the same project, the python version is still not my conda's Python. I still wonder how to achieve this in Xcode's Playground.
Furthermore, how to archive this Xcode project into .app with the specific Python version and associated libs?
Interested if this was solved? I'm struggling with same problem, trying to bundle python into .app folder for swift project in xcode. Actually I manage so far