Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to set environment variable for Python library #63517

Closed
vikrant-Ios opened this issue Feb 8, 2023 · 1 comment
Closed

Unable to set environment variable for Python library #63517

vikrant-Ios opened this issue Feb 8, 2023 · 1 comment
Labels
off topic Resolution: Is beyond the scope of the Swift project (Xcode, proprietary Apple frameworks, etc.)

Comments

@vikrant-Ios
Copy link

vikrant-Ios commented Feb 8, 2023

Actually, I wanted to run a python file in the swift project for iPhone Application. I installed PythonKit from url (https://github.com/pvieito/PythonKit).
Then import PythonKit in viewcontroller and put print(Python.versionInfo) line in the viewload function.

I tried to set the environment variable in the scheme. But every time got the error "Python library not found. Set the PYTHON_LIBRARY environment variable with the path to a Python library."
 I put below the value  
PYTHON_LIBRARY = "/opt/anaconda3/envs/myenv/lib/libpython3.9.dylib"
PYTHON_LIBRARY = "/Library/Frameworks/Python.framework/Versions/3.11/Python"

unable to read from there.

Please help me out with this issue I am stuck for a lot of days.
Config:
Xcode: 14.1
Swift 5(Not SwiftUI)

@AnthonyLatsis AnthonyLatsis added the off topic Resolution: Is beyond the scope of the Swift project (Xcode, proprietary Apple frameworks, etc.) label Feb 10, 2023
@AnthonyLatsis
Copy link
Collaborator

AnthonyLatsis commented Feb 10, 2023

This sound a lot like a project configuration problem rather than a Swift bug. Asking about this in the PythonKit repo or Stack Overflow is likely to be more helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
off topic Resolution: Is beyond the scope of the Swift project (Xcode, proprietary Apple frameworks, etc.)
Projects
None yet
Development

No branches or pull requests

2 participants