Does PySide6 require numpy?
Unsolved
Qt for Python
-
And is it normal for simply "import PySide6" to import numpy?
I checked all the imports (with
python -v
) for a little app I'm making, and was surprised to see that the great bulk of the output was about numpy.Then I ran the following simple script:
import sys def print_sys_modules(): print('\nsys.modules :') for m in sys.modules : print(f' {m!r}') print('\n') print_sys_modules() import PySide6 print_sys_modules()
The output was:
# ### BEFORE IMPORTING PySide6 ### sys.modules : 'sys' 'builtins' '_frozen_importlib' '_imp' '_thread' '_warnings' '_weakref' '_io' 'marshal' 'posix' '_frozen_importlib_external' 'time' 'zipimport' '_codecs' 'codecs' 'encodings.aliases' 'encodings' 'encodings.utf_8' '_signal' '_abc' 'abc' 'io' '__main__' '_stat' 'stat' '_collections_abc' 'genericpath' 'posixpath' 'os.path' 'os' '_sitebuiltins' '_distutils_hack' 'site' # ### AFTER IMPORTING PySide6 ### sys.modules : 'sys' 'builtins' '_frozen_importlib' '_imp' '_thread' '_warnings' '_weakref' '_io' 'marshal' 'posix' '_frozen_importlib_external' 'time' 'zipimport' '_codecs' 'codecs' 'encodings.aliases' 'encodings' 'encodings.utf_8' '_signal' '_abc' 'abc' 'io' '__main__' '_stat' 'stat' '_collections_abc' 'genericpath' 'posixpath' 'os.path' 'os' '_sitebuiltins' '_distutils_hack' 'site' 'types' '_operator' 'operator' 'itertools' 'keyword' 'reprlib' '_collections' 'collections' '_functools' 'functools' 'enum' '_sre' 're._constants' 're._parser' 're._casefix' 're._compiler' 'copyreg' 're' 'fnmatch' 'ntpath' 'warnings' 'errno' 'urllib' 'ipaddress' 'urllib.parse' 'pathlib' 'textwrap' 'binascii' 'importlib._bootstrap' 'importlib._bootstrap_external' 'importlib' 'importlib._abc' 'contextlib' 'importlib.util' 'zlib' '_compression' '_bz2' 'bz2' '_lzma' 'lzma' 'shutil' '_struct' 'struct' '_weakrefset' 'threading' 'zipfile' 'base64' 'collections.abc' 'token' 'tokenize' 'linecache' 'traceback' 'math' '_bisect' 'bisect' '_random' '_sha512' 'random' 'weakref' 'tempfile' '_typing' 'typing.io' 'typing.re' 'typing' 'numpy._utils._convertions' 'numpy._utils' 'numpy._globals' 'numpy.exceptions' 'numpy.version' 'numpy._distributor_init' 'numpy._utils._inspect' '_datetime' 'datetime' 'numpy.core._exceptions' 'numpy.dtypes' 'numpy.core._multiarray_umath' 'numpy.core.overrides' 'numpy.core.multiarray' 'numpy.core.umath' 'numbers' 'numpy.core._string_helpers' '_compat_pickle' '_pickle' 'pickle' 'numpy.compat.py3k' 'numpy.compat' 'numpy.core._dtype' 'numpy.core._type_aliases' 'numpy.core.numerictypes' '_contextvars' 'contextvars' 'numpy.core._ufunc_config' 'numpy.core._methods' 'numpy.core.fromnumeric' 'numpy.core.shape_base' 'numpy.core.arrayprint' 'numpy.core._asarray' 'numpy.core.numeric' 'numpy.core.defchararray' 'numpy.core.records' 'numpy.core.memmap' 'numpy.core.function_base' 'numpy.core._machar' 'numpy.core.getlimits' 'numpy.core.einsumfunc' 'numpy.core._multiarray_tests' 'numpy.core._add_newdocs' 'numpy.core._add_newdocs_scalars' 'numpy.core._dtype_ctypes' '_ast' 'ast' '_ctypes' 'ctypes._endian' 'ctypes' 'numpy.core._internal' 'numpy._pytesttester' 'numpy.core' 'numpy.__config__' 'numpy.lib.mixins' 'numpy.lib.ufunclike' 'numpy.lib.type_check' 'numpy.lib.scimath' 'numpy.lib.stride_tricks' 'numpy.lib.twodim_base' 'numpy.linalg._umath_linalg' '__future__' 'numpy._typing._nested_sequence' 'numpy._typing._nbit' 'numpy._typing._char_codes' 'numpy._typing._scalars' 'numpy._typing._shape' 'numpy._typing._dtype_like' 'numpy._typing._array_like' 'numpy._typing' 'numpy.linalg.linalg' 'numpy.linalg' 'numpy.matrixlib.defmatrix' 'numpy.matrixlib' 'numpy.lib.histograms' 'numpy.lib.function_base' 'numpy.lib.index_tricks' 'numpy.lib.nanfunctions' 'numpy.lib.shape_base' 'numpy.lib.polynomial' 'platform' 'numpy.lib.utils' 'numpy.lib.arraysetops' 'numpy.lib.format' 'numpy.lib._datasource' 'numpy.lib._iotools' 'numpy.lib.npyio' 'numpy.lib.arrayterator' 'numpy.lib.arraypad' 'numpy.lib._version' 'numpy.lib' 'numpy.fft._pocketfft_internal' 'numpy.fft._pocketfft' 'numpy.fft.helper' 'numpy.fft' 'numpy.polynomial.polyutils' 'numpy.polynomial._polybase' 'numpy.polynomial.polynomial' 'numpy.polynomial.chebyshev' 'numpy.polynomial.legendre' 'numpy.polynomial.hermite' 'numpy.polynomial.hermite_e' 'numpy.polynomial.laguerre' 'numpy.polynomial' 'cython_runtime' '_cython_3_0_7' 'numpy.random._common' '_hashlib' '_blake2' 'hashlib' 'hmac' 'secrets' 'numpy.random.bit_generator' 'numpy.random._bounded_integers' 'numpy.random._mt19937' 'numpy.random.mtrand' 'numpy.random._philox' 'numpy.random._pcg64' 'numpy.random._sfc64' 'numpy.random._generator' 'numpy.random._pickle' 'numpy.random' 'numpy.ctypeslib' '_opcode' 'opcode' 'dis' 'importlib.machinery' 'inspect' 'numpy.ma.core' 'numpy.ma.extras' 'numpy.ma' 'numpy' 'xxsubtype' 'signature_bootstrap' 'encodings.cp437' 'shibokensupport' 'shibokensupport.signature' 'shibokensupport.feature' 'shibokensupport.signature.mapping' 'shibokensupport.signature.errorhandler' 'shibokensupport.signature.layout' 'shibokensupport.signature.lib' 'shibokensupport.signature.lib.tool' 'shibokensupport.signature.parser' 'PySide6.support' 'PySide6.support.deprecated' 'shibokensupport.signature.importhandler' 'shibokensupport.signature.lib.enum_sig' 'gettext' 'argparse' '_string' 'string' 'atexit' 'logging' 'shibokensupport.signature.lib.pyi_generator' 'PySide6.support.feature' 'PySide6.support.signature' 'PySide6.support.signature.mapping' 'PySide6.support.signature.errorhandler' 'PySide6.support.signature.layout' 'PySide6.support.signature.lib' 'PySide6.support.signature.parser' 'PySide6.support.signature.importhandler' 'PySide6.support.signature.lib.enum_sig' 'PySide6.support.signature.lib.pyi_generator' 'PySide6.support.signature.lib.tool' 'shibokensupport.signature.loader' '__feature__' 'shiboken6.Shiboken' 'shiboken6' 'PySide6'
-
You can build it with or without; by default, it is used to for some APIs to get data quickly into plots, for example.