# Python ssl issues with lastgenre

**URL:** <https://discourse.beets.io/t/python-ssl-issues-with-lastgenre/49>\
**Category:** Help\
**Created:** [March 24, 2017, 2:13pm UTC](https://discourse.beets.io/t/python-ssl-issues-with-lastgenre/49 "2017-03-24T14:13:24Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Squiggley](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/squiggley/32/16_2.png) [@Squiggley](https://discourse.beets.io/u/Squiggley)\
**Post date:** [March 24, 2017, 2:13pm UTC](https://discourse.beets.io/t/python-ssl-issues-with-lastgenre/49/1 "2017-03-24T14:13:24Z")

</div>

I am a newbie to beets and it seems amazing however I am having problems getting it configured and working properly.  
The last piece to get working is lastgenre I am getting a certificate error with it  
Hardware: Synology NAS DS1511+  
OS: DSM 6  
beets version 1.4.3  
Python version 2.7.13  
plugins: acousticbrainz, beatport, chroma, discogs, fetchart, lastgenre, lyrics, missing

command : beet -v lastgenre gives  
error : lastgenre: [last.fm](http://last.fm) error: NetworkError: [SSL: CERTIFICATE\_VERIFY\_FAILED] unknown error (\_ssl.c:661)  
lastgenre: [last.fm](http://last.fm) error: NetworkError: [SSL: CERTIFICATE\_VERIFY\_FAILED] unknown error (\_ssl.c:661)

I think its a synology/python error, seems to be to do with #PEP 493: “private” API to configure HTTPS defaults without monkey patching

but I have no idea how to fix it, can anyone help?

---

<div class="post-metadata">

**Author:** ![adrian](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/adrian/32/4_2.png) [@adrian](https://discourse.beets.io/u/adrian)\
**Post date:** [March 24, 2017, 3:51pm UTC](https://discourse.beets.io/t/python-ssl-issues-with-lastgenre/49/2 "2017-03-24T15:51:44Z")

</div>

Hmm, that’s odd… I’m assuming this has to do with the version of Python provided by Synology. This thread seems to reflect the same problem, for example: [https://forum.synology.com/enu/viewtopic.php?t=98648](https://forum.synology.com/enu/viewtopic.php?t=98648)

Perhaps the solution is to try installing Python manually, or to switch to a different version of Python (e.g., 3.6)?

---

<div class="post-metadata">

**Author:** ![Squiggley](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/squiggley/32/16_2.png) [@Squiggley](https://discourse.beets.io/u/Squiggley)\
**Post date:** [March 25, 2017, 4:58pm UTC](https://discourse.beets.io/t/python-ssl-issues-with-lastgenre/49/3 "2017-03-25T16:58:21Z")

</div>

Thanks for the response! So I took your advice and removed 2.7.13 (also had to remove a bunch of other packages including beets before I could remove python) these are the steps I took

1. opkg remove --force-removal-of-dependent-packages python
2. Ran opkg install python3
3. Had to reinstall pip - wget [https://bootstrap.pypa.io/get-pip.py](https://bootstrap.pypa.io/get-pip.py)
4. python3 [get-pip.py](http://get-pip.py)
5. pip install beets  
It seemed to install ok and seems to be using python 3.6 here is the output  
Collecting beets  
Using cached beets-1.4.3.tar.gz  
Requirement already satisfied: six\>=1.9 in /volume1/@entware-ng/opt/lib/python3.6/site-packages (from beets)  
Collecting mutagen\>=1.33 (from beets)  
Using cached mutagen-1.37.tar.gz  
Collecting munkres (from beets)  
Using cached munkres-1.0.8.tar.gz  
Collecting unidecode (from beets)  
Using cached Unidecode-0.04.20-py2.py3-none-any.whl  
Collecting musicbrainzngs\>=0.4 (from beets)  
Using cached musicbrainzngs-0.6.tar.gz  
Collecting pyyaml (from beets)  
Using cached PyYAML-3.12.tar.gz  
Collecting jellyfish (from beets)  
Using cached jellyfish-0.5.6.tar.gz  
Building wheels for collected packages: beets, mutagen, munkres, musicbrainzngs, pyyaml, jellyfish  
Running [setup.py](http://setup.py) bdist\_wheel for beets … done  
Stored in directory: /root/.cache/pip/wheels/f7/fd/bd/69685c9c0d01fbbcf0a44000acb964cb132b53704e30467284  
Running [setup.py](http://setup.py) bdist\_wheel for mutagen … done  
Stored in directory: /root/.cache/pip/wheels/d2/99/7a/49007bed098faaed83d9b802386f4b31d6babc30f354ed8ff7  
Running [setup.py](http://setup.py) bdist\_wheel for munkres … done  
Stored in directory: /root/.cache/pip/wheels/aa/8f/c6/43d3af94253c17eecb5bc451e4b5cbfd099a387e582a798ec8  
Running [setup.py](http://setup.py) bdist\_wheel for musicbrainzngs … done  
Stored in directory: /root/.cache/pip/wheels/b7/06/bb/c891cad2436937ba584d1823fa20373194ff73c081af84f68d  
Running [setup.py](http://setup.py) bdist\_wheel for pyyaml … done  
Stored in directory: /root/.cache/pip/wheels/2c/f7/79/13f3a12cd723892437c0cfbde1230ab4d82947ff7b3839a4fc  
Running [setup.py](http://setup.py) bdist\_wheel for jellyfish … done  
Stored in directory: /root/.cache/pip/wheels/0f/a8/f6/3c2f1675f6a60367a113203470a21398c178d5145df7e68d24  
Successfully built beets mutagen munkres musicbrainzngs pyyaml jellyfish  
Installing collected packages: mutagen, munkres, unidecode, musicbrainzngs, pyyaml, jellyfish, beets  
Successfully installed beets-1.4.3 jellyfish-0.5.6 munkres-1.0.8 musicbrainzngs-0.6 mutagen-1.37 pyyaml-3.12 unidecode-0.4.20

Had to obviously reinstall all the plugins I had which again seem to switch over to python 3.6 as this shows  
Collecting pylast  
Using cached pylast-1.8.0.tar.gz  
Requirement already satisfied: six in /volume1/@entware-ng/opt/lib/python3.6/site-packages (from pylast)  
Building wheels for collected packages: pylast  
Running [setup.py](http://setup.py) bdist\_wheel for pylast … done  
Stored in directory: /root/.cache/pip/wheels/73/28/28/f5bd85c7c59ba22b2d416a001df252f2b7300c5b4e04387f25  
Successfully built pylast  
Installing collected packages: pylast  
Successfully installed pylast-1.8.0

But I have exactly the same output if I run beet -v lastgenre

Is there any way I can check what version is actually running?

---

<div class="post-metadata">

**Author:** ![Squiggley](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/squiggley/32/16_2.png) [@Squiggley](https://discourse.beets.io/u/Squiggley)\
**Post date:** [March 25, 2017, 4:59pm UTC](https://discourse.beets.io/t/python-ssl-issues-with-lastgenre/49/4 "2017-03-25T16:59:23Z")

</div>

Actually just checking it the line number is now different so I guess its using 3.6  
lastgenre: [last.fm](http://last.fm) error: NetworkError: [SSL: CERTIFICATE\_VERIFY\_FAILED] unknown error (\_ssl.c:749)  
lastgenre: [last.fm](http://last.fm) error: NetworkError: [SSL: CERTIFICATE\_VERIFY\_FAILED] unknown error (\_ssl.c:749)

Any ideas?

---

<div class="post-metadata">

**Author:** ![adrian](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/adrian/32/4_2.png) [@adrian](https://discourse.beets.io/u/adrian)\
**Post date:** [March 26, 2017, 8:30pm UTC](https://discourse.beets.io/t/python-ssl-issues-with-lastgenre/49/5 "2017-03-26T20:30:23Z")

</div>

Huh! That’s very strange. My best guess at this point is that your system didn’t come with a full battery of SSL certificates, or they’re not installed properly. This comment on another project’s similar issue with the Synology OS: [https://github.com/SynoCommunity/spksrc/issues/1575#issuecomment-84695701](https://github.com/SynoCommunity/spksrc/issues/1575#issuecomment-84695701)

seems to indicate it might be possibly by linking the certificates into the right place. Maybe try that, or a little more googling about certificates on Synology in general?

---

<div class="post-metadata">

**Author:** ![Squiggley](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/squiggley/32/16_2.png) [@Squiggley](https://discourse.beets.io/u/Squiggley)\
**Post date:** [March 28, 2017, 8:23pm UTC](https://discourse.beets.io/t/python-ssl-issues-with-lastgenre/49/6 "2017-03-28T20:23:20Z")

</div>

Thanks sooooooo much for your help and pointing me in the right directions  
After much googling and not finding much at all I began messing about and seeing what I could find.

Some trial and error and I came across this which worked just grand!  
opkg install ca-certificates

just in case anyone else has this issue

---

<div class="post-metadata">

**Author:** ![adrian](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/adrian/32/4_2.png) [@adrian](https://discourse.beets.io/u/adrian)\
**Post date:** [March 28, 2017, 10:06pm UTC](https://discourse.beets.io/t/python-ssl-issues-with-lastgenre/49/7 "2017-03-28T22:06:59Z")

</div>

Nice! Good to know it was just missing certificates.
