Unable to import pinject
See original GitHub issueHello,
I decided to give pinject a try, but unfortunately it does not import. Here’s what I do: install pinject with pip install pinject
and then interactively import pinject
.
It seem to fail on line 156 of third_party/decorator.py
. I’m on python 3.4 so maybe that’s the reason although looking at code I can see blocks dealing with python >3.2
Is that a bug?
Issue Analytics
- State:
- Created 9 years ago
- Comments:12
Top Results From Across the Web
google/pinject: A pythonic dependency injection library. - GitHub
new_object_graph() by default looks in all imported modules, but you may occasionally want to restrict the classes for which new_object_graph() creates implicit ...
Read more >Unable to import name: IP, with Pinject installed? Python
I had faced this already. For that you have to download pinject.py and paste it in folder which contains Saddam.py .
Read more >Pythonic Dependency Injection with PInject | by Farooq Mahmud
import pinject obj_graph = pinject.new_object_graph() ... We get an error about being unable to create an abstract class instance:
Read more >Scala Dependency Injection - 2.8.x - Play Framework
The @Inject annotation can be used on fields or on constructors. We recommend that you use it on constructors, for example: import javax.inject....
Read more >Inject Service From Another Module in NestJS (2022)
Great. Let's import the ItemModule inside our PlayerModule in order to get access to ItemService. Please change src/player/player.module.ts from ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@zixia heya! i don’t think there is, but apparently it is quite easy to implement a di solution yourself - took me about 2 hours to write my own injector/container with tests and all.
@AlexKovalevych so the master branch does not have support for Python 3. I submitted a fix for this, but it hasn’t been merged yet. If you want, you can cherry-pick it: https://github.com/trein/pinject/commit/fd091eb2237547f921f7ada531e16b95ba6693b8