Xcode 配置python环境
Xcode配置python
·
1、新建project(command+Shift + N) 选择other>External Build System>Next.
2、product Name:名字. Build Tool:选择python解释器的位置(如: /usr/bin/python3)>Next>选择位置>Create.
python解释器的位置可以从terminal使用命令:which python 或者which python3获取.
3、新建的项目右键>new file>macos>others>empty>Next.
4、Save as: x_test.py(自命名py文件)>Create.
5、Product>Scheme>Edit Scheme
6、Run>info>Executable>other
7、command + Shift + G 然后粘贴python解释器的位置> Go>Chose>去掉Debug executable前的对号.
8、 Run>Arguments>+>py文件.
9、Run>Options>Working Directory>py所在目录
10、command + R 运行测试代码.
成功.
失败:在电脑的系统偏好设置-安全与隐私-开发者工具和完全磁盘访问权限“加上python权限。
更多推荐
所有评论(0)