我在Windows 7上运行带有VLC模块的python 2.7来执行此操作:
import vlc
i = vlc.Instance('--verbose 2'.split())
p = i.media_player_new()
p.set_mrl('rtp://@192.168.0.101:8080/video')
p.play()
但是当我尝试使用pip安装VLC模块时,它会返回以下错误:
C:\Windows\System32>pip install vlc
Collecting vlc
Using cached vlc-0.0.1.tar.gz
Collecting app (from vlc)
Using cached app-0.0.2.tar.gz
Collecting appscript (from app->vlc)
Using cached appscript-1.0.1.tar.gz
Requirement already satisfied (use --upgrade to upgrade): envoy in c:\python27\l
ib\site-packages\envoy-0.0.3-py2.7.egg (from app->vlc)
Requirement already satisfied (use --upgrade to upgrade): osascript in c:\python
27\lib\site-packages\osascript-0.0.4-py2.7.egg (from app->vlc)
Installing collected packages: appscript, app, vlc
Running setup.py install for appscript
building 'aem.ae' extension
C:\Users\adb\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9
.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\Python27\include -IC:
\Python27\PC /Tcappscript_2x\ext/ae.c /Fobuild\temp.win32-2.7\Release\appscript_
2x\ext/ae.obj -DMAC_OS_X_VERSION_MIN_REQUIRED=MAC_OS_X_VERSION_10_4
ae.c
c:\users\adb\appdata\local\temp\pip-build-qjopue\appscript\appscript_2x\ext\
aetoolbox.h(17) : fatal error C1083: Cannot open include file: 'Carbon/Carbon.h'
: No such file or directory
error: command 'C:\\Users\\adb\\AppData\\Local\\Programs\\Common\\Microsoft\
\Visual C++ for Python\\9.0\\VC\\Bin\\cl.exe' failed with exit status 2
Complete output from command C:\Python27\python.exe -c "import setuptools, t
okenize;__file__='c:\\users\\adb\\appdata\\local\\temp\\pip-build-qjopue\\appscr
ipt\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().rep
lace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\adb\appdata\lo
cal\temp\pip-xw6gkp-record\install-record.txt --single-version-externally-manage
d --compile:
running install
running build
running build_py
creating build
creating build\lib.win32-2.7
copying appscript_2x\lib\mactypes.py -> build\lib.win32-2.7
copying appscript_2x\lib\osax.py -> build\lib.win32-2.7
creating build\lib.win32-2.7\aem
copying appscript_2x\lib\aem\aemcodecs.py -> build\lib.win32-2.7\aem
copying appscript_2x\lib\aem\aemconnect.py -> build\lib.win32-2.7\aem
copying appscript_2x\lib\aem\aemreference.py -> build\lib.win32-2.7\aem
copying appscript_2x\lib\aem\aemsend.py -> build\lib.win32-2.7\aem
copying appscript_2x\lib\aem\findapp.py -> build\lib.win32-2.7\aem
copying appscript_2x\lib\aem\kae.py -> build\lib.win32-2.7\aem
copying appscript_2x\lib\aem\mactypes.py -> build\lib.win32-2.7\aem
copying appscript_2x\lib\aem\typewrappers.py -> build\lib.win32-2.7\aem
copying appscript_2x\lib\aem\__init__.py -> build\lib.win32-2.7\aem
creating build\lib.win32-2.7\appscript
copying appscript_2x\lib\appscript\defaultterminology.py -> build\lib.win32-
2.7\appscript
copying appscript_2x\lib\appscript\genericreference.py -> build\lib.win32-2.
7\appscript
copying appscript_2x\lib\appscript\keywordwrapper.py -> build\lib.win32-2.7\
appscript
copying appscript_2x\lib\appscript\reference.py -> build\lib.win32-2.7\appsc
ript
copying appscript_2x\lib\appscript\referencerenderer.py -> build\lib.win32-2
.7\appscript
copying appscript_2x\lib\appscript\reservedkeywords.py -> build\lib.win32-2.
7\appscript
copying appscript_2x\lib\appscript\terminology.py -> build\lib.win32-2.7\app
script
copying appscript_2x\lib\appscript\terminologyparser.py -> build\lib.win32-2
.7\appscript
copying appscript_2x\lib\appscript\__init__.py -> build\lib.win32-2.7\appscr
ipt
running build_ext
building 'aem.ae' extension
creating build\temp.win32-2.7
creating build\temp.win32-2.7\Release
creating build\temp.win32-2.7\Release\appscript_2x
creating build\temp.win32-2.7\Release\appscript_2x\ext
C:\Users\adb\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9
.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\Python27\include -IC:
\Python27\PC /Tcappscript_2x\ext/ae.c /Fobuild\temp.win32-2.7\Release\appscript_
2x\ext/ae.obj -DMAC_OS_X_VERSION_MIN_REQUIRED=MAC_OS_X_VERSION_10_4
ae.c
c:\users\adb\appdata\local\temp\pip-build-qjopue\appscript\appscript_2x\ext\
aetoolbox.h(17) : fatal error C1083: Cannot open include file: 'Carbon/Carbon.h'
: No such file or directory
error: command 'C:\\Users\\adb\\AppData\\Local\\Programs\\Common\\Microsoft\
\Visual C++ for Python\\9.0\\VC\\Bin\\cl.exe' failed with exit status 2
----------------------------------------
Command "C:\Python27\python.exe -c "import setuptools, tokenize;__file__='c:
\\users\\adb\\appdata\\local\\temp\\pip-build-qjopue\\appscript\\setup.py';exec(
compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'),
__file__, 'exec'))" install --record c:\users\adb\appdata\local\temp\pip-xw6gkp-
record\install-record.txt --single-version-externally-managed --compile" failed
with error code 1 in c:\users\adb\appdata\local\temp\pip-build-qjopue\appscript
C:\Windows\System32>
然后我尝试单独安装appscript,但它仍然返回错误。 经过一番搜索,我发现appscript模块仅适用于Mac。但我想在Windows上使用VLC模块。
我们非常感谢任何建议。