尝试在OSX上安装psycopg2会导致以下结果:
building 'psycopg2._psycopg' extension
creating build/temp.macosx-10.6-universal-2.6
creating build/temp.macosx-10.6-universal-2.6/psycopg
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch ppc -arch x86_64 -pipe -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4 (dt dec pq3 ext)" -DPG_VERSION_HEX=0x090003 -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -I. -I/usr/local/Cellar/postgresql/9.0.3/include -I/usr/local/Cellar/postgresql/9.0.3/include/server -c psycopg/psycopgmodule.c -o build/temp.macosx-10.6-universal-2.6/psycopg/psycopgmodule.o
/usr/libexec/gcc/powerpc-apple-darwin10/4.2.1/as: assembler (/usr/bin/../libexec/gcc/darwin/ppc/as or /usr/bin/../local/libexec/gcc/darwin/ppc/as) for architecture ppc not installed
Installed assemblers are:
/usr/bin/../libexec/gcc/darwin/x86_64/as for architecture x86_64
/usr/bin/../libexec/gcc/darwin/i386/as for architecture i386
psycopg/psycopgmodule.c:1009: fatal error: error writing to -: Broken pipe
compilation terminated.
lipo: can't open input …
Run Code Online (Sandbox Code Playgroud) 我试图从一个Django应用程序的几个模型迁移到另一个基于这个问题,我如何迁移模型出一个Django应用程序,进入一个新的?我已经有了很多工作但是在创建第一次迁移时我收到了这个错误:
"The model 'contenttype' from the app 'contenttypes' is not available in this migration."
Run Code Online (Sandbox Code Playgroud)
谷歌和SO似乎没有找到任何发生这种情况的案例,上述问题也没有任何具体的说法,除了代码中的评论:
if not db.dry_run:
# For permissions to work properly after migrating
orm['contenttypes.contenttype'].objects.filter(app_label='common', model='cat').update(app_label='specific')
Run Code Online (Sandbox Code Playgroud)
真的很感激任何洞察我做错了什么.
以下是两个迁移文件:
创建:
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
db.rename_table('cars_country', 'general_country')
if not db.dry_run:
# For permissions to work properly after migrating
orm['contenttypes.ContentType'].objects.filter(app_label='cars', model='country').update(app_label='general')
def backwards(self, orm):
pass
Run Code Online (Sandbox Code Playgroud)
删除:
# encoding: utf-8
import datetime …
Run Code Online (Sandbox Code Playgroud) 我有一个可运行的原生 iPhone/iPad 应用程序,我现在正尝试将其用作 Mac Catalyst 应用程序。一切似乎都在工作,除了当我在 iOS 版本上输入某些内容时,它“破坏”了 macOS 版本——我正在使用 CloudKit 和 CloudKit 订阅来监听数据库中的变化。
我把这个记录到日志中 3 次:
2020-04-25 09:58:35.612887+0300 MyApp[2871:206093] [assertion] Error acquiring assertion: <NSError: 0x600000d4cb40; domain: RBSAssertionErrorDomain; code: 2; reason: "Specified target process does not exist">
2020-04-25 09:58:35.613919+0300 MyApp[2871:206093] [assertion] Error acquiring assertion: <NSError: 0x600000d4d290; domain: RBSAssertionErrorDomain; code: 2; reason: "Specified target process does not exist">
2020-04-25 09:58:35.615102+0300 MyApp[2871:206093] [assertion] Error acquiring assertion: <NSError: 0x600000d4de00; domain: RBSAssertionErrorDomain; code: 2; reason: "Specified target process does not exist">
Run Code Online (Sandbox Code Playgroud)
这种行为真的很奇怪。macOS 版本实际上并没有崩溃,但主窗口消失了,我必须在 XCode …