简体   繁体   English

Maya Python - “您需要基于 shiboken 的类型”错误

[英]Maya Python - "You need a shiboken-based type" Error

Many Python based tools in Maya are now returning an error that is new to me. Maya 中的许多基于 Python 的工具现在都返回一个对我来说很新的错误。 " You need a shiboken-based type. # " "你需要一个基于 shiboken 的类型。# "

Very fresh to Python, so I don't really know what the issue is. Python 非常新鲜,所以我真的不知道问题是什么。 After looking around a bit a figured out it's maybe a conflict of definitions环顾四周后发现这可能是定义冲突

The " QtGui " module is probably being imported more than one times, creating said conflict. QtGui ”模块可能被多次导入,造成了上述冲突。 Not entirely sure that's the main cause, but it's the main suspect for now.不完全确定这是主要原因,但它是目前的主要嫌疑人。

Now to be honest, I have just now started noticing that some of Maya's Python tools are not functioning because of this (like the "Type" creation tool), meaning that I have installed/uninstalled several python packages using pip before coming across the issue.现在老实说,我刚刚开始注意到 Maya 的一些 Python 工具因此无法运行(例如“类型”创建工具),这意味着我在遇到问题之前已经使用pip安装/卸载了几个 python 包. I have no clue which package could be causing the conflict.我不知道哪个包可能导致冲突。

Are there any usual suspects that can cause this conflict?是否有任何常见的嫌疑人会导致这种冲突? I tried uninstalling some of the more recent packages but with no luck.我尝试卸载一些较新的软件包,但没有成功。

I also wouldn't want to damage anything else by individually removing packages until I find it.在我找到它之前,我也不想通过单独移除包裹来损坏其他任何东西。

These are the packages installed:这些是安装的软件包:

• aenum 2.2.3 • 枚举 2.2.3
• altgraph 0.10.2 • altgraph 0.10.2
• appdirs 1.4.3 • 应用程序目录 1.4.3
• bdist-mpkg 0.5.0 • bdist-mpkg 0.5.0
• blinker 1.4 • 闪光灯 1.4
• bonjour-py 0.3 • 卓悦 0.3
• docutils 0.16 • 文档工具 0.16
• macholib 1.5.1 • macholib 1.5.1
• matplotlib 1.3.1 • matplotlib 1.3.1
• modulegraph 0.10.4 • 模块图 0.10.4
• nine 1.1.0 • 九个 1.1.0
• nose 1.3.7 • 鼻子 1.3.7
• numpy 1.8.0rc1 • numpy 1.8.0rc1
• pip 20.0.2 • 点 20.0.2
• ply 3.11 • 3.11 层
• ptvsd 4.3.2 • ptvsd 4.3.2
• py2app 0.7.3 • py2app 0.7.3
• PyFlow 2.0.1 • PyFlow 2.0.1
• pyobjc-core 2.5.1 • pyobjc 核心 2.5.1
• pyobjc-framework-Accounts 2.5.1 • pyobjc-framework-Accounts 2.5.1
• pyobjc-framework-AddressBook 2.5.1 • pyobjc-framework-AddressBook 2.5.1
• pyobjc-framework-AppleScriptKit 2.5.1 • pyobjc-framework-AppleScriptKit 2.5.1
• pyobjc-framework-AppleScriptObjC 2.5.1 • pyobjc-framework-AppleScriptObjC 2.5.1
• pyobjc-framework-Automator 2.5.1 • pyobjc-framework-Automator 2.5.1
• pyobjc-framework-CFNetwork 2.5.1 • pyobjc-framework-CFNetwork 2.5.1
• pyobjc-framework-Cocoa 2.5.1 • pyobjc-framework-Cocoa 2.5.1
• pyobjc-framework-Collaboration 2.5.1 • pyobjc-framework-Collaboration 2.5.1
• pyobjc-framework-CoreData 2.5.1 • pyobjc-framework-CoreData 2.5.1
• pyobjc-framework-CoreLocation 2.5.1 • pyobjc-framework-CoreLocation 2.5.1
• pyobjc-framework-CoreText 2.5.1 • pyobjc-framework-CoreText 2.5.1
• pyobjc-framework-DictionaryServices 2.5.1 • pyobjc-framework-DictionaryServices 2.5.1
• pyobjc-framework-EventKit 2.5.1 • pyobjc-framework-EventKit 2.5.1
• pyobjc-framework-ExceptionHandling 2.5.1 • pyobjc-framework-ExceptionHandling 2.5.1
• pyobjc-framework-FSEvents 2.5.1 • pyobjc-framework-FSEvents 2.5.1
• pyobjc-framework-InputMethodKit 2.5.1 • pyobjc-framework-InputMethodKit 2.5.1
• pyobjc-framework-InstallerPlugins 2.5.1 • pyobjc-framework-InstallerPlugins 2.5.1
• pyobjc-framework-InstantMessage 2.5.1 • pyobjc-framework-InstantMessage 2.5.1
• pyobjc-framework-LatentSemanticMapping 2.5.1 • pyobjc-framework-LatentSemanticMapping 2.5.1
• pyobjc-framework-LaunchServices 2.5.1 • pyobjc-framework-LaunchServices 2.5.1
• pyobjc-framework-Message 2.5.1 • pyobjc-framework-Message 2.5.1
• pyobjc-framework-OpenDirectory 2.5.1 • pyobjc-framework-OpenDirectory 2.5.1
• pyobjc-framework-PreferencePanes 2.5.1 • pyobjc-framework-PreferencePanes 2.5.1
• pyobjc-framework-PubSub 2.5.1 • pyobjc-framework-PubSub 2.5.1
• pyobjc-framework-QTKit 2.5.1 • pyobjc-framework-QTKit 2.5.1
• pyobjc-framework-Quartz 2.5.1 • pyobjc-framework-Quartz 2.5.1
• pyobjc-framework-ScreenSaver 2.5.1 • pyobjc-framework-ScreenSaver 2.5.1
• pyobjc-framework-ScriptingBridge 2.5.1 • pyobjc-framework-ScriptingBridge 2.5.1
• pyobjc-framework-SearchKit 2.5.1 • pyobjc-framework-SearchKit 2.5.1
• pyobjc-framework-ServiceManagement 2.5.1 • pyobjc-framework-ServiceManagement 2.5.1
• pyobjc-framework-Social 2.5.1 • pyobjc-framework-Social 2.5.1
• pyobjc-framework-SyncServices 2.5.1 • pyobjc-framework-SyncServices 2.5.1
• pyobjc-framework-SystemConfiguration 2.5.1 • pyobjc-framework-SystemConfiguration 2.5.1
• pyobjc-framework-WebKit 2.5.1 • pyobjc-framework-WebKit 2.5.1
• Pyomo 5.6.8 • Pyomo 5.6.8
• pyOpenSSL 0.13.1 • pyOpenSSL 0.13.1
• pyparsing 2.0.1 • pyparsing 2.0.1
• PyQt5 5.14.1 • PyQt5 5.14.1
• PyQt5-sip 12.7.1 • PyQt5-sip 12.7.1
• PySide2 5.14.1 • PySide2 5.14.1
• python-dateutil 1.5 • python-dateutil 1.5
• pytz 2013.7 • pytz 2013.7
• PyUtilib 5.7.3 • PyUtilib 5.7.3
• Qt.py 1.2.4 • Qt.py 1.2.4
• qtwidgets 0.11 • qtwidgets 0.11
• scipy 0.13.0b1 • scipy 0.13.0b1
• setuptools 18.5 • 设置工具 18.5
• setuptools 28.8.0 • 设置工具 28.8.0
• shiboken2 5.14.1 • shiboken2 5.14.1
• six 1.14.0 • 六个 1.14.0
• six 1.4.1 • 六个 1.4.1
• vboxapi 1.0 • vboxapi 1.0
• xattr 0.6.4 • xattr 0.6.4
• zope.interface 4.1.1 • zope.interface 4.1.1

Any help would be greatly appreciated.任何帮助将不胜感激。

EDIT - 12/3/2020 20:30编辑 - 12/3/2020 20:30

As an example for when this error occurs, I'm also including this script from PyFlow:作为发生此错误时的示例,我还包括来自 PyFlow 的此脚本:

import ptvsd
from maya import OpenMayaUI as omui
from shiboken2 import wrapInstance
from PyFlow.App import PyFlow
from PySide2.QtWidgets import QWidget

try:
    long  # Python 2
except NameError:
    long = int  # Python 3path

ptvsd.enable_attach(address=('0.0.0.0', 3000), redirect_output=True)

mayaMainWindowPtr = omui.MQtUtil.mainWindow()
mayaMainWindow = wrapInstance(long(mayaMainWindowPtr), QWidget)

if PyFlow.appInstance is None:
    instance = PyFlow.instance(mayaMainWindow, "maya")
    instance.show()

" PyFlow " is a promising little tool for visual scripting, which is great for novices like myself. PyFlow ”是一个很有前途的可视化脚本小工具,非常适合像我这样的新手。 The issues didn't start when I first ran it, but it helped me notice the error that many other python-based tools in Maya were giving now as well.当我第一次运行它时,问题并没有开始,但它帮助我注意到 Maya 中许多其他基于 python 的工具现在也出现的错误。

If I attempt to run this for example:例如,如果我尝试运行它:

" # Error: TypeError: file line 15: You need a shiboken-based type. # " " # Error: TypeError: file line 15: You need a shiboken-based type. # "

have you an example of script that import QT ui.你有一个导入 QT ui 的脚本示例。 Which version of maya are you using also ?您还使用哪个版本的 Maya?

are all your imports look like this :你所有的进口都是这样的:

from PySide2 import QtWidgets, QtGui, QtCore
import shiboken2

have you maybe mix PyQt and PySide with some " import sip2 "你有没有可能将 PyQt 和 PySide 与一些“ import sip2 ”混合在一起

---EDIT--- - -编辑 - -

from maya import OpenMayaUI as omui
from shiboken2 import wrapInstance
from PyFlow.App import PyFlow
import PySide2.QtWidgets as QtWidgets

mayaMainWindowPtr = omui.MQtUtil.mainWindow()
mayaMainWindow = wrapInstance(long(mayaMainWindowPtr), QtWidgets.QWidget)

if PyFlow.appInstance is None:
    instance = PyFlow().instance(mayaMainWindow, 'maya')
    instance.show()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM