python - How to fix AVFoundation bridge support at runitime with system python/pyobjc on Mac OS X 10.15?
问题描述
When importing AVFoundation with the system provided python (2.7.16) and pyobjc (2.5.1) on Mac OS X 10.15, there is an error:
% python
Python 2.7.16 (default, Feb 29 2020, 01:55:37)
[GCC 4.2.1 Compatible Apple LLVM 11.0.3 (clang-1103.0.29.20) (-macos10.15-objc- on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import objc
>>> objc.__version__
'2.5.1'
>>> import AVFoundation
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/objc/_bridgesupport.py:674: RuntimeWarning: Error parsing BridgeSupport data for AVFoundation: PyObjCRT_SkipTypeSpec: Unhandled type '5d' ]}
warnings.warn("Error parsing BridgeSupport data for %s: %s" % (frameworkName, e), RuntimeWarning)
On consequence of that (as far as I understand), is that constants are not loaded. Would it be possible to fix that from the running script?
I can not alter the python install because my script has to work on other machines than mine.
解决方案
It's not the answer your looking for, but the best solution is to install Python 3.8 and a recent version of PyObjC.
Both Python 2.7 and the version of PyObjC included in macOS are no longer supported.
推荐阅读
- anova - 创建一个循环以对多个变量的单向重复测量方差分析执行事后分析
- python - 如何从 Object-C 代码中获取 PyRun_SimpleString(s) 输出字符串?
- php - 使用复选框不同的行在数据库中插入数据
- pandas - 如何从 pandas 数据框中获取路径名并将其传递到 pd.read_csv 以使用该路径读取该文件?
- git - 无法推送到 git:无法解析 url
- c# - Outlook VSTO:获取/更新 editBox1 值
- android - 在颤动模式下使用 android studio 进行数字签名 android 应用程序
- javascript - 文件位置电子中的图标未更改
- angular - 如何通过角度事件绑定连接组件?
- tkinter - 为文本框 tkinter python 插入文本