You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.
When importing the requests library and calling new_object_graph, it fails complaining about Tkinter not being configured for the system.
The problem is that when calling new_object_graph, Pinject traverses the imported modules by default but for some reason it's error on importing Tkinter on python installations where Tkinter isn't supported (intentionally, i.e. python:3.7-alpine). I believe the import tree is application -> requests -> urllib3 -> six -> Tkinter. I'm not sure what the proper fix is here, but I wanted to report it in case it is an actual behavioral issue with Pinject.
(pinject-requests-tkinter) ~/w/pinject-requests-tkinter ❯❯❯ docker run --rm -it pinject-requests-tkinter master ✱ ◼
Python 3.7.3 (default, May 11 2019, 02:00:41)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license"for more information.
>>> import repro
>>> repro.main()
Traceback (most recent call last):
File "<stdin>", line 1, in<module>
File "/opt/app/repro.py", line 7, in main
pinject.new_object_graph()
File "/root/.local/share/virtualenvs/app-ueEJiAOq/lib/python3.7/site-packages/pinject/object_graph.py", line 100, in new_object_graph
found_classes = finding.find_classes(modules, classes)
File "/root/.local/share/virtualenvs/app-ueEJiAOq/lib/python3.7/site-packages/pinject/finding.py", line 32, in find_classes
all_classes |= _find_classes_in_module(module)
File "/root/.local/share/virtualenvs/app-ueEJiAOq/lib/python3.7/site-packages/pinject/finding.py", line 46, in _find_classes_in_module
formember_name, memberin inspect.getmembers(module):
File "/usr/local/lib/python3.7/inspect.py", line 341, in getmembers
value = getattr(object, key)
File "/root/.local/share/virtualenvs/app-ueEJiAOq/lib/python3.7/site-packages/urllib3/packages/six.py", line 92, in __get__
result = self._resolve()
File "/root/.local/share/virtualenvs/app-ueEJiAOq/lib/python3.7/site-packages/urllib3/packages/six.py", line 115, in _resolve
return _import_module(self.mod)
File "/root/.local/share/virtualenvs/app-ueEJiAOq/lib/python3.7/site-packages/urllib3/packages/six.py", line 82, in _import_module
__import__(name)
File "/usr/local/lib/python3.7/tkinter/__init__.py", line 36, in<module>
import _tkinter # If this fails your Python may not be configured for Tk
ImportError: Error loading shared library libtk8.6.so: No such file or directory (needed by /root/.local/share/virtualenvs/app-ueEJiAOq/lib/python3.7/lib-dynload/_tkinter.cpython-37m-x86_64-linux-gnu.so)
>>>
Also, apologies if this is the wrong place to put this! I figured it wasn't an issue with requests/urllib3/six (at least, I'd hope not) since they're so prevalent.
The text was updated successfully, but these errors were encountered:
Issue
When importing the requests library and calling
new_object_graph
, it fails complaining about Tkinter not being configured for the system.The problem is that when calling new_object_graph, Pinject traverses the imported modules by default but for some reason it's error on importing Tkinter on python installations where Tkinter isn't supported (intentionally, i.e.
python:3.7-alpine
). I believe the import tree is application -> requests -> urllib3 -> six -> Tkinter. I'm not sure what the proper fix is here, but I wanted to report it in case it is an actual behavioral issue with Pinject.Environment
Docker container: python3.7-alpine
Requests: 2.2.1
Pinject: v0.12
Reproduction
This should be enough to repro it:
Also, apologies if this is the wrong place to put this! I figured it wasn't an issue with requests/urllib3/six (at least, I'd hope not) since they're so prevalent.
The text was updated successfully, but these errors were encountered: