Which version of pweave needed?

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)

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

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.

1 Like

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:

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

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

with:

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

However, I got the same error message as above:

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.

(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?

i’m running into the same issue as @hilasha2

Has anyone been able to resolve all the dependencies yet?

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

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

Hello, we’re also running into this problem. Trying to get an older version running now using this thread, but conda seems to be giving me a hard time. A fix for the current version would be great :).

1 Like

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.

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. But also that doesn’t seem to work (anymore) :(.

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