Open fulaibaowang opened 1 year ago
I received the same error. Any tips? Thank you in advance! @zhengtaoxiao
Update: uninstalling and re-installing fasta and Pyfasta solved the issue.
RiboCode uses pyfasta instead of the updated version pyfaidx, so I browsed through the source code of pyfasta and found that in the init.py file, the code from fasta import Fasta, complement, DuplicateHeaderException is actually intended to call the fasta.py script in the same directory, rather than importing a module named fasta. If necessary, you can manually modify the init.py file and then install it.
additionally,"pyfasta" requires Python 2, while "RiboCode" requires Python 3.6 or above.So: In fasta.py, for Python 3.10 and above, from collections import Mapping should be changed to from collections.abc import Mapping. In records.py, for Python 3.X, import cPickle should be changed to import _pickle as cPickle, and the long type should be removed. In split_fasta.py, for Python 3.X, from cStringIO import StringIO should be changed to from io import StringIO.
additionally,"pyfasta" requires Python 2, while "RiboCode" requires Python 3.6 or above.So: In fasta.py, for Python 3.10 and above, from collections import Mapping should be changed to from collections.abc import Mapping. In records.py, for Python 3.X, import cPickle should be changed to import _pickle as cPickle, and the long type should be removed. In split_fasta.py, for Python 3.X, from cStringIO import StringIO should be changed to from io import StringIO.
Hello,I can't exactly understand the step how to solve with it. How to instead the python2 to python3 in fasta? can you give me some more detail suggestions,thank you so much┭┮﹏┭┮
For me helped:
sed -i
-e 's/from fasta/from pyfasta.fasta/'
-e 's/from records/from pyfasta.records/'
-e 's/from split_fasta/from pyfasta.split_fasta/'
pyfasta/__init__.py &&
sed -i 's/from collections/from collections.abc/' pyfasta/fasta.py &&
sed -i 's/from records/from pyfasta.records/' pyfasta/fasta.py &&
sed -i 's/import cPickle/import _pickle as cPickle/' pyfasta/records.py &&
sed -i 's/from cStringIO import StringIO/from io import StringIO/' pyfasta/split_fasta.py &&
Hi, I got a ModuleNotFoundError when testing the RiboCode installation with
RiboCode_onestep -V
Can you help?my package list