Skip to content
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

Use pyside6 with pyfluent and get ImportError #3607

Open
2 tasks done
rachelzhang333 opened this issue Jan 2, 2025 · 2 comments
Open
2 tasks done

Use pyside6 with pyfluent and get ImportError #3607

rachelzhang333 opened this issue Jan 2, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@rachelzhang333
Copy link

🔍 Before submitting the issue

  • I have searched among the existing issues
  • I am using a Python virtual environment

🐞 Description of the bug

I'm using pyside6 (pyDracula) to build GUI and connecting to pyfluent code. After importing pyside6, pyfluent could not be imported successfully.

Error message:

"c:/Users/u/OneDrive - Trane Technologies/Desktop/code/Modern_GUI_PyDracula_PySide6_or_PyQt6-master/have a test/main.py"
Traceback (most recent call last):
File "c:\Users\u\OneDrive - Trane Technologies\Desktop\code\Modern_GUI_PyDracula_PySide6_or_PyQt6-master\have a test\main.py", line 18, in
meshing = pyfluent.launch_fluent(precision="double", processor_count=4, mode="meshing", ui_mode="gui")
File "C:\Users\u\AppData\Local\Programs\Python\Python310\lib\site-packages\ansys\fluent\core\utils\deprecate.py", line 49, in wrapper
return func(*args, **kwargs)
File "C:\Users\u\AppData\Local\Programs\Python\Python310\lib\site-packages\ansys\fluent\core\utils\deprecate.py", line 49, in wrapper
return func(*args, **kwargs)
File "C:\Users\u\AppData\Local\Programs\Python\Python310\lib\site-packages\ansys\fluent\core\launcher\launcher.py", line 292, in launch_fluent
launcher = launcher_type(**launcher_argvals)
File "C:\Users\u\AppData\Local\Programs\Python\Python310\lib\site-packages\ansys\fluent\core\launcher\standalone_launcher.py", line 212, in init
self._launch_string += _build_journal_argument(
File "C:\Users\u\AppData\Local\Programs\Python\Python310\lib\site-packages\ansys\fluent\core\launcher\launcher_utils.py", line 85, in build_journal_argument
from beartype import BeartypeConf, beartype
File "C:\Users\u\AppData\Local\Programs\Python\Python310\lib\site-packages\beartype_init
.py", line 158, in
from beartype._decor.decormain import (
File "C:\Users\u\AppData\Local\Programs\Python\Python310\lib\site-packages\beartype_decor\decormain.py", line 26, in
from beartype._conf.confcls import BeartypeConf
File "C:\Users\u\AppData\Local\Programs\Python\Python310\lib\site-packages\beartype_conf\confcls.py", line 49, in
from beartype._conf.confoverrides import (
File "C:\Users\u\AppData\Local\Programs\Python\Python310\lib\site-packages\beartype_conf\confoverrides.py", line 14, in
from beartype.roar import BeartypeHintOverridesException
File "shibokensupport/signature/loader.py", line 61, in feature_imported
File "shibokensupport/feature.py", line 137, in feature_imported
File "shibokensupport/feature.py", line 148, in _mod_uses_pyside
File "C:\Users\u\AppData\Local\Programs\Python\Python310\lib\inspect.py", line 1147, in getsource
lines, lnum = getsourcelines(object)
File "C:\Users\u\AppData\Local\Programs\Python\Python310\lib\inspect.py", line 1128, in getsourcelines
object = unwrap(object)
File "C:\Users\u\AppData\Local\Programs\Python\Python310\lib\inspect.py", line 639, in unwrap
while _is_wrapper(func):
File "C:\Users\u\AppData\Local\Programs\Python\Python310\lib\inspect.py", line 630, in is_wrapper
return hasattr(f, 'wrapped')
File "C:\Users\u\AppData\Local\Programs\Python\Python310\lib\site-packages\beartype\roar_init
.py", line 180, in getattr
from beartype._util.module.utilmoddeprecate import deprecate_module_attr
File "C:\Users\u\AppData\Local\Programs\Python\Python310\lib\site-packages\beartype_util\module\utilmoddeprecate.py", line 21, in
from beartype._util.utilobject import SENTINEL
File "C:\Users\u\AppData\Local\Programs\Python\Python310\lib\site-packages\beartype_util\utilobject.py", line 19, in
from beartype._data.cls.datacls import TYPES_CONTEXTMANAGER_FAKE
File "C:\Users\u\AppData\Local\Programs\Python\Python310\lib\site-packages\beartype_data\cls\datacls.py", line 18, in
from beartype._cave._cavefast import (
File "C:\Users\u\AppData\Local\Programs\Python\Python310\lib\site-packages\beartype_cave_cavefast.py", line 46, in
from beartype.roar import BeartypeCallUnavailableTypeException
File "shibokensupport/signature/loader.py", line 61, in feature_imported
File "shibokensupport/feature.py", line 137, in feature_imported
File "shibokensupport/feature.py", line 148, in _mod_uses_pyside
File "C:\Users\u\AppData\Local\Programs\Python\Python310\lib\inspect.py", line 1147, in getsource
lines, lnum = getsourcelines(object)
File "C:\Users\u\AppData\Local\Programs\Python\Python310\lib\inspect.py", line 1128, in getsourcelines
object = unwrap(object)
File "C:\Users\u\AppData\Local\Programs\Python\Python310\lib\inspect.py", line 639, in unwrap
while _is_wrapper(func):
File "C:\Users\u\AppData\Local\Programs\Python\Python310\lib\inspect.py", line 630, in is_wrapper
return hasattr(f, 'wrapped')
File "C:\Users\u\AppData\Local\Programs\Python\Python310\lib\site-packages\beartype\roar_init
.py", line 180, in getattr
from beartype._util.module.utilmoddeprecate import deprecate_module_attr
ImportError: cannot import name 'deprecate_module_attr' from partially initialized module 'beartype._util.module.utilmoddeprecate' (most likely due to a circular import) (C:\Users\u\AppData\Local\Programs\Python\Python310\lib\site-packages\beartype_util\module\utilmoddeprecate.py)
PS C:\Users\u\OneDrive - Trane Technologies\Desktop\code\Modern_GUI_PyDracula_PySide6_or_PyQt6-master>

📝 Steps to reproduce

import sys
import os
import platform
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
QMetaObject, QObject, QPoint, QRect,
QSize, QTime, QUrl, Qt)
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
QFont, QFontDatabase, QGradient, QIcon,
QImage, QKeySequence, QLinearGradient, QPainter,
QPalette, QPixmap, QRadialGradient, QTransform)
from PySide6.QtWidgets import (QApplication, QComboBox, QFrame, QGridLayout,
QHBoxLayout, QLabel, QLayout, QLineEdit,
QMainWindow, QPlainTextEdit, QPushButton, QSizePolicy,
QStackedWidget, QTextEdit, QVBoxLayout, QWidget)

import ansys.fluent.core as pyfluent

meshing = pyfluent.launch_fluent(precision="double", processor_count=4, mode="meshing", ui_mode="gui")

💻 Which operating system are you using?

Windows

📀 Which ANSYS version are you using?

ANSYS 2024R2/2023R2

🐍 Which Python version are you using?

3.10

📦 Installed packages

about-time==4.2.1
alive-progress==3.1.5
altgraph==0.17.4
ansys-api-fluent==0.3.27
ansys-api-platform-instancemanagement==1.0.0b3
ansys-api-tools-filetransfer==0.1.0
ansys-fluent-core==0.24.2
ansys-fluent-parametric==0.10.0
ansys-fluent-visualization==0.12.0
ansys-platform-instancemanagement==1.1.1
ansys-tools-filetransfer==0.1.0
ansys-units==0.3.2
anyio==3.6.2
appdirs==1.4.4
argon2-cffi==21.3.0
argon2-cffi-bindings==21.2.0
arrow==1.2.3
asttokens==2.2.1
attrs==22.2.0
backcall==0.2.0
beartype==0.19.0
beautifulsoup4==4.12.0
bleach==6.0.0
certifi==2022.12.7
cffi==1.15.1
charset-normalizer==3.1.0
click==8.1.7
colorama==0.4.6
comm==0.1.3
contourpy==1.0.6
cycler==0.11.0
debugpy==1.6.6
decorator==5.1.1
defusedxml==0.7.1
docker==7.1.0
et-xmlfile==1.1.0
executing==1.2.0
fastjsonschema==2.16.3
fonttools==4.38.0
fqdn==1.5.1
googleapis-common-protos==1.59.0
grapheme==0.6.0
grpcio==1.53.0
grpcio-health-checking==1.48.2
h5py==3.8.0
idna==3.4
imageio==2.27.0
importlib-metadata==6.1.0
ipykernel==6.22.0
ipython==8.12.0
ipython-genutils==0.2.0
ipywidgets==8.0.6
isoduration==20.11.0
jedi==0.18.2
Jinja2==3.1.2
joblib==1.4.2
jsonpointer==2.3
jsonschema==4.17.3
jupyter==1.0.0
jupyter-console==6.6.3
jupyter-events==0.6.3
jupyter_client==8.1.0
jupyter_core==5.3.0
jupyter_server==2.5.0
jupyter_server_terminals==0.4.4
jupyterlab-pygments==0.2.2
jupyterlab-widgets==3.0.7
kiwisolver==1.4.4
lxml==4.9.2
MarkupSafe==2.1.2
matplotlib==3.6.2
matplotlib-inline==0.1.6
mistune==2.0.5
msgpack-python==0.5.6
nbclassic==0.5.4
nbclient==0.7.3
nbconvert==7.2.10
nbformat==5.8.0
nest-asyncio==1.5.6
nltk==3.9.1
notebook==6.5.3
notebook_shim==0.2.2
numpy==1.26.4
opencv-python==4.9.0.80
openpyxl==3.0.9
packaging==23.2
pandas==1.5.3
pandocfilters==1.5.0
parso==0.8.3
pefile==2023.2.7
pickleshare==0.7.5
Pillow==9.3.0
platformdirs==3.11.0
pooch==1.7.0
prometheus-client==0.16.0
prompt-toolkit==3.0.38
protobuf==3.20.3
protoc-gen-swagger==0.1.0
psutil==5.9.7
pure-eval==0.2.2
pycparser==2.21
pyfluent==0.2.1
Pygments==2.14.0
pyinstaller==6.3.0
pyinstaller-hooks-contrib==2024.0
pyparsing==3.0.9
pyrsistent==0.19.3
PySide6==6.4.3
PySide6-Addons==6.4.3
PySide6-Essentials==6.4.3
python-dateutil==2.8.2
python-json-logger==2.0.7
pytz==2022.1
pyvista==0.43.1
pyvistaqt==0.9.1
pywin32==306
pywin32-ctypes==0.2.2
pywinpty==2.0.10
PyYAML==6.0
pyzmq==25.0.2
qtconsole==5.4.2
QtPy==2.3.1
regex==2024.5.15
requests==2.32.3
rfc3339-validator==0.1.4
rfc3986-validator==0.1.1
scipy==1.8.0
scooby==0.7.1
Send2Trash==1.8.0
shiboken6==6.4.3
six==1.16.0
sniffio==1.3.0
soupsieve==2.4
stack-data==0.6.2
terminado==0.17.1
tinycss2==1.2.1
tornado==6.2
tqdm==4.66.4
traitlets==5.9.0
tzdata==2024.1
uri-template==1.2.0
urllib3==1.26.15
vtk==9.3.20230807rc0
wcwidth==0.2.6
webcolors==1.13
webencodings==0.5.1
websocket-client==1.5.1
widgetsnbextension==4.0.7
xlrd==2.0.1
zipp==3.15.0
@rachelzhang333 rachelzhang333 added the bug Something isn't working label Jan 2, 2025
@mkundu1
Copy link
Contributor

mkundu1 commented Jan 2, 2025

@rachelzhang333 Can you try with the latest pyfluent version (0.27)? The beartype dependency has been removed in that version.

@rachelzhang333
Copy link
Author

rachelzhang333 commented Jan 3, 2025

@rachelzhang333 Can you try with the latest pyfluent version (0.27)? The beartype dependency has been removed in that version.

@mkundu1 It works. Thank you very much!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants