Closed adonis-thr closed 3 years ago
Interesting. 3.6 is quite old, it's possible importlib isn't available in that version, I'll take a look tomorrow.
On Mon, 1 Feb 2021, 23:02 adonis-thr, notifications@github.com wrote:
Hello,
This is an issue that just started happening this past month. I've been using your library for interfacing with a PS4 controller since November and it was working well.
Very recently, I've been getting the following error when attempting to import the library in the following format: from approxeng.input.selectbinder import ControllerResrouce
I now get the following error: File "PS4BT2.py", line 15, in
from approxeng.input.selectbinder import ControllerResource File "/home/nvidia/.local/lib/python3.6/site-packages/approxeng/input/selectbinder.py", line 6, in from approxeng.input.controllers import * File "/home/nvidia/.local/lib/python3.6/site-packages/approxeng/input/controllers.py", line 1, in import importlib.resources as resources ModuleNotFoundError: No module named 'importlib.resources This is similar code that I copied from the example on Brian Corteil's Tiny 4WD robot as shown in the doc: https://approxeng.github.io/approxeng.input/examples/tiny4wd.html
Thanks!
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ApproxEng/approxeng.input/issues/45, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKV2BW6AYBN4BPYY4FZBATS44XHZANCNFSM4W5TTYTQ .
Thanks!
Quick thing to try, can you see if installing 'importlib-resources' with pip fixes it?
On Mon, 1 Feb 2021, 23:23 adonis-thr, notifications@github.com wrote:
Thanks!
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ApproxEng/approxeng.input/issues/45#issuecomment-771230725, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKV2BQMWW3OBNBVPXWB5KDS44ZX5ANCNFSM4W5TTYTQ .
It still didn't seem to work. If its an issue with python3.6, then I can just update it to the latest version.
It looks like I was able to fix the issue by changing the import package in "approxeng/input/controllers.py" to:
import importlib_resources as resources
from import importlib.resources as resources
This might be something specific to the library itself when using python 3.6 when looking at their doc: https://importlib-resources.readthedocs.io/en/latest/using.html
This should hopefully have fixed it - I'd still suggest updating to a more recent Python just because there's a lot of good stuff in newer versions, but hopefully if you now do 'pip install approxeng.input --upgrade' it should pick up the new version, install the backport, and work properly again?
Thanks, all working well :)
Hello,
This is an issue that just started happening this past month. I've been using your library for interfacing with a PS4 controller since November and it was working well.
Very recently, I've been getting the following error when attempting to import the library in the following format:
from approxeng.input.selectbinder import ControllerResrouce
I now get the following error:
This is similar code that I copied from the example on Brian Corteil's Tiny 4WD robot as shown in the doc: https://approxeng.github.io/approxeng.input/examples/tiny4wd.html
Thanks!