unalloc / sqlautocode

Automatically exported from code.google.com/p/sqlautocode
Other
0 stars 0 forks source link

ImportError: cannot import name _deferred_relation #42

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Run the program. See transcript below.

What is the expected output? What do you see instead?

$ sqlautocode sqlite:///tutorial.db -o models.py
Traceback (most recent call last):
  File "/usr/local/bin/sqlautocode", line 9, in <module>
    load_entry_point('sqlautocode==0.7', 'console_scripts', 'sqlautocode')()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 318, in load_entry_point

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2221, in load_entry_point

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 1954, in load
    *possible* to create pathological version coding schemes that will fool
  File "/Library/Python/2.7/site-packages/sqlautocode/main.py", line 4, in <module>
    from declarative import ModelFactory
  File "/Library/Python/2.7/site-packages/sqlautocode/declarative.py", line 17, in <module>
    from sqlalchemy.ext.declarative import _deferred_relation as _deferred_relationship
ImportError: cannot import name _deferred_relation

What version of the product are you using? On what operating system?

SQLAlchemy (0.8.0)
sqlautocode (0.7)
(both freshly updated from PyPI)

On Mac OS X 10.7.5, using Python 2.7.1

Please provide any additional information below.

Original issue reported on code.google.com by jonathan...@gmail.com on 5 Apr 2013 at 5:16

GoogleCodeExporter commented 8 years ago
The attached patch should fix the error; or you can try yo use this clone: 
https://bitbucket.org/x746e/sqlautocode

Original comment by 0x746e@gmail.com on 17 Apr 2013 at 10:40

Attachments:

GoogleCodeExporter commented 8 years ago
Got the same error and can confirm that the patch fixes the issue.

Original comment by exh...@gmail.com on 27 May 2013 at 9:04

GoogleCodeExporter commented 8 years ago
Same issue here:

SQLAlchemy==0.8.0
sqlautocode==0.7

Original comment by eod...@gmail.com on 4 Jul 2013 at 2:02

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I confirm that, for SQLAlchemy==0.8.0 and sqlautocode==0.6, the patch fixes the 
issue.

Original comment by ksi...@ksindi.com on 10 Jul 2013 at 5:40

GoogleCodeExporter commented 8 years ago
cannot fix in Windows.

there is no sqlautocode python source files

Original comment by ybj...@gmail.com on 13 Jul 2013 at 1:05

GoogleCodeExporter commented 8 years ago
Are you planning a new release that includes this fix?
SQLA 0.8 has been out for half a year now.

It's quite awkward having to manually apply a patch on a pip installed package.

Original comment by u...@ulo.pe on 18 Sep 2013 at 8:39

GoogleCodeExporter commented 8 years ago
I just installed this via PIP as well (Windows OS).  It looks like the change 
(if committed) still hasn't been made a part of the latest release.  I'm only 
an ammature, so getting this applied in my environment will require some 
digging.
sqlalchemy->0.8.2
sqlautocode->0.7

Original comment by ihiengd...@gmail.com on 21 Oct 2013 at 1:44

GoogleCodeExporter commented 8 years ago
Agree with #9 ihiengd...@gmail.com ...

This is a little tough if you don't know how to change and easy install file. 
Any suggestions on how to do this ?

Original comment by darw...@optimizely.com on 18 Nov 2013 at 2:06

GoogleCodeExporter commented 8 years ago
Thanks for patch, fixed it for me using Fedora20/sqla-0.8 and sqlautocode0.6

Original comment by avinu...@gmail.com on 20 Jan 2014 at 4:48

GoogleCodeExporter commented 8 years ago
Thanks for the patch!

Original comment by shanky...@gmail.com on 12 Mar 2014 at 3:54