0
$\begingroup$

I am trying to launch a script from blender 2.82 which uses PyQt5. PyQt5 module is installed and when running python3 from terminal and import PyQt5.QtCore, it works fine.

When i try to import from my blender script, it fails. I have tried to add in the script

import sys
sys.path.append("/usr/lib/python3/dist-packages")

which is the path where my python packages are installed, but still fails to import the module

What am I doing wrong?

$\endgroup$
4
  • $\begingroup$ Maybe It is in site-packages? $\endgroup$ – D. Skarn May 8 '20 at 15:10
  • $\begingroup$ no, its actually dist-packages $\endgroup$ – jjcasmar May 8 '20 at 15:23
  • $\begingroup$ Since Blender uses it's own interpreter and packages, I would suggest to install the package for Blender. See this answer for a way to do this from a Python script within Blender. You could also use your system's interpreter and modules, which would be another approach. However this would require compatible Python versions. $\endgroup$ – Robert Gützkow May 10 '20 at 13:02
  • $\begingroup$ How can I use the system interpreter and modules? Isnt it possible to use blender interpreter adding system modules to the path? $\endgroup$ – jjcasmar May 10 '20 at 22:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.