chrippa / python-librtmp

python-librtmp is a RTMP client library. It uses the implementation provided by librtmp via cffi.
BSD 2-Clause "Simplified" License
154 stars 33 forks source link

【win10】fatal error C1083: Cannot open include file: 'librtmp/rtmp.h': No such file or directory #35

Open sclzzhanghaijun opened 6 years ago

sclzzhanghaijun commented 6 years ago

librtmp._librtmp.c build\temp.win-amd64-3.7\Release\librtmp._librtmp.c(493): fatal error C1083: Cannot open include file: 'librtmp/rtmp.h': No such file or directory error: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe' failed with exit status 2

wangfeili commented 6 years ago

问题解决了吗?我也是同样的问题

wuhengzhi commented 6 years ago

sudo apt-get install librtmp-dev sudo pip install python-librtmp

wuxie2015 commented 6 years ago

apt-get cannot be used on windows

sclzzhanghaijun commented 5 years ago

没有,windows上安装还是有问题

davidsalb commented 5 years ago

is there any news? i found some guides to compile librtmpdump on windows: here and here

But I have not been successful so far. Is this the only approach to install the library to a Windows machine?

hongjunxin commented 3 years ago

librtmp工程中有个子目录叫librtmp,该子目录中有头文件,所以将该 librtmp 子目录整个放到 pip install 时会去寻找的头文件路径中。比如运行 pip install python-librtmp 之后,控制台会输出 ... -Id:\program files\python3.9.6\include,其中 -l 后面就是 pip install 时会去寻找的头文件路径。将上面提到的 librtmp 子目录,整个放入 ...\python3.9.6\include\ 下就可以了。这个其实还是遵循了 gcc 的编译规则。

wilsonssss commented 3 months ago

Windows Build

  1. dowload https://github.com/yixia/librtmp, copy librtmp/librtmp to $pythonDir/include
    • eg C:\Users\Administrator.pyenv\pyenv-win\versions\3.9.1\include\librtmp
  2. build librtmp.dll, librtmp.lib, ref: https://blog.csdn.net/qq_33163046/article/details/124132934
  3. rename librtmp.dll, librtmp.lib to rtmp.dll, rtmp.lib, copy to git project python-librtmp, run python setup.py install
  4. copy librtmp.dll, librtmp.lib, rtmp.dll, rtmp.lib to python's site-packages\python_librtmp-$your-version\librtmp\
    • eg c:\Users\Administrator.pyenv\pyenv-win\versions\3.9.1\lib\site-packages\python_librtmp-0.3.0-py3.9-win-amd64.egg\librtmp
  5. in your app project, pip install python-librtmp and run your demo code.

Apple Chip Like M1/M2

brew install rtmpdump
git clone https://github.com/yixia/librtmp.git 
sudo cp -rf librtmp/librtmp /usr/local/lib/
sudo cp -rf /opt/homebrew/opt/rtmpdump/lib/* /usr/local/lib/
mkdir -p $your-python-folder/include     # eg ./venv/include    
cp -rf /opt/homebrew/opt/rtmpdump/include/  $your-python-folder/include
pip install --global-option=build_ext --global-option="-I/opt/homebrew/opt/rtmpdump/include/" --global-option="-L/opt/homebrew/opt/rtmpdump/lib" python-librtmp

Refer Docs