Content tagged with "pyamf"

PyAMF and _version issue Post on Mar 23, 2011

I ran into this dumb issue trying to run an old project today:

...
Could not import myapp.views. Error was: cannot import name _version
...

I had to actually break into the Django shell and try to import views from there to get a meaningful traceback, turns out the PyAMF __init__.py file was trying to do this:

from pyamf import util, _version

... and it wasn't lying, there was no _verion.py or _version folder or anything. A little googling found this page which revealed on the first line that the _version.py file is generated when "python setup.py install" is run to install pyamf. Well, that's all fine and good unless you're like me and almost never install modules into the main Python library unless absolutely necessary, I like to just put them on the python path, it makes upgrading modules much easier. So I cracked into the FBI mainframe and forced an assertion on the library (read: being super-stealthy, I created the file and pasted the expected code into it):

# THIS FILE IS GENERATED BY PYAMF SETUP.PY 
from pyamf.versions import Version 
  
version = Version(*(0, 6, 1)) 

Cheers! af