pyhton3.* 报错Symbol not found: _clock_gettime

那些年mac的那些坑

运行django程序时遇到了一个神奇的问题,几番搜索都没找到解决办法,只发现了分布面很广,装ruby啊mongo啊的时候都有人遇到过这个问题,觉得应该是最底层的环境有问题。(mac)

截取部分报错如下:

from PIL import Image
File "/Users/jiao/Desktop/qr_generate/lib/python3.6/site-packages/PIL/Image.py", line 60

from . import _imaging as core
ImportError: dlopen(/Users/jiao/Desktop/qr_generate/lib/python3.6/site-packages/PIL/_imaging.cpython-36m-darwin.so, 2): Symbol not found: _clock_gettime
Referenced from: /Users/jiao/Desktop/qr_generate/lib/python3.6/site-packages/PIL/.dylibs/liblzma.5.dylib (which was built for Mac OS X 10.12)
Expected in: /usr/lib/libSystem.B.dylib
in /Users/jiao/Desktop/qr_generate/lib/python3.6/site-packages/PIL/.dylibs/liblzma.5.dylib

Process finished with exit code 1

这个是由于Xcode版本问题引起的,解决办法是去苹果官网下载最新版的Xcode就行了。网址:
https://developer.apple.com/download/more/
要用苹果id登录进去,然后选择Xcode进行下载,下载完打开就会进行自动安装,so easy。当然有可能你会遇到和我一样的问题,那就是下载下来发现系统根本不支持最新版本的Xcode,那就没有任何办法了,只能顺便升级一下mac的系统,升级完就好了。

你可能感兴趣的:(工作日志)