monkeys icon indicating copy to clipboard operation
monkeys copied to clipboard

Error at "Getting started" notebook

Open echo66 opened this issue 6 years ago • 2 comments

When running type_graph(), I'm getting the following error:

TypeError: object of type 'map' has no len()

echo66 avatar Jul 06 '18 16:07 echo66

This issue cropped up during the py2->py3 migration and has already been fixed on the master branch, but it is still present in the latest pip package. You can fix your installation by manually patching display.py in your site-packages directory.

--- display.py	2018-07-07 04:33:58.679379224 +0200
+++ display.py	2018-07-06 04:49:31.000000000 +0200
@@ -53,7 +53,7 @@
                     )
                 continue
                 
-            elif len(params) > 1:
+            elif len(list(params)) > 1:
                 # show composition of constructed type from constituents
                 graph.node(
                     targeting_function.readable_params, 

As an alternative, you can install the latest master branch

pip uninstall monkeys
git clone https://github.com/hchasestevens/monkeys
cd monkeys
python3 setup.py build
python3 setup.py install

klaufir216 avatar Jul 07 '18 02:07 klaufir216

Thanks for the quick response, @klaufira !

Another way to solve that is installing directly from github, with a specific hash.

Consider this issue solved. Thanks! :)

echo66 avatar Jul 08 '18 14:07 echo66