How to add an edge to existing and new vertices in gremlin-python? - gremlin

I've already seen this answer:
Gremlin, How to add edge to existing vertex in gremlin-python
and it wasn't really helpful. As suggested in one of the comments I did try to update gremlinpython 3.3.0 but then I get key error.
Stack:
JanusGraph 0.2.0, gremlinpython3.2.3
This is my code
from gremlin_python import statics
from gremlin_python.structure.graph import Graph
from gremlin_python.process.graph_traversal import __
from gremlin_python.process.strategies import *
from gremlin_python.driver.driver_remote_connection import DriverRemoteConnection
graph = Graph()
g = graph.traversal().withRemote(DriverRemoteConnection('ws://localhost:8182/gremlin','g'))
martha = g.V().has('name','martha').next()
jack = g.V().has('name','jack').next()
#e_id = g.addE(jack,'likes',martha).next()
e_id = g.V(martha).as_('to').V(jack).addE("Likes").to('to').toList()
print e_id.toList()
StackTrace with gremlinpython 3.3.0
Traceback (most recent call last):
File "gremlin-py.py", line 9, in <module>
martha = g.V().has('name','martha').next()
File "/Users/arvindn/.virtualenvs/gremlinenv/lib/python2.7/site-packages/gremlin_python/process/traversal.py", line 70,in next
return self.__next__()
File "/Users/arvindn/.virtualenvs/gremlinenv/lib/python2.7/site-packages/gremlin_python/process/traversal.py", line 43,in __next__
self.traversal_strategies.apply_strategies(self)
File "/Users/arvindn/.virtualenvs/gremlinenv/lib/python2.7/site-packages/gremlin_python/process/traversal.py", line 352, in apply_strategies
traversal_strategy.apply(traversal)
File "/Users/arvindn/.virtualenvs/gremlinenv/lib/python2.7/site-packages/gremlin_python/driver/remote_connection.py", line 143, in apply
remote_traversal = self.remote_connection.submit(traversal.bytecode)
File "/Users/arvindn/.virtualenvs/gremlinenv/lib/python2.7/site-packages/gremlin_python/driver/driver_remote_connection.py", line 54, in submit
results = result_set.all().result()
File "/Users/arvindn/.virtualenvs/gremlinenv/lib/python2.7/site-packages/concurrent/futures/_base.py", line 429, in result
return self.__get_result()
File "/Users/arvindn/.virtualenvs/gremlinenv/lib/python2.7/site-packages/concurrent/futures/_base.py", line 381, in __get_result
raise exception_type, self._exception, self._traceback
KeyError: None
In my case, 3.3.0 is throwing error for all queries including g.V().next(). Now going back to 3.2.3, addvertex and other queries are working absolutely fine, but I couldn't figure out how to add edges. The same code when run with 3.2.3 produces,
StackTrace with gremlinpython 3.2.3
Traceback (most recent call last): File "gremlin-py.py", line 12, in <module>
e_id = g.V(martha).as_('to').V(jack).addE("Likes").to('to').toList()
File "/Users/arvindn/.virtualenvs/gremlinenv/lib/python2.7/site-packages/gremlin_python/process/traversal.py", line 52, in toList return list(iter(self))
File "/Users/arvindn/.virtualenvs/gremlinenv/lib/python2.7/site-packages/gremlin_python/process/traversal.py", line 70, in next
return self.__next__() File "/Users/arvindn/.virtualenvs/gremlinenv/lib/python2.7/site-packages/gremlin_python/process/traversal.py", line 43, in __next__
self.traversal_strategies.apply_strategies(self) File "/Users/arvindn/.virtualenvs/gremlinenv/lib/python2.7/site-packages/gremlin_python/process/traversal.py", line 284, in apply_strategies
traversal_strategy.apply(traversal)
File "/Users/arvindn/.virtualenvs/gremlinenv/lib/python2.7/site-packages/gremlin_python/driver/remote_connection.py", line 95, in apply remote_traversal = self.remote_connection.submit(traversal.bytecode) File "/Users/arvindn/.virtualenvs/gremlinenv/lib/python2.7/site-packages/gremlin_python/driver/driver_remote_connection.py", line 53, in submit traversers = self._loop.run_sync(lambda: self.submit_traversal_bytecode(request_id, bytecode))
File "/Users/arvindn/.virtualenvs/gremlinenv/lib/python2.7/site-packages/tornado/ioloop.py", line 457, in run_sync
return future_cell[0].result() File "/Users/arvindn/.virtualenvs/gremlinenv/lib/python2.7/site-packages/tornado/concurrent.py", line 237, in result
raise_exc_info(self._exc_info)
File "/Users/arvindn/.virtualenvs/gremlinenv/lib/python2.7/site-packages/tornado/gen.py", line 285, in wrapper
yielded = next(result)
File "/Users/arvindn/.virtualenvs/gremlinenv/lib/python2.7/site-packages/gremlin_python/driver/driver_remote_connection.py", line 69, in submit_traversal_bytecode
"gremlin": self._graphson_writer.writeObject(bytecode),
File "/Users/arvindn/.virtualenvs/gremlinenv/lib/python2.7/site-packages/gremlin_python/structure/io/graphson.py", line 72, in writeObject
return json.dumps(self.toDict(objectData), separators=(',', ':'))
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 250, in dumps
sort_keys=sort_keys, **kw).encode(obj)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/encoder.py", line 207, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/encoder.py", line 270, in iterencode
return _iterencode(o, 0)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/encoder.py", line 184, in default
raise TypeError(repr(o) + " is not JSON serializable")
TypeError: v[4184] is not JSON serializable
It says v[x] is not JSON serializable. I'm not sure what causes this error. It'll be awesome if someone can help. If any more info is needed, I shall update the question accordingly.

JanusGraph 0.2.0 uses Apache TinkerPop 3.2.6. You should use the 3.2.6 version of the gremlinpython driver.
pip uninstall gremlinpython
pip install gremlinpython==3.2.6

Related

Python Executable including multiple libraries

I am relatively new to Python and have developed an application for myself that I would like to make an executable. It uses multiple external libraries such as Pyqt5, sqlite3, and openpyxl. I am using pyinstaller to create the .exe - the installer fails with a message "nomodulefound xml.parser.expat" i've tried a few ways to include it in my package but to no avail.
here is a replicable py example:
from decimal import Decimal
import openpyxl # xl libraries
wb = openpyxl.load_workbook(r'C:\Users\jmstr\OneDrive\Documents\finproxlc.xlsx')
myint = Decimal("27")
print("hello")
any ideas?
Here is my pyinstaller cmd: pyinstaller C:\Users\usr1\IdeaProjects\GUIProjects\finpro.py -p C:\Users\usr1\venv\Lib\site-packages\openpyxl --hidden-import openpyxl --additional-hooks-dir C:\Users\usr1\venv\Lib\site-packages\openpyxl --collect-all xml.parsers.expat
Output of the pyinstall:
['C:\Users\usr1\IdeaProjects\GUIProjects', 'C:\Users\usr1\venv\Lib\site-packages\openpyxl'] Traceback (most recent call last): File "c:\users\usr1\appdata\local\programs\python\python39\lib\runpy.py", line 197, in run_module_as_main return run_code(code, main_globals, None, File "c:\users\usr1\appdata\local\programs\python\python39\lib\runpy.py", line 87, in run_code exec(code, run_globals) File "C:\Users\usr1\AppData\Local\Programs\Python\Python39\Scripts\pyinstaller.exe_main.py", line 7, in File "c:\users\usr1\appdata\local\programs\python\python39\lib\site-packages\PyInstaller_main.py", line 194, in console_script_run run() File "c:\users\usr1\appdata\local\programs\python\python39\lib\site-packages\PyInstaller_main.py", line 180, in run run_build(pyi_config, spec_file, **vars(args)) File "c:\users\usr1\appdata\local\programs\python\python39\lib\site-packages\PyInstaller_main.py", line 61, in run_build PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs) File "c:\users\usr1\appdata\local\programs\python\python39\lib\site-packages\PyInstaller\building\build_main.py", line 977, in main build(specfile, distpath, workpath, clean_build) File "c:\users\usr1\appdata\local\programs\python\python39\lib\site-packages\PyInstaller\building\build_main.py", line 899, in build exec(code, spec_namespace) File "C:\Users\usr1\finpro.spec", line 14, in a = Analysis( File "c:\users\usr1\appdata\local\programs\python\python39\lib\site-packages\PyInstaller\building\build_main.py", line 379, in init self.hookspath += discover_hook_directories() File "c:\users\usr1\appdata\local\programs\python\python39\lib\site-packages\PyInstaller\isolated_parent.py", line 404, in wrapped return call(function, *args, **kwargs) File "c:\users\usr1\appdata\local\programs\python\python39\lib\site-packages\PyInstaller\isolated_parent.py", line 373, in call return isolated.call(function, *args, **kwargs) File "c:\users\usr1\appdata\local\programs\python\python39\lib\site-packages\PyInstaller\isolated_parent.py", line 311, in call raise RuntimeError(f"Child process call to {function.name}() failed with:\n" + output) RuntimeError: Child process call to discover_hook_directories() failed with: File "c:\users\usr1\appdata\local\programs\python\python39\lib\site-packages\PyInstaller\isolated_child.py", line 63, in run_next_command output = function(*args, **kwargs) File "c:\users\usr1\appdata\local\programs\python\python39\lib\site-packages\PyInstaller\building\build_main.py", line 107, in discover_hook_directories import pkg_resources File "c:\users\usr1\appdata\local\programs\python\python39\lib\site-packages\pkg_resources_init_.py", line 35, in import plistlib File "c:\users\usr1\appdata\local\programs\python\python39\lib\plistlib.py", line 61, in from xml.parsers.expat import ParserCreate ModuleNotFoundError: No module named 'xml.parsers'
Seems like the installion of openpyxl was specific to my IDE (intelliJ) and i could not figure out how to change the spec file to get it to pick up but running this command resolved the issue:
python -m pip install openpyxl

python integration with azure gremlin not working

I am trying to mimic as mentioned in GIT.
I almost commented everything, and just trying to run simply
g.V().count()
my connection details are correct, and matched to documentation...
I am getting following error.
Traceback (most recent call last):
File "c:\Users\PrasaRak\OneDrive\gremlin_azure_function\connect.py", line 193, in <module>
count_vertices(client)
File "c:\Users\PrasaRak\OneDrive\gremlin_azure_function\connect.py", line 116, in count_vertices
callback = client.submit(_gremlin_count_vertices)
File "C:\Users\PrasaRak\Miniconda3\envs\learn-gremlin\lib\site-packages\gremlin_python\driver\client.py", line 127, in submit
return self.submitAsync(message, bindings=bindings, request_options=request_options).result()
File "C:\Users\PrasaRak\Miniconda3\envs\learn-gremlin\lib\site-packages\gremlin_python\driver\client.py", line 148, in submitAsync
return conn.write(message)
File "C:\Users\PrasaRak\Miniconda3\envs\learn-gremlin\lib\site-packages\gremlin_python\driver\connection.py", line 55, in write
self.connect()
File "C:\Users\PrasaRak\Miniconda3\envs\learn-gremlin\lib\site-packages\gremlin_python\driver\connection.py", line 45, in connect
self._transport.connect(self._url, self._headers)
File "C:\Users\PrasaRak\Miniconda3\envs\learn-gremlin\lib\site-packages\gremlin_python\driver\tornado\transport.py", line 40, in connect
self._ws = self._loop.run_sync(
File "C:\Users\PrasaRak\Miniconda3\envs\learn-gremlin\lib\site-packages\tornado\ioloop.py", line 576, in run_sync
return future_cell[0].result()
File "C:\Users\PrasaRak\Miniconda3\envs\learn-gremlin\lib\site-packages\tornado\simple_httpclient.py", line 269, in run
stream = yield self.tcp_client.connect(
File "C:\Users\PrasaRak\Miniconda3\envs\learn-gremlin\lib\site-packages\tornado\gen.py", line 1133, in run
value = future.result()
File "C:\Users\PrasaRak\Miniconda3\envs\learn-gremlin\lib\site-packages\tornado\gen.py", line 1147, in run
yielded = self.gen.send(value)
File "C:\Users\PrasaRak\Miniconda3\envs\learn-gremlin\lib\site-packages\tornado\tcpclient.py", line 232, in connect
af, addr, stream = yield connector.start(connect_timeout=timeout)
File "C:\Users\PrasaRak\Miniconda3\envs\learn-gremlin\lib\site-packages\tornado\tcpclient.py", line 87, in start
self.try_connect(iter(self.primary_addrs))
File "C:\Users\PrasaRak\Miniconda3\envs\learn-gremlin\lib\site-packages\tornado\tcpclient.py", line 104, in try_connect
stream, future = self.connect(af, addr)
File "C:\Users\PrasaRak\Miniconda3\envs\learn-gremlin\lib\site-packages\tornado\tcpclient.py", line 276, in _create_stream
return stream, stream.connect(addr)
File "C:\Users\PrasaRak\Miniconda3\envs\learn-gremlin\lib\site-packages\tornado\iostream.py", line 1325, in connect
self._add_io_state(self.io_loop.WRITE)
File "C:\Users\PrasaRak\Miniconda3\envs\learn-gremlin\lib\site-packages\tornado\iostream.py", line 1157, in _add_io_state
self.io_loop.add_handler(
File "C:\Users\PrasaRak\Miniconda3\envs\learn-gremlin\lib\site-packages\tornado\platform\asyncio.py", line 83, in add_handler
self.asyncio_loop.add_writer(
File "C:\Users\PrasaRak\Miniconda3\envs\learn-gremlin\lib\asyncio\events.py", line 507, in add_writer
raise NotImplementedError
NotImplementedError
I think i got the answer.
issue was with python 3.8 & Tornado compatibility, when it comes to asyncio.
more info is at this link
fix was to add following line in tornado/platform/asyncio.py
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) # python-3.8.0a4

gremlin python add vertex KeyError

I'm using gremlinpython. Inserting a vertex with a property value of greater than 32-bits results in a KeyError.
g.addV('test').property('size', 2147483648).iterate()
File "/home/ec2-user/src/common/test.py", line 74, in insert_vertices
self.g.addV('test').property('size', 2147483648).iterate()
File "/home/ec2-user/venv/lib64/python3.6/dist-packages/gremlin_python/process/traversal.py", line 65, in iterate
try: self.nextTraverser()
File "/home/ec2-user/venv/lib64/python3.6/dist-packages/gremlin_python/process/traversal.py", line 70, in nextTraverser
self.traversal_strategies.apply_strategies(self)
File "/home/ec2-user/venv/lib64/python3.6/dist-packages/gremlin_python/process/traversal.py", line 506, in apply_strategies
traversal_strategy.apply(traversal)
File "/home/ec2-user/venv/lib64/python3.6/dist-packages/gremlin_python/driver/remote_connection.py", line 148, in apply
remote_traversal = self.remote_connection.submit(traversal.bytecode)
File "/home/ec2-user/venv/lib64/python3.6/dist-packages/gremlin_python/driver/driver_remote_connection.py", line 54, in submit
results = result_set.all().result()
File "/usr/lib64/python3.6/concurrent/futures/_base.py", line 432, in result
return self.__get_result()
File "/usr/lib64/python3.6/concurrent/futures/_base.py", line 384, in __get_result
raise self._exception
File "/home/ec2-user/venv/lib64/python3.6/dist-packages/gremlin_python/driver/resultset.py", line 90, in cb
f.result()
File "/usr/lib64/python3.6/concurrent/futures/_base.py", line 425, in result
return self.__get_result()
File "/usr/lib64/python3.6/concurrent/futures/_base.py", line 384, in __get_result
raise self._exception
File "/usr/lib64/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/ec2-user/venv/lib64/python3.6/dist-packages/gremlin_python/driver/connection.py", line 80, in _receive
status_code = self._protocol.data_received(data, self._results)
File "/home/ec2-user/venv/lib64/python3.6/dist-packages/gremlin_python/driver/protocol.py", line 83, in data_received
result_set = results_dict[request_id]
KeyError: None
A value of less than 32 bits works fine
g.addV('test').property('size', 2147483647).iterate()
Casting it to float also works fine
g.addV('test').property('size', float(2147483648)).iterate()
Same behavior with a locally running gremlin server and a remote Neptune DB. It works fine from the gremlin console. So I don't think this is a server issue.
Python version - 3.6 and 3.7
gremlinpython version - 3.4.1
You explicitly need to define that number as a long() like:
from gremlin_python.statics import *
g.addV('test').property('size', long(2147483648)).iterate()

PyTorch Tutorial Error Training a Classifier

I just started the PyTorch-Tutorial Deep Learning with PyTorch: A 60 Minute Blitz and I should add, that I haven't programmed any python (but other languages like Java) before.
Right now, my Code looks like
import torch
import torchvision
import torchvision.transforms as transforms
import matplotlib.pyplot as plt
import numpy as np
print("\n-------------------Backpropagation-------------------\n")
transform = transforms.Compose(
[transforms.ToTensor(),
transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))])
trainset = torchvision.datasets.CIFAR10(root='./data', train=True,download=True, transform=transform)
trainloader = torch.utils.data.DataLoader(trainset, batch_size=4, shuffle=True, num_workers=2)
testset = torchvision.datasets.CIFAR10(root='./data', train=False, download=True, transform=transform)
testloader = torch.utils.data.DataLoader(testset, batch_size=4, shuffle=False, num_workers=2)
classes = ('plane', 'car', 'bird', 'cat', 'deer', 'dog', 'frog', 'horse', 'ship', 'truck')
dataiter = iter(trainloader)
images, labels = dataiter.next()
def imshow(img):
img = img / 2 + 0.5
npimg = img.numpy()
plt.imshow(np.transpose(npimg, (1, 2, 0)))
imshow(torchvision.utils.make_grid(images))
print(' '.join('%5s' % classes[labels[j]] for j in range(4)))
which should be consistent with the tutorial.
If I execute this, I'll get the following error:
"C:\Program Files\Anaconda3\python.exe" C:/MA/pytorch/deepLearningWithPytorchTutorial/trainingClassifier.py
-------------------Backpropagation-------------------
Files already downloaded and verified
Files already downloaded and verified
-------------------Backpropagation-------------------
Files already downloaded and verified
Files already downloaded and verified
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Program Files\Anaconda3\lib\multiprocessing\spawn.py", line 105, in spawn_main
exitcode = _main(fd)
File "C:\Program Files\Anaconda3\lib\multiprocessing\spawn.py", line 114, in _main
prepare(preparation_data)
File "C:\Program Files\Anaconda3\lib\multiprocessing\spawn.py", line 225, in prepare
_fixup_main_from_path(data['init_main_from_path'])
File "C:\Program Files\Anaconda3\lib\multiprocessing\spawn.py", line 277, in _fixup_main_from_path
run_name="__mp_main__")
File "C:\Program Files\Anaconda3\lib\runpy.py", line 263, in run_path
pkg_name=pkg_name, script_name=fname)
File "C:\Program Files\Anaconda3\lib\runpy.py", line 96, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File "C:\Program Files\Anaconda3\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\MA\pytorch\deepLearningWithPytorchTutorial\trainingClassifier.py", line 23, in <module>
dataiter = iter(trainloader)
File "C:\Program Files\Anaconda3\lib\site-packages\torch\utils\data\dataloader.py", line 451, in __iter__
return _DataLoaderIter(self)
File "C:\Program Files\Anaconda3\lib\site-packages\torch\utils\data\dataloader.py", line 239, in __init__
w.start()
File "C:\Program Files\Anaconda3\lib\multiprocessing\process.py", line 105, in start
self._popen = self._Popen(self)
File "C:\Program Files\Anaconda3\lib\multiprocessing\context.py", line 223, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "C:\Program Files\Anaconda3\lib\multiprocessing\context.py", line 322, in _Popen
return Popen(process_obj)
File "C:\Program Files\Anaconda3\lib\multiprocessing\popen_spawn_win32.py", line 33, in __init__
prep_data = spawn.get_preparation_data(process_obj._name)
File "C:\Program Files\Anaconda3\lib\multiprocessing\spawn.py", line 143, in get_preparation_data
_check_not_importing_main()
File "C:\Program Files\Anaconda3\lib\multiprocessing\spawn.py", line 136, in _check_not_importing_main
is not going to be frozen to produce an executable.''')
RuntimeError:
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.
This probably means that you are not using fork to start your
child processes and you have forgotten to use the proper idiom
in the main module:
if __name__ == '__main__':
freeze_support()
...
The "freeze_support()" line can be omitted if the program
is not going to be frozen to produce an executable.
Traceback (most recent call last):
File "C:/MA/pytorch/deepLearningWithPytorchTutorial/trainingClassifier.py", line 23, in <module>
dataiter = iter(trainloader)
File "C:\Program Files\Anaconda3\lib\site-packages\torch\utils\data\dataloader.py", line 451, in __iter__
return _DataLoaderIter(self)
File "C:\Program Files\Anaconda3\lib\site-packages\torch\utils\data\dataloader.py", line 239, in __init__
w.start()
File "C:\Program Files\Anaconda3\lib\multiprocessing\process.py", line 105, in start
self._popen = self._Popen(self)
File "C:\Program Files\Anaconda3\lib\multiprocessing\context.py", line 223, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "C:\Program Files\Anaconda3\lib\multiprocessing\context.py", line 322, in _Popen
return Popen(process_obj)
File "C:\Program Files\Anaconda3\lib\multiprocessing\popen_spawn_win32.py", line 65, in __init__
reduction.dump(process_obj, to_child)
File "C:\Program Files\Anaconda3\lib\multiprocessing\reduction.py", line 60, in dump
ForkingPickler(file, protocol).dump(obj)
BrokenPipeError: [Errno 32] Broken pipe
Process finished with exit code 1
I already downloaded the *.py and *.ipynb.
Running the *.ipynb with jupyter works fine (but I don't want to programm in the juniper web-interface, I prefer pyCharm) while the *.py in the console (Anaconda prompt and cmd) fails with the same error.
Does anyone know how to fix this?
(I'm using Python 3.6.5 (from Anaconda) and pyCharm, OS: Win10 64-bit)
Thanks!
Bene
Update:
If it is relevant, I just set num_workers=2 to num_workers=0 (both) and then it'll work.. .
Check out the documentation for multiprocessing: programming guidelines for windows. You should wrap all operations in functions and then call them inside an if __name__ == '__main__' clause:
# required imports
def load_datasets(...):
# Code to load the datasets with multiple workers
def train(...):
# Code to train the model
if __name__ == '__main__':
load_datasets()
train()
In short, the the idea here is to wrap the example code inside an if __name__ == '__main__' statement.
Because of different implementation of multiprocessing in Windows, you need to wrap your main code with this block:
if __name__ == '__main__':
For more info, you can check the official PyTorch Windows notes.

zope.annotation example in documentation fails. Help needed to correct it

I am trying to understand Annotations from this document:
http://docs.zope.org/zope.annotation/index.html
However the example fails when run.
I get:
Traceback (most recent call last):
File "./zopepy", line 366, in <module>
exec(compile(__file__f.read(), __file__, "exec"))
File "test1.py", line 29, in <module>
bar = IBar(foo)
File "eggs/zope.component-3.9.5-py2.7.egg/zope/component/_api.py", line 156, in adapter_hook
return sitemanager.queryAdapter(object, interface, name, default)
File "eggs/zope.component-3.9.5- py2.7.egg/zope/component/registry.py", line 228, in queryAdapter
return self.adapters.queryAdapter(object, interface, name, default)
File "eggs/zope.annotation-3.5.0-py2.7.egg/zope/annotation/factory.py", line 42, in getAnnotation
annotations = zope.annotation.interfaces.IAnnotations(context)
TypeError: ('Could not adapt', <__main__.Foo object at 0xb6d6956c>, <InterfaceClass zope.annotation.interfaces.IAnnotations>)
Example missing the following statements:
from zope.annotation.attribute import AttributeAnnotations
provideAdapter(AttributeAnnotations)

Resources