{
  "id": 167792,
  "title": "Workaround for librosa not working",
  "url": "/competitions/birdsong-recognition/discussion/167792",
  "author_name": "Georgii Vyshnia",
  "post_date": "2020-07-17T20:20:38.851000",
  "votes": 5,
  "comment_count": 4,
  "views": 0,
  "content": "<p>hi guys,</p>\n\n<p>As this competion is highly relied on the audio analysis/feature extraction using <em>librosa</em> package, some of you might face the issues with running librosa on your local computer. It happened to me indeed, and I had to take some steps to work it around.</p>\n\n<p>I am sharing it since  someone else could use this workaround, too. So back to the problem.</p>\n\n<p><strong>Problem report:</strong> whenever I put <strong>import librosa</strong> in my code, the runtime error fired as follows</p>\n\n<p><strong>AttributeError: module 'numba.core.types' has no attribute 'Const'</strong></p>\n\n<p>It happened under Python 3.7 and Anaconda, on my local computer.</p>\n\n<p>The root cause of the problem is related to the bug in librosa per <a href=\"https://github.com/librosa/librosa/issues/1160\">https://github.com/librosa/librosa/issues/1160</a> , under condition of your Python environment having numba version 0.49 or higher.</p>\n\n<p>The appropriate fix was to downgrade numba to version 0.48 with the command below</p>\n\n<p><code>pip install numba==0.48</code></p>\n\n<p>After the numba downgrade, it started working like a charm.</p>\n\n<p>I hope it could be helpful.</p>",
  "messages": [
    {
      "id": 933607,
      "postDate": "2020-07-17T20:20:38.853Z",
      "content": "<p>hi guys,</p>\n\n<p>As this competion is highly relied on the audio analysis/feature extraction using <em>librosa</em> package, some of you might face the issues with running librosa on your local computer. It happened to me indeed, and I had to take some steps to work it around.</p>\n\n<p>I am sharing it since  someone else could use this workaround, too. So back to the problem.</p>\n\n<p><strong>Problem report:</strong> whenever I put <strong>import librosa</strong> in my code, the runtime error fired as follows</p>\n\n<p><strong>AttributeError: module 'numba.core.types' has no attribute 'Const'</strong></p>\n\n<p>It happened under Python 3.7 and Anaconda, on my local computer.</p>\n\n<p>The root cause of the problem is related to the bug in librosa per <a href=\"https://github.com/librosa/librosa/issues/1160\">https://github.com/librosa/librosa/issues/1160</a> , under condition of your Python environment having numba version 0.49 or higher.</p>\n\n<p>The appropriate fix was to downgrade numba to version 0.48 with the command below</p>\n\n<p><code>pip install numba==0.48</code></p>\n\n<p>After the numba downgrade, it started working like a charm.</p>\n\n<p>I hope it could be helpful.</p>",
      "rawMarkdown": "hi guys,\n\nAs this competion is highly relied on the audio analysis/feature extraction using *librosa* package, some of you might face the issues with running librosa on your local computer. It happened to me indeed, and I had to take some steps to work it around.\n\nI am sharing it since  someone else could use this workaround, too. So back to the problem.\n\n**Problem report:** whenever I put **import librosa** in my code, the runtime error fired as follows\n\n**AttributeError: module 'numba.core.types' has no attribute 'Const'**\n\nIt happened under Python 3.7 and Anaconda, on my local computer.\n\nThe root cause of the problem is related to the bug in librosa per https://github.com/librosa/librosa/issues/1160 , under condition of your Python environment having numba version 0.49 or higher.\n\nThe appropriate fix was to downgrade numba to version 0.48 with the command below\n\n`pip install numba==0.48`\n\nAfter the numba downgrade, it started working like a charm.\n\nI hope it could be helpful.",
      "votes": 5
    },
    {
      "id": 938162,
      "postDate": "2020-07-21T11:30:08.763Z",
      "content": "<p>I solved the problem installing the developer version (0.8.0-dev):</p>\n<pre><code>!pip install git+https://github.com/librosa/librosa\nlibrosa.__version__\n   '0.8.0-dev'\n</code></pre>",
      "rawMarkdown": "I solved the problem installing the developer version (0.8.0-dev):\n\n```\n!pip install git+https://github.com/librosa/librosa\nlibrosa.__version__\n   '0.8.0-dev'\n```",
      "votes": 1,
      "replies": [
        {
          "id": 938323,
          "postDate": "2020-07-21T13:05:49.670Z",
          "content": "<p><a href=\"/jpison\">@jpison</a> : thanks for sharing a good alternative solution!</p>",
          "rawMarkdown": "@jpison : thanks for sharing a good alternative solution!"
        }
      ]
    },
    {
      "id": 1183347,
      "postDate": "2021-02-02T23:06:41.857Z",
      "rawMarkdown": "",
      "isDeleted": true
    },
    {
      "id": 937689,
      "postDate": "2020-07-21T05:59:24.737Z",
      "rawMarkdown": "",
      "isDeleted": true
    }
  ],
  "comments": [
    {
      "id": 938162,
      "author_name": "F.J.Martinez-de-Pison",
      "author_url": "",
      "post_date": "2020-07-21T11:30:08.763000",
      "content": "<p>I solved the problem installing the developer version (0.8.0-dev):</p>\n<pre><code>!pip install git+https://github.com/librosa/librosa\nlibrosa.__version__\n   '0.8.0-dev'\n</code></pre>",
      "votes": 1,
      "replies": [
        {
          "id": 938323,
          "author_name": "Georgii Vyshnia",
          "author_url": "",
          "post_date": "2020-07-21T13:05:49.670000",
          "content": "<p><a href=\"/jpison\">@jpison</a> : thanks for sharing a good alternative solution!</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 1183347,
      "author_name": "",
      "author_url": "",
      "post_date": "2021-02-02T23:06:41.857000",
      "content": "",
      "votes": 0,
      "replies": []
    },
    {
      "id": 937689,
      "author_name": "",
      "author_url": "",
      "post_date": "2020-07-21T05:59:24.737000",
      "content": "",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "933607": "hi guys,\n\nAs this competion is highly relied on the audio analysis/feature extraction using *librosa* package, some of you might face the issues with running librosa on your local computer. It happened to me indeed, and I had to take some steps to work it around.\n\nI am sharing it since  someone else could use this workaround, too. So back to the problem.\n\n**Problem report:** whenever I put **import librosa** in my code, the runtime error fired as follows\n\n**AttributeError: module 'numba.core.types' has no attribute 'Const'**\n\nIt happened under Python 3.7 and Anaconda, on my local computer.\n\nThe root cause of the problem is related to the bug in librosa per https://github.com/librosa/librosa/issues/1160 , under condition of your Python environment having numba version 0.49 or higher.\n\nThe appropriate fix was to downgrade numba to version 0.48 with the command below\n\n`pip install numba==0.48`\n\nAfter the numba downgrade, it started working like a charm.\n\nI hope it could be helpful.",
    "938162": "I solved the problem installing the developer version (0.8.0-dev):\n\n```\n!pip install git+https://github.com/librosa/librosa\nlibrosa.__version__\n   '0.8.0-dev'\n```",
    "1183347": "",
    "937689": ""
  }
}