Macos 未找到符号:_PQclear(OSX服务器上的Mavericks更新后caldav服务器工具损坏)

Macos 未找到符号:_PQclear(OSX服务器上的Mavericks更新后caldav服务器工具损坏),macos,python-2.7,osx-mavericks,caldav,osx-server,Macos,Python 2.7,Osx Mavericks,Caldav,Osx Server,将我的服务器升级到Mavericks和server.app版本3后,这些工具停止正常工作: calendarserver_导出 calendarserver\u管理\u主体 ... 输入此命令时,例如: sudo日历服务器\u导出-u 然后显示此错误: 回溯(最近一次呼叫最后一次): 文件“/Applications/Server.app/Contents/ServerRoot/usr/sbin/calendarserver\u export”,第32行,在 从calendarse

将我的服务器升级到Mavericks和server.app版本3后,这些工具停止正常工作:

calendarserver_导出
calendarserver\u管理\u主体
...

输入此命令时,例如:

sudo日历服务器\u导出-u
然后显示此错误:

回溯(最近一次呼叫最后一次):
文件“/Applications/Server.app/Contents/ServerRoot/usr/sbin/calendarserver\u export”,第32行,在
从calendarserver.tools.export导入主
文件“/Applications/Server.app/Contents/ServerRoot/usr/share/caldavd/lib/python/calendarserver/tools/export.py”,第50行,在
从calendarserver.tools.cmdline导入实用程序主,WorkerService
文件“/Applications/Server.app/Contents/ServerRoot/usr/share/caldavd/lib/python/calendarserver/tools/cmdline.py”,第21行,在
从calendarserver.tap.caldav导入CalDAVServiceMaker,CalDAVOptions
文件“/Applications/Server.app/Contents/ServerRoot/usr/share/caldavd/lib/python/calendarserver/tap/caldav.py”,第87行,在
从twistedcaldav.upgrade导入升级文件系统格式步骤,PostDBImportStep
文件“/Applications/Server.app/Contents/ServerRoot/usr/share/caldavd/lib/python/twistedcaldav/upgrade.py”,第63行,在
从calendarserver.tap.util导入getRootResource、FakereRequest、directoryFromConfig
文件“/Applications/Server.app/Contents/ServerRoot/usr/share/caldavd/lib/python/calendarserver/tap/util.py”,第87行,在
从txdav.base.datastore.subpostgres导入PostgresService
文件“/Applications/Server.app/Contents/ServerRoot/usr/share/caldavd/lib/python/txdav/base/datastore/subpostgres.py”,第35行,在
导入pgdb
文件“/Applications/Server.app/Contents/ServerRoot/usr/share/caldavd/lib/python/pgdb.py”,第66行,在
从pg导入*
ImportError:dlopen(/Applications/Server.app/Contents/ServerRoot/usr/share/caldavd/lib/python//u pg.so,2):未找到符号:\u PQclear
引用自:/Applications/Server.app/Contents/ServerRoot/usr/share/caldavd/lib/python//u pg.so
应为:平面命名空间
在/Applications/Server.app/Contents/ServerRoot/usr/share/caldavd/lib/python//u pg.so中
所有这些工具都有一个共同点,即通过PyGreSQL(caldav数据托管在postgres数据库中)通过python访问caldav数据。 我通过以下方法简单地重现了这个问题:

#使用root登录
鲍勃$sudo-i
#启动python并导入pg(python的postgres模块)
root$python
Python 2.7.5(默认,2014年3月9日,22:15:05)
[GCC 4.2.1达尔文兼容苹果LLVM 5.0(clang-500.0.68)]
有关详细信息,请键入“帮助”、“版权”、“信用证”或“许可证”。
>>>进口pg
回溯(最近一次呼叫最后一次):
文件“”,第1行,在
文件“/Library/Python/2.7/site packages/PyGreSQL-4.1.1-py2.7-macosx-10.9-intel.egg/pg.py”,第31行,中
从pg导入*
导入错误:dlopen(/Library/Python/2.7/site-packages/PyGreSQL-4.1.1-py2.7-macosx-10.9-intel.egg//u pg.so,2):未找到符号:\u PQclear
引用自:/Library/Python/2.7/site-packages/PyGreSQL-4.1.1-py2.7-macosx-10.9-intel.egg//u pg.so
应为:平面命名空间
在/Library/Python/2.7/site-packages/PyGreSQL-4.1.1-py2.7-macosx-10.9-intel.egg//u pg.so中
但是,如果我从我的用户帐户(而不是根帐户)启动python,我不会得到错误。
我假设路径有问题,或者类似的问题,但我找不到什么…
我需要有根凭据才能使用**calendarserver\u export**


任何线索???

出于某种原因,在mavericks中,您必须使用“calendar”用户(别名为_calendar)启动这些命令

因此,命令应该是: sudo-u日历日历服务器\u导出-u

sudo calendarserver_export -u <account_name>
    Traceback (most recent call last):
  File "/Applications/Server.app/Contents/ServerRoot/usr/sbin/calendarserver_export", line 32, in <module>
    from calendarserver.tools.export import main
  File "/Applications/Server.app/Contents/ServerRoot/usr/share/caldavd/lib/python/calendarserver/tools/export.py", line 50, in <module>
    from calendarserver.tools.cmdline import utilityMain, WorkerService
  File "/Applications/Server.app/Contents/ServerRoot/usr/share/caldavd/lib/python/calendarserver/tools/cmdline.py", line 21, in <module>
    from calendarserver.tap.caldav import CalDAVServiceMaker, CalDAVOptions
  File "/Applications/Server.app/Contents/ServerRoot/usr/share/caldavd/lib/python/calendarserver/tap/caldav.py", line 87, in <module>
    from twistedcaldav.upgrade import UpgradeFileSystemFormatStep, PostDBImportStep
  File "/Applications/Server.app/Contents/ServerRoot/usr/share/caldavd/lib/python/twistedcaldav/upgrade.py", line 63, in <module>
    from calendarserver.tap.util import getRootResource, FakeRequest, directoryFromConfig
  File "/Applications/Server.app/Contents/ServerRoot/usr/share/caldavd/lib/python/calendarserver/tap/util.py", line 87, in <module>
    from txdav.base.datastore.subpostgres import PostgresService
  File "/Applications/Server.app/Contents/ServerRoot/usr/share/caldavd/lib/python/txdav/base/datastore/subpostgres.py", line 35, in <module>
    import pgdb
  File "/Applications/Server.app/Contents/ServerRoot/usr/share/caldavd/lib/python/pgdb.py", line 66, in <module>
    from _pg import *
ImportError: dlopen(/Applications/Server.app/Contents/ServerRoot/usr/share/caldavd/lib/python/_pg.so, 2): Symbol not found: _PQclear
  Referenced from: /Applications/Server.app/Contents/ServerRoot/usr/share/caldavd/lib/python/_pg.so
  Expected in: flat namespace
 in /Applications/Server.app/Contents/ServerRoot/usr/share/caldavd/lib/python/_pg.so
#login with root
bob $ sudo -i
#launch python and import pg (postgres module for python)
root $ python
Python 2.7.5 (default, Mar  9 2014, 22:15:05) 
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pg
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Python/2.7/site-packages/PyGreSQL-4.1.1-py2.7-macosx-10.9-intel.egg/pg.py", line 31, in <module>
    from _pg import *
ImportError: dlopen(/Library/Python/2.7/site-packages/PyGreSQL-4.1.1-py2.7-macosx-10.9-intel.egg/_pg.so, 2): Symbol not found: _PQclear
  Referenced from: /Library/Python/2.7/site-packages/PyGreSQL-4.1.1-py2.7-macosx-10.9-intel.egg/_pg.so
  Expected in: flat namespace
 in /Library/Python/2.7/site-packages/PyGreSQL-4.1.1-py2.7-macosx-10.9-intel.egg/_pg.so