# List.CountOccurences Replacement

**URL:** <https://forum.dynamobim.com/t/list-countoccurences-replacement/76360>\
**Category:** Share\
**Tags:** clockwork, python, dynamo\
**Created:** [May 10, 2022, 3:33am UTC](https://forum.dynamobim.com/t/list-countoccurences-replacement/76360 "2022-05-10T03:33:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![truevis](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/truevis/32/8634_2.png) [@truevis](https://forum.dynamobim.com/u/truevis)\
**Post date:** [May 10, 2022, 3:33am UTC](https://forum.dynamobim.com/t/list-countoccurences-replacement/76360/1 "2022-05-10T03:33:12Z")

</div>

`List.CountOccurences` seems to be missing from Revit 2022 Dynamo in Clockwork. Here is a replacement:

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/7/77f0a6819653bfc73c5f187940584b441303c1ae.png)

```auto
import sys
import clr
import collections
from collections import Counter

a = IN[0]

OUT = dict((i, a.count(i)) for i in a)

```

Should I share as Node?

---

<div class="post-metadata">

**Author:** ![Elie.Trad](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/elie.trad/32/110373_2.png) [@Elie.Trad](https://forum.dynamobim.com/u/Elie.Trad)\
**Post date:** [May 10, 2022, 8:52am UTC](https://forum.dynamobim.com/t/list-countoccurences-replacement/76360/2 "2022-05-10T08:52:05Z")

</div>

@truevis it is, did you install the latest package?

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/f/5f4a16fb68abf7a7c782b15bac93e752f17f4cce.png)

---

<div class="post-metadata">

**Author:** ![truevis](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/truevis/32/8634_2.png) [@truevis](https://forum.dynamobim.com/u/truevis)\
**Post date:** [May 10, 2022, 10:02am UTC](https://forum.dynamobim.com/t/list-countoccurences-replacement/76360/3 "2022-05-10T10:02:31Z")

</div>

> [@Elie.Trad](#):
>
> did you install the latest package?

I had to delete _Clockwork for Dynamo 2.x_ and _Bakery_ from my Package folder, then install _Clockwork for Dynamo 2.x_ from Package Search and it came back. Thanks for the advice.

Now re-install _Bakery_, or copy the old folder back, or just do without? This seems bad:  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/0/60f998162e5fa883b9856a6b3a30b801b712c7d3.png)  
@Luke_Johnson – advice?

---

<div class="post-metadata">

**Author:** ![john\_pierson](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/john_pierson/32/191977_2.png) [@john\_pierson](https://forum.dynamobim.com/u/john_pierson)\
**Post date:** [May 10, 2022, 5:40pm UTC](https://forum.dynamobim.com/t/list-countoccurences-replacement/76360/4 "2022-05-10T17:40:38Z")

</div>

> [@truevis](#):
>
> just do without

_note, I mean the below comment as nice as I can_

I think you answered your own question. The dependency nightmare that bakery has is hard to manage and not worth the effort IMO.

Additionally, the last update is from 2 years ago? As far as I know, that isn’t even guaranteed compatibility with any 2.x version.

* * *

If, (big if) you need to install bakery, I advise you do this manually by downloading the files from [DynamoPackages.com](http://DynamoPackages.com) manually and extracting. This eliminates the package manager trying to resolve the dependencies and downloading old versions of several other packages, (that have been updated way more recently than 2 years).

---

<div class="post-metadata">

**Author:** ![john\_pierson](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/john_pierson/32/191977_2.png) [@john\_pierson](https://forum.dynamobim.com/u/john_pierson)\
**Post date:** [May 10, 2022, 5:44pm UTC](https://forum.dynamobim.com/t/list-countoccurences-replacement/76360/5 "2022-05-10T17:44:25Z")

</div>

also, I just noticed that bakery is in a state of not being able to be updated.

> [@Bakery Package doesn't work](https://forum.dynamobim.com/t/bakery-package-doesnt-work/3749/13):
>
> Unfortunately the Package Manager doesn’t allow me to upload Bakery recently. You can download the nodes from [https://github.com/LukeyJohnson/BakeryForDynamo/tree/master/nodes](https://github.com/LukeyJohnson/BakeryForDynamo/tree/master/nodes) and put them in the packages/Bakery/dyf folder. This should work.

In my opinion, as someone managing package deployments for several clients, Bakery is a hard no for being deployed at scale at any firm.

Once again, I don’t mean this in a “mean” way or anything like that. But if I can avoid additional headaches _(with the already headache-prone package management of Dynamo)_, I am going to do it.

* * *

Note: I marked @Elie.Trad 's response as the solution to this, because installing the latest clockwork (not what bakery forces) is the **real solution** here.
