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

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

Open
sclzzhanghaijun opened this issue Sep 27, 2018 · 7 comments

Comments

@sclzzhanghaijun
Copy link

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
Copy link

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

@wuhengzhi
Copy link

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

@wuxie2015
Copy link

apt-get cannot be used on windows

@sclzzhanghaijun
Copy link
Author

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

@davidsalb
Copy link

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
Copy link

hongjunxin commented Jul 27, 2021

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
Copy link

wilsonssss commented Aug 23, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants