首页 \ 问答 \ macOS Sierra为python2.7安装PyQt5(macOS Sierra install PyQt5 for python2.7)

macOS Sierra为python2.7安装PyQt5(macOS Sierra install PyQt5 for python2.7)

我正在拼命地在运行macOS Sierra的Mac上为python2.7安装PyQt5。 我试过跑:

brew install pyqt5

以及下载源代码和编译自己。 任何人都可以向我提供一些快速命令,我可以将其复制/粘贴到终端以安装PyQt5 for python2.7吗?


I'm trying desperately to install PyQt5 for python2.7 on my Mac running macOS Sierra. I've tried running:

brew install pyqt5

As well as downloading the source code and compiling myself. Can anybody provide me with some quick commands that I can copy/paste into terminal to install PyQt5 for python2.7?


原文:
更新时间:2022-06-23 22:06

最满意答案

首先,在您的代码中,您不应该将queryInterface方法分配给变量,而是return它:

...
return queryInterface.createTable('users', {
...

down功能相同:

return queryInterface.dropTable('users');

更重要的是,为了反映数据库中的这些变化,你应该使用sequelize-cli 。 您可以通过sequelize db:migrate运行sequelize db:migrate 。 您还可以使用sequelize help获取有关CLI命令和选项的更多信息。


First of all, in your code you should not assign the queryInterface method to variable, instead return it:

...
return queryInterface.createTable('users', {
...

The same in the down function:

return queryInterface.dropTable('users');

What is more, in order to reflect those changes in the database, you should use the sequelize-cli. You can run migrations via sequelize db:migrate. You can also use sequelize help in order to get more information concerning commands and options of the CLI.

相关问答

更多
  • 不应该 queryInterface.sequelize.query(`UPDATE myTable SET name = 'bob' WHERE name = 'fred'`) 单引号用于正确的字符串,但您可以使用双引号。 这个答案有更多的信息 Should it not be queryInterface.sequelize.query(`UPDATE myTable SET name = 'bob' WHERE name = 'fred'`) Single quotes are for prope ...
  • 对于你的版本“sequelize”:“^ 4.13.2” : classMethods和instanceMethods被删除。 以前: const Model = sequelize.define('Model', { ... }, { classMethods: { associate: function (model) {...} }, instanceMethods: { someMethod: function () { ...} ...
  • 您可以使用@ mcranston18提到的帮助程序方法。 另外,您还可以传递env变量以选择要查询的数据库。 NODE_ENV=test ./node_modules/.bin/sequelize db:migrate:status 这会给你一个这样的输出 Up表示迁移已针对当前数据库运行,而向下意味着它没有运行。 默认的env会从你的Sequelize/index.js挑选出来 这个数据由Sequelize在名为SequelizeMeta的表中SequelizeMeta 。 您也可以直接查询此表以了解上 ...
  • 使用迁移时,不会为您创建主键,updatedAt和createdAt字段。 相反,您应该确保在迁移中创建这些列。 要使updatedAt和createdAt列自动更新,可以在模型中使用钩子。 即: module.exports = function (sequelize, DataTypes) { var Person = sequelize.define('Person', { id: { type: DataTypes.INTEGER, ...
  • Sequelize-cli将迁移数据存储在名为SequelizeMeta的表中。 您可以从现有数据库中复制迁移文件名,并在新环境的数据库中插入上述表格。 记录的所有迁移都将被视为已经运行。 虽然这会阻止选定的迁移运行,但这不是最好的方法。 这个元数据也可以存储在json中,虽然我不太了解它的结构。 你可以在这里挖掘文档 Sequelize-cli stores the migration data on a table called SequelizeMeta. You can copy the migra ...
  • 有没有办法在进行迁移时自动更新模型文件? 很不幸的是,不行。 续集模型和迁移之间没有同步级别,除了它们从sequelize model:create的初始sequelize model:create 。 但是,此问题中建议的工作流程是更新应从迁移传播到模型。 这让我感到困惑,因为通常会根据模型的更改自动生成迁移,反之亦然。 跟踪这些功能的问题一直存在,您可能会发现有助于订阅这些功能: 从模型生成初始迁移? 自动创建迁移 是否可以生成迁移以更新现有模型? 社区建议/解决方案: 请参阅https://stack ...
  • 没有不同。 Umzug是一个JS库。 Sequelize-CLI是一个在内部运行umzug的命令行工具。 No difference. Umzug is a JS library. Sequelize-CLI is a command line tool running umzug internally.
  • 首先,在您的代码中,您不应该将queryInterface方法分配给变量,而是return它: ... return queryInterface.createTable('users', { ... down功能相同: return queryInterface.dropTable('users'); 更重要的是,为了反映数据库中的这些变化,你应该使用sequelize-cli 。 您可以通过sequelize db:migrate运行sequelize db:migrate 。 您还可以使用sequ ...
  • Sequelize有一种通过模型名称关联相关模型的方法。 所以举个例子 var User = sequelize.define('user', { ... }); var Todo = sequelize.define('todo', { ... }); Todo.belongsTo(User); // Will create/use `userId` in Todo table 但在您的情况下,您将表名作为大写字母: var User = sequelize.define('User', { ... ...
  • 您需要在传递给Umzug的构造函数的对象的migrations属性中定义params属性 - 它定义传递给up和down函数的参数。 我想配置对象应如下所示 { storage: 'sequelize', storageOptions: { sequelize: sequelize // here should be a sequelize instance, not the Sequelize module }, migrations: { ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)