question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Library problem under python 2.7

See original GitHub issue

Hello, I’m trying to import ffmpeg into python script, but it looks like I have syntax problem.

import ffmpeg
stream = ffmpeg.input('input.mp4')
stream = ffmpeg.hflip(stream)
stream = ffmpeg.output(stream, 'output.mp4')
ffmpeg.run(stream)

I get syntax error

  File "pipe_stream.py", line 29, in <module>
    import ffmpeg
  File "/home/nvidia/.local/lib/python2.7/site-packages/ffmpeg/__init__.py", line 1, in <module>
    from .ffmpeg import FFmpegError
  File "/home/nvidia/.local/lib/python2.7/site-packages/ffmpeg/ffmpeg.py", line 52
    self._input_files.append(FFmpeg._File(url=url, options={**options, **kwargs}))
                                                             ^
SyntaxError: invalid syntax

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
kkroeningcommented, Feb 8, 2019

The error doesn’t look like it came from this ffmpeg-python library. How did you install ffmpeg-python?

Note that it’s pip install ffmpeg-python, not pip install ffmpeg or whatever.

0reactions
Taysssircommented, Jul 7, 2021

The same problem for me, it works fine with Python3 but not with 2.7

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python 2.7 — pip issue installing almost any library - Medium
I've been working with Python 3 for a while, but recently I was involve in an automation project that required python 2.7.5.
Read more >
Python Libraries installing to Python 2.7 by default
The best is to use alias , as this answer describes changing default Python version in Mac can cause multiple issues.
Read more >
Linking to system python lib fails… | Apple Developer Forums
This rebuilt the directory but started causing the issue defined in this thread and linking with the Python 2.7 libraries for my projects....
Read more >
Issue 27435: ctypes library loading and AIX - Python tracker
RTLD_MEMBER is a well documented constant needed for AIX dlopen. It is hard-coded in __init__.py > 2. Basic ctypes.util.find_library("crypto") ...
Read more >
os — Miscellaneous operating system interfaces — Python ...
All functions in this module raise OSError (or subclasses thereof) in the case of invalid or inaccessible file names and paths, or other...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found