Article 5J7CA python3, pycharm ModuleNotFoundError: No module named 'wx'

python3, pycharm ModuleNotFoundError: No module named 'wx'

by
kaz2100
from LinuxQuestions.org on (#5J7CA)
Hya,

Problem As title reads, ModuleNotFoundError: No module named 'wx'

System Debian amd64 testing. (pycharm is not debian package, downloaded from Jetbrains.com community version)

Situation Script chokes at "import wx" under pycharm, but not python interactive mode.

Troubleshooting I was somewhat confident that something is wrong with pycharm, so played around PYTHONPATH and venv setting without success. It turned out to be that wx is NOT under sys.path. It is under /usr/lib/python3, while sys.path has only /usr/lib/python3.9

Workaround Add Code:sys.path.append(r'/usr/lib/python3/dist-packages') works.

But, there must be some reason for these two distinct directories to exist (python3.9 and python3). So some adverse effect may happen in future. Hopefully not.

cheers

Closing remark May our penguins be happy!latest?d=yIl2AUoC8zA latest?i=BOv3fh9KbPU:Z7Zb6YWWwrs:F7zBnMy latest?i=BOv3fh9KbPU:Z7Zb6YWWwrs:V_sGLiP latest?d=qj6IDK7rITs latest?i=BOv3fh9KbPU:Z7Zb6YWWwrs:gIN9vFwBOv3fh9KbPU
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments