# Kneaddata\_build\_database error

**URL:** <https://forum.biobakery.org/t/kneaddata-build-database-error/988>\
**Category:** KneadData\
**Created:** [September 9, 2020, 2:40am UTC](https://forum.biobakery.org/t/kneaddata-build-database-error/988 "2020-09-09T02:40:54Z")\
**Posts on this page:** 4\
**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 9, 2020, 2:40am UTC](https://forum.biobakery.org/t/kneaddata-build-database-error/988/1 "2020-09-09T02:40:54Z")

</div>

Hi,  
when i run the fllow command,  
kneaddata\_build\_database Homo\_sapiens.GRCh38.dna.primary\_assembly.fa -o hum  
an\_genome  
it report an error showing on the fig

 ![深度截图_选择区域_20200909104005](https://canada1.discourse-cdn.com/flex027/uploads/biobakery/original/1X/795133e41a578a4be5fad2ff30d3ace985315659.png)

---

<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 9, 2020, 7:32pm UTC](https://forum.biobakery.org/t/kneaddata-build-database-error/988/2 "2020-09-09T19:32:41Z")

</div>

Hello, Thank you for the detailed post and sorry for the confusing error message. It looks like the kneaddata build database script is not currently python3 compatible. We will make those changes on our end and include them in the next release. Until then would you run the script with python 2? I think this should resolve the errors that you are seeing.

Thank you,  
Lauren

---

<div class="post-metadata">

**Author:** ![fanhuan](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/fanhuan/32/451_2.png) [@fanhuan](https://forum.biobakery.org/u/fanhuan)\
**Post date:** [October 29, 2020, 2:26am UTC](https://forum.biobakery.org/t/kneaddata-build-database-error/988/3 "2020-10-29T02:26:53Z")

</div>

Hello, I ran into the same issue. I tried to use a python2 environment by `source activate py2`, but the problem persisted:

```auto
Exception in thread makeblastdb:
Traceback (most recent call last):
  File "/home/hfan/build/anaconda3/lib/python3.7/threading.py", line 917, in _bootstrap_inner
    self.run()
  File "/home/hfan/build/anaconda3/lib/python3.7/site-packages/kneaddata/generate_db.py", line 54, in run
    f.write(output)
TypeError: write() argument must be str, not bytes

^CTraceback (most recent call last):
  File "/home/hfan/build/anaconda3/bin/kneaddata_build_database", line 10, in <module>
    sys.exit(main())
  File "/home/hfan/build/anaconda3/lib/python3.7/site-packages/kneaddata/generate_db.py", line 189, in main
    t.join()
  File "/home/hfan/build/anaconda3/lib/python3.7/threading.py", line 1032, in join
    self._wait_for_tstate_lock()
  File "/home/hfan/build/anaconda3/lib/python3.7/threading.py", line 1048, in _wait_for_tstate_lock
    elif lock.acquire(block, timeout):
KeyboardInterrupt
Exception in thread srprism:
Traceback (most recent call last):
  File "/home/hfan/build/anaconda3/lib/python3.7/threading.py", line 917, in _bootstrap_inner
    self.run()
  File "/home/hfan/build/anaconda3/lib/python3.7/site-packages/kneaddata/generate_db.py", line 54, in run
    f.write(output)
TypeError: write() argument must be str, not bytes

```

Is it something wrong with my installation of kneaddata? Should have I installed it in an python2 environment to begin with?

I also tried the biobakery3 environment and it did not work either with the same error message.

Any help is appreciated.

---

<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:** [October 29, 2020, 9:39pm UTC](https://forum.biobakery.org/t/kneaddata-build-database-error/988/4 "2020-10-29T21:39:04Z")

</div>

Hello, Thank you for the detailed post and sorry for any confusion. The kneaddata\_db utility script is not python 3 compatible in the latest release. We have made the changes and it will be python 3 compatible in the next release. If you would run that utility script with python 2 it should resolve the errors you are seeing.

Thank you,  
Lauren
