# Which version of pweave needed?

**URL:** <https://forum.biobakery.org/t/which-version-of-pweave-needed/1000>\
**Category:** AnADAMA2\
**Created:** [September 11, 2020, 5:47am UTC](https://forum.biobakery.org/t/which-version-of-pweave-needed/1000 "2020-09-11T05:47:04Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![wangzhichao1990](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/wangzhichao1990/32/381_2.png) [@wangzhichao1990](https://forum.biobakery.org/u/wangzhichao1990)\
**Post date:** [September 11, 2020, 5:47am UTC](https://forum.biobakery.org/t/which-version-of-pweave-needed/1000/1 "2020-09-11T05:47:04Z")

</div>

Run the command:  
biobakery\_workflows wmgx\_vis --input results -o results\_vis --project-name vis  
report an error:  
Task 0 failed  
Name: document  
Original error:  
Error executing action 0. Original Exception:  
Traceback (most recent call last):  
File “/home/xmk/anaconda3/envs/biobakery\_workflows/lib/python3.7/site-packages/anadama2/runners.py”, line 201, in \_run\_task\_locally  
action\_func(task)  
File “/home/xmk/anaconda3/envs/biobakery\_workflows/lib/python3.7/site-packages/anadama2/document.py”, line 204, in create  
from pweave import PwebPandocFormatter, Pweb, PwebProcessor  
**ImportError: cannot import name ‘PwebProcessor’ from ‘pweave’** (/home/xmk/anaconda3/envs/biobakery\_workflows/lib/python3.7/site-packages/pweave/ **init**.py)

---

<div class="post-metadata">

**Author:** ![lauren.j.mciver](https://avatars.discourse-cdn.com/v4/letter/l/f05b48/32.png) [@lauren.j.mciver](https://forum.biobakery.org/u/lauren.j.mciver)\
**Post date:** [September 11, 2020, 7:07pm UTC](https://forum.biobakery.org/t/which-version-of-pweave-needed/1000/2 "2020-09-11T19:07:45Z")

</div>

Hello, Sorry for the confusion and thank you for including the detailed traceback error. Anadama2 requires pweave v0.25. This was the last pweave version that was python2 and python3 compatible. If you roll back your pweave to the prior version it should resolve the error you are seeing.

Thank you,  
Lauren

---

<div class="post-metadata">

**Author:** ![wangzhichao1990](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/wangzhichao1990/32/381_2.png) [@wangzhichao1990](https://forum.biobakery.org/u/wangzhichao1990)\
**Post date:** [September 14, 2020, 1:51am UTC](https://forum.biobakery.org/t/which-version-of-pweave-needed/1000/3 "2020-09-14T01:51:48Z")

</div>

I have used the following comand to create a good env for the biobakery\_workflow.

conda create -n biobakery python=3.6 biobakery\_workflows networkx=1.11 pweave=0.25 leveldb=0.193 hclust2 megahit prokka seqtk trimmomatic

Thanks for your help.

---

<div class="post-metadata">

**Author:** ![hilasha2](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/hilasha2/32/947_2.png) [@hilasha2](https://forum.biobakery.org/u/hilasha2)\
**Post date:** [August 11, 2021, 4:17pm UTC](https://forum.biobakery.org/t/which-version-of-pweave-needed/1000/4 "2021-08-11T16:17:20Z")

</div>

pweave v0.25 doesn’t work with python 3.7.\* and above. However, MetaPhlAn 3.0 and HUMAnN 3.0 require python 3.7.  
I tried delving into pweave’s code and your code.  
pweave’s code:

> **[Pweave/pweave/processors at master · mpastell/Pweave](https://github.com/mpastell/Pweave/tree/master/pweave/processors)**
>
> master/pweave/processors

In your code you created the class PwebProcessorSpaces which is supposed to inherit the class PwebProcessor in pweave. However, PwebProcessor doesn’t exist in pweave v30.3.  
You then override PwebProcessor’s function: loadinline() [lines 204-207, anadama2/document.py].  
pweave v30.3 does have an abstract class PwebProcessorBase though. This class includes the function loadinline().  
As such, I tried to replace the class PwebProcessor with PwebProcessorBase:  
_~/miniconda3/envs/$MY\_ENV/lib/python3.7/site-packages/anadama2/document.py_  
_lines 204-207_

```auto
from pweave import PwebPandocFormatter, Pweb, PwebProcessor
 .....
class PwebProcessorSpaces(PwebProcessor):

```

with:

```auto
from pweave import PwebPandocFormatter, Pweb, PwebProcessorBase
 .....
class PwebProcessorSpaces(PwebProcessorBase):

```

However, I got the same error message as above:

```auto
ImportError: cannot import name 'PwebProcessorBase' from 'pweave'

```

I also saw that pweave also has the class PwebProcessors which basically builds one of two possible classes which are the children of the class PwebProcessorBase.

So I decided to switch again **PwebProcessors** with **PwebProcessor** in lines 204-207. This didn’t evoke an error message, however, the run still failed.

```auto
(Aug 11 19:13:57) [0/2 - 0.00%] **Ready** Task 0: document
(Aug 11 19:13:57) [0/2 - 0.00%] **Started** Task 0: document
Traceback (most recent call last):
  File "~/miniconda3/envs/$MY_ENV/bin/wmgx_vis.py", line 133, in <module>
    workflow.go()
  File "~/miniconda3/envs/$MY_ENV/lib/python3.7/site-packages/anadama2/workflow.py", line 800, in go
    self._handle_finished()
  File "~/miniconda3/envs/$MY_ENV/lib/python3.7/site-packages/anadama2/workflow.py", line 832, in _handle_finished
    raise RunFailed()
anadama2.workflow.RunFailed

```

Any other way to bypass this problem?

---

<div class="post-metadata">

**Author:** ![adler-sudo](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/adler-sudo/32/1146_2.png) [@adler-sudo](https://forum.biobakery.org/u/adler-sudo)\
**Post date:** [February 25, 2022, 3:53am UTC](https://forum.biobakery.org/t/which-version-of-pweave-needed/1000/5 "2022-02-25T03:53:58Z")

</div>

i’m running into the same issue as @hilasha2

---

<div class="post-metadata">

**Author:** ![jcabrerard](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/jcabrerard/32/1280_2.png) [@jcabrerard](https://forum.biobakery.org/u/jcabrerard)\
**Post date:** [March 1, 2022, 6:49pm UTC](https://forum.biobakery.org/t/which-version-of-pweave-needed/1000/6 "2022-03-01T18:49:09Z")

</div>

Has anyone been able to resolve all the dependencies yet?

---

<div class="post-metadata">

**Author:** ![BioNomad](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/bionomad/32/1413_2.png) [@BioNomad](https://forum.biobakery.org/u/BioNomad)\
**Post date:** [April 28, 2022, 4:42pm UTC](https://forum.biobakery.org/t/which-version-of-pweave-needed/1000/7 "2022-04-28T16:42:55Z")

</div>

Just wanted to check if there was any progress on this yet.

---

<div class="post-metadata">

**Author:** ![suqianwei3](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/suqianwei3/32/1555_2.png) [@suqianwei3](https://forum.biobakery.org/u/suqianwei3)\
**Post date:** [July 10, 2022, 2:34pm UTC](https://forum.biobakery.org/t/which-version-of-pweave-needed/1000/8 "2022-07-10T14:34:33Z")

</div>

I also have the problem, do anyone have any solutions?

---

<div class="post-metadata">

**Author:** ![tlacoere](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/tlacoere/32/1578_2.png) [@tlacoere](https://forum.biobakery.org/u/tlacoere)\
**Post date:** [July 29, 2022, 11:51am UTC](https://forum.biobakery.org/t/which-version-of-pweave-needed/1000/9 "2022-07-29T11:51:44Z")

</div>

Hello, we’re also running into this problem. Trying to get an older version running now using [this thread](https://forum.biobakery.org/t/biobakery-workflows-errors-with-downloading-database-unpicking-error-topological-sort-error-and-unable-to-find-trimmomatic-error/1823/4), but conda seems to be giving me a hard time. A fix for the current version would be great :).

---

<div class="post-metadata">

**Author:** ![Kirby](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/kirby/32/1600_2.png) [@Kirby](https://forum.biobakery.org/u/Kirby)\
**Post date:** [August 22, 2022, 1:53am UTC](https://forum.biobakery.org/t/which-version-of-pweave-needed/1000/10 "2022-08-22T01:53:24Z")

</div>

one bypass :  
just creating python 3.7-based and python 3.6-based conda envs respectively,  
and running analysis in 3.7-based env and visualization in 3.6-based env in each.

---

<div class="post-metadata">

**Author:** ![tlacoere](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/tlacoere/32/1578_2.png) [@tlacoere](https://forum.biobakery.org/u/tlacoere)\
**Post date:** [August 22, 2022, 2:26pm UTC](https://forum.biobakery.org/t/which-version-of-pweave-needed/1000/11 "2022-08-22T14:26:50Z")

</div>

Yea so that’s what I tried here: [Biobakery Workflows: Errors with downloading database, "unpicking error", “topological\_sort()" error, and "Unable to find Trimmomatic" error - #6 by Ptero64](https://forum.biobakery.org/t/biobakery-workflows-errors-with-downloading-database-unpicking-error-topological-sort-error-and-unable-to-find-trimmomatic-error/1823/6). But also that doesn’t seem to work (anymore) :(.

---

<div class="post-metadata">

**Author:** ![SciLiciumTheo](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/sciliciumtheo/32/1697_2.png) [@SciLiciumTheo](https://forum.biobakery.org/u/SciLiciumTheo)\
**Post date:** [November 7, 2022, 3:42pm UTC](https://forum.biobakery.org/t/which-version-of-pweave-needed/1000/12 "2022-11-07T15:42:31Z")

</div>

After a long struggle, I managed to get `biobakery_workflows vis` to run. I detailed the steps here:

> [@Cannot get biobakery\_workflows vis to run](https://forum.biobakery.org/t/cannot-get-biobakery-workflows-vis-to-run/4338/11):
>
> BIG NEWS! I finally managed to get biobakery\_workflows vis to run! The solution that worked for me: Create conda env, but not installing biobakery\_workflows mamba create -n biobakery\_test python=3.7 pip zip gxx\_linux-64 pandoc R (If you don’t know [mamba](https://mamba.readthedocs.io/en/latest/), it is a drop-in replacement of conda that is much faster) Go inside the environment: conda activate biobakery\_test Install biobakery\_workflows and dependencies with pip: pip install numpy matplotlib humann scipy biobakery\_workflo…
