英文:
Can't install FFMPEG using pip
问题
我尝试使用pip安装ffmpeg,命令如下:
pip install ffmpeg
然而,我遇到了以下错误:
Collecting ffmpeg
Using cached ffmpeg-1.4.tar.gz (5.1 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [34 lines of output]
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "C:\Users\vwu20\AppData\Local\Temp\pip-install-rdqrdeeq\ffmpeg_3cdda176f3f04ceea4a14d868e94924e\setup.py", line 13, in <module>
setup(
File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\__init__.py", line 87, in setup
return distutils.core.setup(**attrs)
File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\core.py", line 147, in setup
_setup_distribution = dist = klass(attrs)
File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\dist.py", line 476, in __init__
_Distribution.__init__(
File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\dist.py", line 282, in __init__
self.finalize_options()
File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\dist.py", line 899, in finalize_options
for ep in sorted(loaded, key=by_order):
File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\dist.py", line 898, in <lambda>
loaded = map(lambda e: e.load(), filtered)
File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\importlib\metadata\__init__.py", line 171, in load
module = import_module(match.group('module'))
File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\py2app\build_app.py", line 37, in <module>
from py2app.create_appbundle import create_appbundle
File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\py2app\create_appbundle.py", line 9, in <module>
from py2app.util import make_exec, makedirs, mergecopy, mergetree, skipscm
File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\py2app\util.py", line 5, in <module>
import fcntl
ModuleNotFoundError: No module named 'fcntl'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
错误信息表明缺少一个名为fcntl
的包,因此我尝试使用以下命令安装它:
pip install fcntl
然而,尝试安装fcntl产生了以下错误:
ERROR: Could not find a version that satisfies the requirement fcntl (from versions: none)
ERROR: No matching distribution found for fcntl
有人能告诉我我做错了什么吗?我正在使用Windows 11,Python 3.10,pip 23.1.2。感谢帮助。
英文:
I tried to install ffmpeg using pip like this
pip install ffmpeg
However I got the following error:
Collecting ffmpeg
Using cached ffmpeg-1.4.tar.gz (5.1 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [34 lines of output]
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "C:\Users\vwu20\AppData\Local\Temp\pip-install-rdqrdeeq\ffmpeg_3cdda176f3f04ceea4a14d868e94924e\setup.py", line 13, in <module>
setup(
File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\__init__.py", line 87, in setup
return distutils.core.setup(**attrs)
File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\core.py", line 147, in setup
_setup_distribution = dist = klass(attrs)
File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\dist.py", line 476, in __init__
_Distribution.__init__(
File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\dist.py", line 282, in __init__
self.finalize_options()
File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\dist.py", line 899, in finalize_options
for ep in sorted(loaded, key=by_order):
File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\dist.py", line 898, in <lambda>
loaded = map(lambda e: e.load(), filtered)
File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\importlib\metadata\__init__.py", line 171, in load
module = import_module(match.group('module'))
File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\py2app\build_app.py", line 37, in <module>
from py2app.create_appbundle import create_appbundle
File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\py2app\create_appbundle.py", line 9, in <module>
from py2app.util import make_exec, makedirs, mergecopy, mergetree, skipscm
File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\py2app\util.py", line 5, in <module>
import fcntl
ModuleNotFoundError: No module named 'fcntl'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
The error message says that it's missing a package called fcntl
, so i tried to install it using
pip install fcntl
The attempt to install fcntl produce the following error:
ERROR: Could not find a version that satisfies the requirement fcntl (from versions: none)
ERROR: No matching distribution found for fcntl
Can anyone tell me what I did wrong? I am using windows 11, python 3.10, pip 23.1.2
Help would be appreciated.
答案1
得分: 3
这不是你想要的包。那个只支持Linux,并且不专业。相反,尝试:
pip install ffmpeg-python
然而,请注意,在执行此操作之前,您需要安装ffmpeg(命令行版本,而不是Python模块)。在git页面上有安装说明。
https://github.com/kkroening/ffmpeg-python
如果不清楚的话,ffmpeg 是一个非常大、复杂和功能强大的命令行工具包。Python模块实际上并不执行任何视频工作 - 它们只是构建复杂的ffmpeg命令行,然后运行它们。
英文:
That's not the package you want. That one is Linux only and is unprofessional. Instead, try:
pip install ffmpeg-python
Note, however, that you will need to install ffmpeg (the command line, not the Python module) before you do that. There are instructions on the git page.
https://github.com/kkroening/ffmpeg-python
In case it's not clear, ffmpeg is a very large, complicated, and capable command-line toolkit. The Python modules don't actually do any video work -- they all just build complicated ffmpeg command lines and then run them.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论