anon_swe
anon_swe

Reputation: 9355

ImportError: cannot import name 'VideoCapture'

I'm writing a quick Python script that uses VideoCapture. At the start of the script, I have this:

 from skvideo.io import VideoCapture

When I run the script, I get:

Traceback (most recent call last):
  File "getVids.py", line 4, in <module>
    from skvideo.io import VideoCapture
ImportError: cannot import name 'VideoCapture'

When I run:

pip3 install skvideo

I get:

Collecting skvideo
  Could not find a version that satisfies the requirement skvideo (from versions: )
No matching distribution found for skvideo

Any idea how to fix / where to go from here?

Thanks!

Upvotes: 0

Views: 5685

Answers (3)

Daniel van Flymen
Daniel van Flymen

Reputation: 11551

This smells like an environment variable problem. You shouldn't need sudo or administrator privileges to do this.

First, make sure that you run your script inside a virtual environment:

  1. Create a Virtualenv: virtualenv my_env
  2. Activate it: source my_env/bin/activate
  3. Install your requirements: pip install sk-video
  4. Run your script: python getVids.py

Upvotes: 0

languitar
languitar

Reputation: 6794

The pip package providing this python module/package is call sk-video.

pip3 install sk-video

Upvotes: 4

jeweljames
jeweljames

Reputation: 1

You should try

sudo pip install sk-video

as suggested in their installation guide. http://www.scikit-video.org/stable/

Upvotes: 0

Related Questions