Skip to content

Conversation

@cpolish
Copy link

@cpolish cpolish commented Apr 7, 2023

One problem I found recently when trying to use Fildem on my Ubuntu 22.10 install, after installing Python 3.11 from apt and setting a symlink from python3.11 --> python3, was that when executing fildem, Python would raise a ModuleNotFoundError for fildem. This would happen even if I reinstalled Fildem explicitly using python3.10.

Having a look at the source code, I realised that this error most likely occurs due to the command being specified for the secondary Fildem thread in command.run_command using the python3 executable set in the system's PATH, which may not match the version of Python 3 used to install Fildem. To fix this, the code now replaces the call to python3 with sys.executable instead, which provides an absolute path to the Python 3 executable used at runtime.

Testing this on my system, this appears to have fixed the issue.

cpolish added 2 commits April 7, 2023 20:08
Make `command.run_command` use the executable recognised by the
Python interpreter (`sys.executable`) rather than the system `PATH`
`python3` executable. This prevents issues where the version of
Python 3 used to build and run Fildem may be different to the
Python 3 version pointed to by the system PATH, making Python not
be able to recognise the Fildem module installed with the original
Python version.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant