question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to import pinject

See original GitHub issue

Hello, 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:closed
  • Created 9 years ago
  • Comments:12

github_iconTop GitHub Comments

1reaction
dmitrybelyakovcommented, Jul 27, 2017

@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.

1reaction
treincommented, May 1, 2015

@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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found