# MetaPhlAn 3 urllib.error.URLError

**URL:** <https://forum.biobakery.org/t/metaphlan-3-urllib-error-urlerror/1563>\
**Category:** MetaPhlAn\
**Created:** [January 19, 2021, 5:16am UTC](https://forum.biobakery.org/t/metaphlan-3-urllib-error-urlerror/1563 "2021-01-19T05:16:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![top334](https://avatars.discourse-cdn.com/v4/letter/t/ebca7d/32.png) [@top334](https://forum.biobakery.org/u/top334)\
**Post date:** [January 19, 2021, 5:16am UTC](https://forum.biobakery.org/t/metaphlan-3-urllib-error-urlerror/1563/1 "2021-01-19T05:16:34Z")

</div>

I use MetaPhlAn 3 to analysis the lake sample, the error are as follows. And I cannot find the similar question who has met on Internet. Please give me some advise.  
Traceback (most recent call last):  
File “/ldfssz1/ST\_META/share/User/zhujie/.conda/envs/bioenv3.7/lib/python3.7/urllib/request.py”, line 1350, in do\_open  
encode\_chunked=req.has\_header(‘Transfer-encoding’))  
File “/ldfssz1/ST\_META/share/User/zhujie/.conda/envs/bioenv3.7/lib/python3.7/http/client.py”, line 1262, in request  
self.\_send\_request(method, url, body, headers, encode\_chunked)  
File “/ldfssz1/ST\_META/share/User/zhujie/.conda/envs/bioenv3.7/lib/python3.7/http/client.py”, line 1308, in \_send\_request  
self.endheaders(body, encode\_chunked=encode\_chunked)  
File “/ldfssz1/ST\_META/share/User/zhujie/.conda/envs/bioenv3.7/lib/python3.7/http/client.py”, line 1257, in endheaders  
self.\_send\_output(message\_body, encode\_chunked=encode\_chunked)  
File “/ldfssz1/ST\_META/share/User/zhujie/.conda/envs/bioenv3.7/lib/python3.7/http/client.py”, line 1028, in \_send\_output  
self.send(msg)  
File “/ldfssz1/ST\_META/share/User/zhujie/.conda/envs/bioenv3.7/lib/python3.7/http/client.py”, line 968, in send  
self.connect()  
File “/ldfssz1/ST\_META/share/User/zhujie/.conda/envs/bioenv3.7/lib/python3.7/http/client.py”, line 940, in connect  
(self.host,self.port), self.timeout, self.source\_address)  
File “/ldfssz1/ST\_META/share/User/zhujie/.conda/envs/bioenv3.7/lib/python3.7/socket.py”, line 728, in create\_connection  
raise err  
File “/ldfssz1/ST\_META/share/User/zhujie/.conda/envs/bioenv3.7/lib/python3.7/socket.py”, line 716, in create\_connection  
sock.connect(sa)  
OSError: [Errno 101] Network is unreachable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):  
File “/ldfssz1/ST\_META/share/User/zhujie/.conda/envs/bioenv/bin/metaphlan”, line 10, in   
sys.exit(main())  
File “/ldfssz1/ST\_META/share/User/zhujie/.conda/envs/bioenv3.7/lib/python3.7/site-packages/metaphlan/metaphlan.py”, line 925, in main  
pars[‘index’] = check\_and\_install\_database(pars[‘index’], pars[‘bowtie2db’], pars[‘bowtie2\_build’], pars[‘nproc’], pars[‘force\_download’])  
File “/ldfssz1/ST\_META/share/User/zhujie/.conda/envs/bioenv3.7/lib/python3.7/site-packages/metaphlan/ **init**.py”, line 258, in check\_and\_install\_database  
if urllib.request.urlopen(“[http://cmprod1.cibio.unitn.it/biobakery3/metaphlan\_databases/mpa\_latest](http://cmprod1.cibio.unitn.it/biobakery3/metaphlan_databases/mpa_latest)”).getcode() != 200:  
File “/ldfssz1/ST\_META/share/User/zhujie/.conda/envs/bioenv3.7/lib/python3.7/urllib/request.py”, line 222, in urlopen  
return opener.open(url, data, timeout)  
File “/ldfssz1/ST\_META/share/User/zhujie/.conda/envs/bioenv3.7/lib/python3.7/urllib/request.py”, line 525, in open  
response = self.\_open(req, data)  
File “/ldfssz1/ST\_META/share/User/zhujie/.conda/envs/bioenv3.7/lib/python3.7/urllib/request.py”, line 543, in \_open  
‘\_open’, req)  
File “/ldfssz1/ST\_META/share/User/zhujie/.conda/envs/bioenv3.7/lib/python3.7/urllib/request.py”, line 503, in \_call\_chain  
result = func(\*args)  
File “/ldfssz1/ST\_META/share/User/zhujie/.conda/envs/bioenv3.7/lib/python3.7/urllib/request.py”, line 1378, in http\_open  
return self.do\_open(http.client.HTTPConnection, req)  
File “/ldfssz1/ST\_META/share/User/zhujie/.conda/envs/bioenv3.7/lib/python3.7/urllib/request.py”, line 1352, in do\_open  
raise URLError(err)  
urllib.error.URLError: \<urlopen error [Errno 101] Network is unreachable\>

and our compute node could not connect the network. So I really do not know how to resolve it .

---

<div class="post-metadata">

**Author:** ![ssorgatem](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/ssorgatem/32/575_2.png) [@ssorgatem](https://forum.biobakery.org/u/ssorgatem)\
**Post date:** [January 19, 2021, 8:10am UTC](https://forum.biobakery.org/t/metaphlan-3-urllib-error-urlerror/1563/2 "2021-01-19T08:10:55Z")

</div>

Looks like Metaphlan needs a working internet connection…

---

<div class="post-metadata">

**Author:** ![fbeghini](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/fbeghini/32/81_2.png) [@fbeghini](https://forum.biobakery.org/u/fbeghini)\
**Post date:** [January 19, 2021, 10:31am UTC](https://forum.biobakery.org/t/metaphlan-3-urllib-error-urlerror/1563/3 "2021-01-19T10:31:09Z")

</div>

No, MetaPhlAn does not require an internet connection to be executed. If you have a local built copy of the database, you can manually specify `--index mpa_v30_CHOCOPhlAn_201901`.

From the MetaPhlAn wiki:

> When `--index` is specified, MetaPhlAn skips the check for the latest database version and run the analysis using the database version provided by `--index` located in `--bowtie2db` .

---

<div class="post-metadata">

**Author:** ![top334](https://avatars.discourse-cdn.com/v4/letter/t/ebca7d/32.png) [@top334](https://forum.biobakery.org/u/top334)\
**Post date:** [January 22, 2021, 7:50am UTC](https://forum.biobakery.org/t/metaphlan-3-urllib-error-urlerror/1563/4 "2021-01-22T07:50:11Z")

</div>

Thank you so much! I got it.
