Ask Your Question

import cv2 throws Symbol not found: _clock_gettime

asked 2018-01-09 21:09:29 -0500

Puneeth gravatar image

I have python 3.6 installed in my virtual env. I can import cv2 in my home directory. But when I change to any other directory it fails with following error: Please Help

import cv2

Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/name/anaconda/envs/env-name/lib/python3.6/site-packages/cv2/", line 4, in <module> from .cv2 import * ImportError: dlopen(/Users/name/anaconda/envs/env-name/lib/python3.6/site-packages/cv2/, 2): Symbol not found: _clock_gettime Referenced from: /Users/name/anaconda/envs/env-name/lib/python3.6/site-packages/cv2/.dylibs/libavutil.55.78.100.dylib (which was built for Mac OS X 10.12) Expected in: /usr/lib/libSystem.B.dylib in /Users/name/anaconda/envs/env-name/lib/python3.6/site-packages/cv2/.dylibs/libavutil.55.78.100.dylib

edit retag flag offensive close merge delete


I have the same problem how did you salf it???

feifeng gravatar imagefeifeng ( 2018-02-20 01:28:04 -0500 )edit

@feifeng please don't post answers here, if you have a question or comment, thank you.

berak gravatar imageberak ( 2018-02-20 02:17:12 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2018-01-10 16:45:18 -0500

I have the same problem on macOS X El Capitan 10.11.6.

I think this is an issue with python-opencv and mac operating system. From what I gather apple changed something to do with _clock_gettime function, meaning the maintainers of python-opencv will need to update.

edit flag offensive delete link more


Thanks for the reply.

Is there any simple work around to this problem other than

  1. Wait till python-opencv update themself to changed _clock_gettime function
  2. Or we update our Mac OS (assuming this problem wont come with higher Mac OS versions)
Puneeth gravatar imagePuneeth ( 2018-01-10 19:51:53 -0500 )edit

I am going to try upgrading my Mac from El Capitan to High Sierra this evening. I will let you know if it fixes the issue.

TheRealMarkWilliams gravatar imageTheRealMarkWilliams ( 2018-01-11 04:55:56 -0500 )edit

Upgrading to High Sierra fixed the problem for me

TheRealMarkWilliams gravatar imageTheRealMarkWilliams ( 2018-01-13 06:50:07 -0500 )edit

Thanks Man. You be the best. I will also try the same. Thanks

Puneeth gravatar imagePuneeth ( 2018-01-14 22:31:27 -0500 )edit

Hi, I faced the same error and i also updated the High Sierra Os after that i run it again showing,Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named cv2..what can i do kindly help me..Thanks in Advance

jega gravatar imagejega ( 2018-04-24 01:54:43 -0500 )edit

Question Tools

1 follower


Asked: 2018-01-09 21:04:48 -0500

Seen: 4,734 times

Last updated: Jan 09 '18