-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[email protected]_py310: runtime issue with PySide #558
Comments
so i attempted to resolve this issue yesterday by modifying the cmake file that sets up pyside for the freecad package by installing / placing the freecad "proxy" however when running freecad and then issue the below commands in the freecad console i do not see an errors related loading of either of the modules.
i did / do not get any errors when loading those modules in the python console.
|
freecad forum post referencing this github issue, |
heres a little followup to this ongoing issue. i'm able to interact with the Draft workbench using freecad in a headless mode, as seen in the below python console session. i'm also able to open the document using the same built and installed freecad using the GUI. finally the below error message occurs in the GUI when i attempt to load the Draft Workbench 🤷♂️
on going error message
|
doing some more logging, 🧐
|
|
You are importing gui code from the CLI version? |
i reran a few of those commands from a GUI, and am still getting the below errors.
|
little follow up to this issue. when building either a bottled version for macos m1, or building via cmake from a cli i'm still getting the above mentioned errors related to the opening up a freecad repl on the m1 i get the below output,
from what i can see the proxy file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/Ext/PySide)
file(WRITE ${CMAKE_BINARY_DIR}/Ext/PySide/__init__.py "# PySide wrapper\n"
"from PySide${PYSIDE_MAJOR_VERSION} import __version__\n"
"from PySide${PYSIDE_MAJOR_VERSION} import __version_info__\n")
file(WRITE ${CMAKE_BINARY_DIR}/Ext/PySide/QtCore.py "from PySide${PYSIDE_MAJOR_VERSION}.QtCore import *\n\n"
"#QCoreApplication.CodecForTr=0\n"
"#QCoreApplication.UnicodeUTF8=1\n")
file(WRITE ${CMAKE_BINARY_DIR}/Ext/PySide/QtNetwork.py "from PySide${PYSIDE_MAJOR_VERSION}.QtNetwork import *\n")
if(BUILD_GUI)
file(WRITE ${CMAKE_BINARY_DIR}/Ext/PySide/QtGui.py "from PySide${PYSIDE_MAJOR_VERSION}.QtGui import *\n"
"from PySide${PYSIDE_MAJOR_VERSION}.QtWidgets import *\n"
"QHeaderView.setResizeMode = QHeaderView.setSectionResizeMode\n")
file(WRITE ${CMAKE_BINARY_DIR}/Ext/PySide/QtSvg.py "from PySide${PYSIDE_MAJOR_VERSION}.QtSvg import *\n")
file(WRITE ${CMAKE_BINARY_DIR}/Ext/PySide/QtUiTools.py "from PySide${PYSIDE_MAJOR_VERSION}.QtUiTools import *\n")
file(WRITE ${CMAKE_BINARY_DIR}/Ext/PySide/QtWidgets.py "from PySide${PYSIDE_MAJOR_VERSION}.QtWidgets import *\n")
if(PYSIDE_MAJOR_VERSION LESS 6)
file(WRITE ${CMAKE_BINARY_DIR}/Ext/PySide/QtSvgWidgets.py "from PySide${PYSIDE_MAJOR_VERSION}.QtSvg import QGraphicsSvgItem\n"
"from PySide${PYSIDE_MAJOR_VERSION}.QtSvg import QSvgWidget\n")
file(WRITE ${CMAKE_BINARY_DIR}/Ext/PySide/QtWebEngineWidgets.py "from PySide${PYSIDE_MAJOR_VERSION}.QtWebEngineWidgets import *\n")
else()
file(WRITE ${CMAKE_BINARY_DIR}/Ext/PySide/QtSvgWidgets.py "from PySide${PYSIDE_MAJOR_VERSION}.QtSvgWidgets import *\n")
file(WRITE ${CMAKE_BINARY_DIR}/Ext/PySide/QtWebEngineWidgets.py "from PySide${PYSIDE_MAJOR_VERSION}.QtWebEngineWidgets import *\n"
"from PySide${PYSIDE_MAJOR_VERSION}.QtWebEngineCore import QWebEnginePage\n")
endif()
endif() https://github.com/FreeCAD/FreeCAD/blob/main/cMake/FreeCAD_Helpers/SetupShibokenAndPyside.cmake and part of the reason why the proxy if(APPLE AND NOT BUILD_WITH_CONDA)
install(
DIRECTORY
${CMAKE_BINARY_DIR}/Ext/PySide
DESTINATION
MacOS
)
else()
install(
DIRECTORY
${CMAKE_BINARY_DIR}/Ext/PySide
DESTINATION
Ext
)
endif() |
i think i finally figure this one out. 🤞 for reasons i don't understand the formula within the tap ie. so the work around is to still build the formula, but just include it in the cmake prefix path when building freecad, because the pyside2 formula in the tap also constructs a just built freecad using cmake on the freecad community m1. and am able to open the draft workbench 🥳 |
I have got a similar issue. I reinstalled FreeCAD twice, but even a fresh install gives me errors like @ipatch has. I never had that issue before on this pc. I get this when trying to switch to the Draft workbench:
This is what I get when loading the Addon Manager:
|
Just installed FreeCAD 0.20.2, which is over 2 years old, and get this error on startup:
This makes me think that this is not related to FreeCAD, or at least not directly. Maybe something is wrong with the environment variables. Or some Windows update messed something up. Weird, that we have similar problems. I did mess around with loading the FreeCAD API without the GUI before that and reinstalling my system python interpreter, but a FreeCAD reinstall should fix all issues due to me messing up the system, since FreeCAD uses its own python interpreter. OS: Windows 10 22H2 (Build 19045.5131) |
@alekssadowski95 hey thanks for the comments. this repo under the freecad org, ie. github.com/freecad is specifically setup to manage the homebrew-freecad tap, ie. this repo github.com/freecad/homebrew-freecad, which currently only supports linux and macos using homebrew, ie. github.com/homebrew |
it seems the most recent bottle when installed on m1 hardware is having issues with workbenches that require the "proxy" PySide module setup by freecad itself as the native name for the pyside2 module is
PySide2
and the native module for pyside6 isPySide6
. freecad it self sets up a "proxy" python module that should allow either thePySide2
orPySide6
module to be referenced / used from thePySide
module (from what i understand).so workbenches like
Draft
andArch
will not properly load.The text was updated successfully, but these errors were encountered: