Python链接在Apache上运行Django时遇到问题,mod_wsgi:找不到符号__cg_jpeg_resync_to_restart [英] Python Linking Problem while running Django on Apache with mod_wsgi: symbol not found __cg_jpeg_resync_to_restart

查看:293
本文介绍了Python链接在Apache上运行Django时遇到问题,mod_wsgi:找不到符号__cg_jpeg_resync_to_restart的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试在apache上运行我的django网站时,我得到这个错误。该网站在开发服务器上工作:

  ViewDoesNotExist at / 
无法导入myproject.modulename.views。错误是:dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_tkinter.so,2):找不到符号:__cg_jpeg_resync_to_restart
引用自:/ System /图书馆/框架/ ApplicationServices.framework /版本/ A /框架/ ImageIO.framework /版本/ A / ImageIO
预期在:/Applications/MAMP/Library/lib/libjpeg.8.dylib

我不知道如何解决问题。其他django站点工作在这个apache安装。该目录位于我的apache.conf文件中指定的路径(请参阅帖子底部)。



错误消息中引用的三个文件存在于指定的位置。


  1. _tkinter.so - /Library/Frameworks/Python.framework/Versions/2.7/lib/ python2.7 / lib-dynload / _tk​​inter.so


  2. ImageIO - / System / Library / Frameworks /ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/ImageIO


  3. libjpeg.8.dylib - /Applications/MAMP/Library/lib/libjpeg.8.dylib


我不知道什么 __ cg_jpeg_resync_to_restart 是。



以下是我提出的原始消息我试图找出错误信息的意思。感谢sacabuche指向我正确的方向。



我正在尝试让一个Django网站在apache上运行。它适用于django开发服务器,但是当我尝试使用mod_wsgi在apache上运行时,我收到此错误。我知道mod_wsgi的作品,因为我在我的mamp开发服务器上工作了一个小的试用站点(这是一个缩小版本的stie)。我通过这个帖子在别人的帮助下管理的一个壮举: Django / mod_wsgi和PHP作为使用MAMP的同一Apache服务器上的虚拟主机



新站点使用不同的数据库现在是在localhost根目录,但是其他方式非常相似,所以这个错误让我感到困惑。



这是我的apache conf的代码(注意:php的网站的作品,并且如果我将WSGIDaemonProcess重定向到旧站点,则会加载无问题):




ServerName localhost
UseCanonicalName Off
DocumentRoot / applications / MAMP / htdocs

 别名/ phpsite /应用程序/ MAMP / htdocs / phpsite 
< /应用/ MAMP / htdocs中/ phpsite >
选项索引FollowSymLinks
AllowOverride无
订单允许,拒绝
允许从所有
< / Directory>

WSGIDaemonProcess site1 display-name =%{GROUP}
WSGIProcessGroup site1
别名/媒体/ /应用/ MAMP / htdocs / media /
<目录/应用程序/ MAMP / htdocs中/介质>
选项ExecCGI
订单拒绝,允许
允许从所有
< / Directory>
WSGIScriptAlias / /Users/sequoia/djangoprojects/myproject/apache/django.wsgi
< Directory / Users / sequoia / djangoprojects / myproject / apache>
订单拒绝,允许
允许从所有
< / Directory>
< / VirtualHost>

谢谢。

解决方案

好像一个符号链接已经坏了,所以我看了,我发现了一些此论坛



删除中的符号链接libpng.dylib和libjpeg.dylib <安装目录> / lib



在正确的库中创建新的符号链接

  ln -s /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libPNG.dylib / Applications / MAMP /Library/lib/libPNG.dylib 

ln -s /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libJPEG.dylib /应用程序/ MAMP / Library / lib / libJPEG.dylib

我没有Mac在这里, strong>我将验证是否存在符号链接的起源,我ho pe这将解决你的问题。


I get this error when I try to run my django site on apache. The site works on the development server:

ViewDoesNotExist at / 
Could not import myproject.modulename.views. Error was: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_tkinter.so, 2): Symbol not found: __cg_jpeg_resync_to_restart
Referenced from: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/ImageIO
Expected in: /Applications/MAMP/Library/lib/libjpeg.8.dylib

I am not sure how to resolve the issue. Other django sites work on this apache installation. The directory is on the path specified in my apache.conf file (see bottom of the post).

The three files referenced in the error message exist in the locations indicated.

  1. _tkinter.so - /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_tkinter.so

  2. ImageIO - /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/ImageIO

  3. libjpeg.8.dylib - /Applications/MAMP/Library/lib/libjpeg.8.dylib

I am not sure what __cg_jpeg_resync_to_restart is.

Below is the original message I put up when I was trying to figure out what the error message meant. Thanks to sacabuche for pointing me in the right direction.

I am trying to get a Django Site to run on apache. It works on the django development server, but I get this error when I try to run it on apache with mod_wsgi. I know mod_wsgi works because I had a small trial site (that was a scaled down version of this stie) working on my mamp development server. A feat I managed with the help of others via this post: Django/mod_wsgi and PHP as Virtual Hosts on same Apache Server using MAMP

The new site uses a different database and is now at the localhost root, but otherwise is very similar, so this error is baffling me.

Here is the code for my apache conf (note: the php site works, and if I redirect the WSGIDaemonProcess to the old site, it loads without problem):

ServerName localhost UseCanonicalName Off DocumentRoot "/Applications/MAMP/htdocs"

Alias /phpsite /Applications/MAMP/htdocs/phpsite
    <Directory "/Applications/MAMP/htdocs/phpsite">
        Options Indexes FollowSymLinks
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>

    WSGIDaemonProcess site1 display-name=%{GROUP}
    WSGIProcessGroup site1
    Alias /media/ /Applications/MAMP/htdocs/media/
    <Directory /Applications/MAMP/htdocs/media>
        Options ExecCGI 
        Order deny,allow
        Allow from all
    </Directory>
    WSGIScriptAlias / /Users/sequoia/djangoprojects/myproject/apache/django.wsgi
    <Directory /Users/sequoia/djangoprojects/myproject/apache>
        Order deny,allow
        Allow from all
    </Directory>
</VirtualHost>

Thanks.

解决方案

Well it seems that a symlink is broken, so i looked and i found something in this forum

delete the symlinks "libpng.dylib" and "libjpeg.dylib" in "<installation directory>/lib"

Create new symlinks to the right libs.

ln -s /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libPNG.dylib /Applications/MAMP/Library/lib/libPNG.dylib

ln -s /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libJPEG.dylib /Applications/MAMP/Library/lib/libJPEG.dylib

I have no Mac rigth here, but first i would verify that the origin of the symlink exist, i hope this will solve your problem.

这篇关于Python链接在Apache上运行Django时遇到问题,mod_wsgi:找不到符号__cg_jpeg_resync_to_restart的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆