Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Unable to import pinject #7

Closed
dmitrybelyakov opened this issue Aug 8, 2014 · 12 comments
Closed

Unable to import pinject #7

dmitrybelyakov opened this issue Aug 8, 2014 · 12 comments

Comments

@dmitrybelyakov
Copy link

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?

@seanfisk
Copy link

seanfisk commented Aug 8, 2014

Pinject is only compatible with Python 2.7, unfortunately (see #2). At least, that's what the developer told me. I'm thinking of making a fork to support Python 3. Would you be interested?

@dmitrybelyakov
Copy link
Author

@seanfisk It says 'all' under Platform on PyPi, so that got me confused. I'll be glad to help if I could but unfortunately I'm pretty new to python. Other than that it would be great if it worked under 3.x branch :)

@seanfisk
Copy link

seanfisk commented Aug 9, 2014

@dmitrybelyakov Agreed; that is confusing. Working on pinject has been on my todo list, and I should get some time to do it soon. Watch the repo and I'll make a post when I do. It's too bad this appears unmaintained ATM, but this project is too cool to die.

Also: Your profile pic is awesome.

@dmitrybelyakov
Copy link
Author

@seanfisk Thanks, will do :)

trein pushed a commit to trein/pinject that referenced this issue Aug 10, 2014
- Add Six package, a simple utilities for wrapping over differences
  between Python 2 and Python 3
- Encapsulate compatibility methods in 'support.py' module
- Introduce unit tests for 'support.py' module
@AlexKovalevych
Copy link

Still getting this issue:

SyntaxError: Missing parentheses in call to 'exec'

at pinject/third_party/decorator.py", line 156

@trein
Copy link
Contributor

trein commented May 1, 2015

@AlexKovalevych, what is your Python version? Are you using the patched revision?

@AlexKovalevych
Copy link

@trein its 3.4.2. no, i don't think so, i've installed the master branch

@trein
Copy link
Contributor

trein commented 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: trein@fd091eb

@AlexKovalevych
Copy link

@trein understood, weird its not being merged yet, thank you for response

@huan
Copy link
Contributor

huan commented Jul 27, 2017

+1 Is there anyone here?

Please merge the PRs to fix the issues, esp: Python 3 Support.

Thanks!

@dmitrybelyakov
Copy link
Author

dmitrybelyakov commented 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.

@huan
Copy link
Contributor

huan commented Jul 27, 2017

Thanks! I'll go to take a look. It seems you did a great job!

However, I'm a newbie of Python, I'm familiar with DI & Angular but I'd like to use an out-of-box DI solution in python.

I love this pinject because it's decorator free! 👍

trein pushed a commit to trein/pinject that referenced this issue Sep 5, 2018
- Add Six package, a simple utilities for wrapping over differences
  between Python 2 and Python 3
- Encapsulate compatibility methods in 'support.py' module
- Introduce unit tests for 'support.py' module
trein pushed a commit to trein/pinject that referenced this issue Sep 7, 2018
- Add Six package, a simple utilities for wrapping over differences
  between Python 2 and Python 3
- Encapsulate compatibility methods in 'support.py' module
- Introduce unit tests for 'support.py' module
trein pushed a commit to trein/pinject that referenced this issue Sep 30, 2018
- Use Six package, a simple utilities for wrapping over
  differences between Python 2 and Python 3

- Encapsulate compatibility methods in 'support.py' module

- Introduce unit tests for 'support.py' module
trein pushed a commit to trein/pinject that referenced this issue Sep 30, 2018
- Use Six package, a simple utilities for wrapping over
  differences between Python 2 and Python 3

- Encapsulate compatibility methods in 'support.py' module

- Introduce unit tests for 'support.py' module
trein pushed a commit to trein/pinject that referenced this issue Sep 30, 2018
- Use Six package, a simple utilities for wrapping over
  differences between Python 2 and Python 3

- Encapsulate compatibility methods in 'support.py' module

- Introduce unit tests for 'support.py' module
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants