{
  "id": 361477,
  "title": "Solution for the UnicodeDecodeError when installing Ptemcee (from PyFstat) (Windows users)",
  "url": "/competitions/g2net-detecting-continuous-gravitational-waves/discussion/361477",
  "author_name": "Zollkron",
  "post_date": "2022-10-21T20:56:32.807000",
  "votes": 8,
  "comment_count": 2,
  "views": 0,
  "content": "<p>Hi, I got this error today, when I was trying to install PyFstat on my machine, and I found a solution for this problem. So I thought it might be useful to share it, in case there are other Windows users like me with the same problem.<br>\n<br><br>\nThe error description is like follows:</p>\n<pre><code>Traceback (most recent call last):\n     File \"&lt;string&gt;\", line 1, in &lt;module&gt;\n     File \"%AppData%\\Local\\Temp\\pip-install-pki4arlw\\ptemcee_b54639b99e924750987bf94d4595be99\\setup.py\", line 39, in &lt;module&gt;\n       long_description=read('README.rst'),\n     File \"%AppData%\\Local\\Temp\\pip-install-pki4arlw\\ptemcee_b54639b99e924750987bf94d4595be99\\setup.py\", line 20, in read\n       return f.read()\n     File \"%Anaconda%\\lib\\encodings\\cp1252.py\", line 23, in decode\n       return codecs.charmap_decode(input,self.errors,decoding_table)[0]\n   UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position 449: character maps to &lt;undefined&gt;\nWARNING: Discarding https://files.pythonhosted.org/packages/81/1d/2b3f09f0eb3ce8530e59b03e1aab4bc260cc14ddbc7dad761f9107d944e6/ptemcee-1.0.0.tar.gz#sha256=58e7c1d9a477acd808668b5caa5cb4d61fc5f6cd1df02a391d0d04cd14453739 (from https://pypi.org/simple/ptemcee/). \nCommand errored out with exit status 1: python setup.py egg_info Check the logs for full command output.\nERROR: Could not find a version that satisfies the requirement ptemcee (from pyfstat)\nERROR: No matching distribution found for ptemcee\n</code></pre>\n<p>Well, the solution I found is download the <strong>ptemcee-1.0.0.tar.gz</strong> file from the url above, extract its content, and edit the <strong>setup.py</strong> file like follows:</p>\n<pre><code>Where:\n\n# Use UTF-8 if Python 3.\nmajor, minor1, minor2, release, serial = sys.version_info\ndef read(filename):\n   kwargs = {'encoding': 'utf-8'} if major &gt; 3 else {}\n   with open(filename, **kwargs) as f:\n       return f.read()\n\nChange for that:\n\n# Use UTF-8 if Python 3.\nmajor, minor1, minor2, release, serial = sys.version_info\ndef read(filename):\n   kwargs = {'encoding': 'utf-8'} if major &gt;= 3 else {}\n   with open(filename, **kwargs) as f:\n       return f.read()\n</code></pre>\n<p>So, if you are using Python 3, really force to use the utf-8 encoding. Then, save the changes in setup.py file and compress the entire ptemcee-1.0.0 folder again using:<br>\n<br><br>\n<code>tar -czf ptemcee.tar.gz ptemcee-1.0.0</code><br>\n<br><br>\nPut the new ptemcee-1.0.0.tar.gz in your working directory and execute the next command:<br>\n<br><br>\n<code>pip install ptemcee.tar.gz</code><br>\n<br><br>\nIf you see something like that then it's working well:</p>\n<pre><code>Processing .\\working\\ptemcee.tar.gz\nRequirement already satisfied: numpy in %anaconda%\\lib\\site-packages (from ptemcee==1.0.0) (1.20.1)\nBuilding wheels for collected packages: ptemcee\n Building wheel for ptemcee (setup.py): started\n Building wheel for ptemcee (setup.py): finished with status 'done'\n Created wheel for ptemcee: filename=ptemcee-1.0.0-py3-none-any.whl size=18550 sha256=cc77a5f2f2981e574e666e38c9d6a291eb685f5983498124e9ffc141c9b81705\n Stored in directory: %AppData%\\Local\\Temp\\pip-ephem-wheel-cache-l6mmtmdp\\wheels\\67\\70\\7e\\156459d8552201484191c0d975a4d0fe625b844dacdf61e52b\nSuccessfully built ptemcee\nInstalling collected packages: ptemcee\nSuccessfully installed ptemcee-1.0.0\n</code></pre>\n<p>I hope this help. Thanks :)<br>\n<br><br>\n<strong>EDIT:</strong></p>\n<p><strong>Sorry, but actually It looks that there is no version of Lalsuite working for Windows. So It's useless install Ptemcee before :(</strong></p>",
  "messages": [
    {
      "id": 1998791,
      "postDate": "2022-10-21T20:56:32.807Z",
      "content": "<p>Hi, I got this error today, when I was trying to install PyFstat on my machine, and I found a solution for this problem. So I thought it might be useful to share it, in case there are other Windows users like me with the same problem.<br>\n<br><br>\nThe error description is like follows:</p>\n<pre><code>Traceback (most recent call last):\n     File \"&lt;string&gt;\", line 1, in &lt;module&gt;\n     File \"%AppData%\\Local\\Temp\\pip-install-pki4arlw\\ptemcee_b54639b99e924750987bf94d4595be99\\setup.py\", line 39, in &lt;module&gt;\n       long_description=read('README.rst'),\n     File \"%AppData%\\Local\\Temp\\pip-install-pki4arlw\\ptemcee_b54639b99e924750987bf94d4595be99\\setup.py\", line 20, in read\n       return f.read()\n     File \"%Anaconda%\\lib\\encodings\\cp1252.py\", line 23, in decode\n       return codecs.charmap_decode(input,self.errors,decoding_table)[0]\n   UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position 449: character maps to &lt;undefined&gt;\nWARNING: Discarding https://files.pythonhosted.org/packages/81/1d/2b3f09f0eb3ce8530e59b03e1aab4bc260cc14ddbc7dad761f9107d944e6/ptemcee-1.0.0.tar.gz#sha256=58e7c1d9a477acd808668b5caa5cb4d61fc5f6cd1df02a391d0d04cd14453739 (from https://pypi.org/simple/ptemcee/). \nCommand errored out with exit status 1: python setup.py egg_info Check the logs for full command output.\nERROR: Could not find a version that satisfies the requirement ptemcee (from pyfstat)\nERROR: No matching distribution found for ptemcee\n</code></pre>\n<p>Well, the solution I found is download the <strong>ptemcee-1.0.0.tar.gz</strong> file from the url above, extract its content, and edit the <strong>setup.py</strong> file like follows:</p>\n<pre><code>Where:\n\n# Use UTF-8 if Python 3.\nmajor, minor1, minor2, release, serial = sys.version_info\ndef read(filename):\n   kwargs = {'encoding': 'utf-8'} if major &gt; 3 else {}\n   with open(filename, **kwargs) as f:\n       return f.read()\n\nChange for that:\n\n# Use UTF-8 if Python 3.\nmajor, minor1, minor2, release, serial = sys.version_info\ndef read(filename):\n   kwargs = {'encoding': 'utf-8'} if major &gt;= 3 else {}\n   with open(filename, **kwargs) as f:\n       return f.read()\n</code></pre>\n<p>So, if you are using Python 3, really force to use the utf-8 encoding. Then, save the changes in setup.py file and compress the entire ptemcee-1.0.0 folder again using:<br>\n<br><br>\n<code>tar -czf ptemcee.tar.gz ptemcee-1.0.0</code><br>\n<br><br>\nPut the new ptemcee-1.0.0.tar.gz in your working directory and execute the next command:<br>\n<br><br>\n<code>pip install ptemcee.tar.gz</code><br>\n<br><br>\nIf you see something like that then it's working well:</p>\n<pre><code>Processing .\\working\\ptemcee.tar.gz\nRequirement already satisfied: numpy in %anaconda%\\lib\\site-packages (from ptemcee==1.0.0) (1.20.1)\nBuilding wheels for collected packages: ptemcee\n Building wheel for ptemcee (setup.py): started\n Building wheel for ptemcee (setup.py): finished with status 'done'\n Created wheel for ptemcee: filename=ptemcee-1.0.0-py3-none-any.whl size=18550 sha256=cc77a5f2f2981e574e666e38c9d6a291eb685f5983498124e9ffc141c9b81705\n Stored in directory: %AppData%\\Local\\Temp\\pip-ephem-wheel-cache-l6mmtmdp\\wheels\\67\\70\\7e\\156459d8552201484191c0d975a4d0fe625b844dacdf61e52b\nSuccessfully built ptemcee\nInstalling collected packages: ptemcee\nSuccessfully installed ptemcee-1.0.0\n</code></pre>\n<p>I hope this help. Thanks :)<br>\n<br><br>\n<strong>EDIT:</strong></p>\n<p><strong>Sorry, but actually It looks that there is no version of Lalsuite working for Windows. So It's useless install Ptemcee before :(</strong></p>",
      "rawMarkdown": "\nHi, I got this error today, when I was trying to install PyFstat on my machine, and I found a solution for this problem. So I thought it might be useful to share it, in case there are other Windows users like me with the same problem.\n<br>\nThe error description is like follows:\n\n```\nTraceback (most recent call last):\n      File \"<string>\", line 1, in <module>\n      File \"%AppData%\\Local\\Temp\\pip-install-pki4arlw\\ptemcee_b54639b99e924750987bf94d4595be99\\setup.py\", line 39, in <module>\n        long_description=read('README.rst'),\n      File \"%AppData%\\Local\\Temp\\pip-install-pki4arlw\\ptemcee_b54639b99e924750987bf94d4595be99\\setup.py\", line 20, in read\n        return f.read()\n      File \"%Anaconda%\\lib\\encodings\\cp1252.py\", line 23, in decode\n        return codecs.charmap_decode(input,self.errors,decoding_table)[0]\n    UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position 449: character maps to <undefined>\n\nWARNING: Discarding https://files.pythonhosted.org/packages/81/1d/2b3f09f0eb3ce8530e59b03e1aab4bc260cc14ddbc7dad761f9107d944e6/ptemcee-1.0.0.tar.gz#sha256=58e7c1d9a477acd808668b5caa5cb4d61fc5f6cd1df02a391d0d04cd14453739 (from https://pypi.org/simple/ptemcee/). \nCommand errored out with exit status 1: python setup.py egg_info Check the logs for full command output.\nERROR: Could not find a version that satisfies the requirement ptemcee (from pyfstat)\nERROR: No matching distribution found for ptemcee\n```\n\n\nWell, the solution I found is download the **ptemcee-1.0.0.tar.gz** file from the url above, extract its content, and edit the **setup.py** file like follows:\n\n\n```\nWhere:\n \n# Use UTF-8 if Python 3.\nmajor, minor1, minor2, release, serial = sys.version_info\ndef read(filename):\n    kwargs = {'encoding': 'utf-8'} if major > 3 else {}\n    with open(filename, **kwargs) as f:\n        return f.read()\n \nChange for that:\n \n# Use UTF-8 if Python 3.\nmajor, minor1, minor2, release, serial = sys.version_info\ndef read(filename):\n    kwargs = {'encoding': 'utf-8'} if major >= 3 else {}\n    with open(filename, **kwargs) as f:\n        return f.read()\n```\n\nSo, if you are using Python 3, really force to use the utf-8 encoding. Then, save the changes in setup.py file and compress the entire ptemcee-1.0.0 folder again using:\n<br>\n`tar -czf ptemcee.tar.gz ptemcee-1.0.0`\n<br>\nPut the new ptemcee-1.0.0.tar.gz in your working directory and execute the next command:\n<br>\n`pip install ptemcee.tar.gz`\n<br>\nIf you see something like that then it's working well:\n\n```\nProcessing .\\working\\ptemcee.tar.gz\nRequirement already satisfied: numpy in %anaconda%\\lib\\site-packages (from ptemcee==1.0.0) (1.20.1)\nBuilding wheels for collected packages: ptemcee\n  Building wheel for ptemcee (setup.py): started\n  Building wheel for ptemcee (setup.py): finished with status 'done'\n  Created wheel for ptemcee: filename=ptemcee-1.0.0-py3-none-any.whl size=18550 sha256=cc77a5f2f2981e574e666e38c9d6a291eb685f5983498124e9ffc141c9b81705\n  Stored in directory: %AppData%\\Local\\Temp\\pip-ephem-wheel-cache-l6mmtmdp\\wheels\\67\\70\\7e\\156459d8552201484191c0d975a4d0fe625b844dacdf61e52b\nSuccessfully built ptemcee\nInstalling collected packages: ptemcee\nSuccessfully installed ptemcee-1.0.0\n```\n\n\nI hope this help. Thanks :)\n\n<br>\n\n**EDIT:**\n \n**Sorry, but actually It looks that there is no version of Lalsuite working for Windows. So It's useless install Ptemcee before :(**",
      "votes": 8
    },
    {
      "id": 2001698,
      "postDate": "2022-10-24T08:47:04.227Z",
      "content": "<p>Hi <a href=\"https://www.kaggle.com/zollkron\" target=\"_blank\">@zollkron</a> ,</p>\n<p>It's a pity you had to discover this the long way, sorry about that. <br>\nAs you mentioned, there is no LALSuite release working for windows at the moment.</p>\n<p>To my understanding, the quickest and simplest solution is to use a Kaggle kernel.</p>\n<p>Cheers,</p>",
      "rawMarkdown": "Hi @zollkron ,\n\nIt's a pity you had to discover this the long way, sorry about that. \nAs you mentioned, there is no LALSuite release working for windows at the moment.\n\nTo my understanding, the quickest and simplest solution is to use a Kaggle kernel.\n\nCheers,",
      "votes": 1,
      "replies": [
        {
          "id": 2002273,
          "postDate": "2022-10-24T16:49:16.423Z",
          "content": "<p>Thanks for your answer, Rodrigo, and for organizing this entertaining challenge :)</p>\n<p>Don't worry about it, it's fine. I had a laptop with a Lubuntu distribution and could get by with that. It is working well.</p>\n<p>It's amazing how fascinating our multiverse can be. Thank you for giving us the opportunity to contribute to science.</p>\n<p>Cheers :)</p>",
          "rawMarkdown": "Thanks for your answer, Rodrigo, and for organizing this entertaining challenge :)\n\nDon't worry about it, it's fine. I had a laptop with a Lubuntu distribution and could get by with that. It is working well.\n\nIt's amazing how fascinating our multiverse can be. Thank you for giving us the opportunity to contribute to science.\n\nCheers :)",
          "votes": 1
        }
      ]
    }
  ],
  "comments": [
    {
      "id": 2001698,
      "author_name": "Rodrigo Tenorio",
      "author_url": "",
      "post_date": "2022-10-24T08:47:04.227000",
      "content": "<p>Hi <a href=\"https://www.kaggle.com/zollkron\" target=\"_blank\">@zollkron</a> ,</p>\n<p>It's a pity you had to discover this the long way, sorry about that. <br>\nAs you mentioned, there is no LALSuite release working for windows at the moment.</p>\n<p>To my understanding, the quickest and simplest solution is to use a Kaggle kernel.</p>\n<p>Cheers,</p>",
      "votes": 1,
      "replies": [
        {
          "id": 2002273,
          "author_name": "Zollkron",
          "author_url": "",
          "post_date": "2022-10-24T16:49:16.423000",
          "content": "<p>Thanks for your answer, Rodrigo, and for organizing this entertaining challenge :)</p>\n<p>Don't worry about it, it's fine. I had a laptop with a Lubuntu distribution and could get by with that. It is working well.</p>\n<p>It's amazing how fascinating our multiverse can be. Thank you for giving us the opportunity to contribute to science.</p>\n<p>Cheers :)</p>",
          "votes": 1,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "1998791": "\nHi, I got this error today, when I was trying to install PyFstat on my machine, and I found a solution for this problem. So I thought it might be useful to share it, in case there are other Windows users like me with the same problem.\n<br>\nThe error description is like follows:\n\n```\nTraceback (most recent call last):\n      File \"<string>\", line 1, in <module>\n      File \"%AppData%\\Local\\Temp\\pip-install-pki4arlw\\ptemcee_b54639b99e924750987bf94d4595be99\\setup.py\", line 39, in <module>\n        long_description=read('README.rst'),\n      File \"%AppData%\\Local\\Temp\\pip-install-pki4arlw\\ptemcee_b54639b99e924750987bf94d4595be99\\setup.py\", line 20, in read\n        return f.read()\n      File \"%Anaconda%\\lib\\encodings\\cp1252.py\", line 23, in decode\n        return codecs.charmap_decode(input,self.errors,decoding_table)[0]\n    UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position 449: character maps to <undefined>\n\nWARNING: Discarding https://files.pythonhosted.org/packages/81/1d/2b3f09f0eb3ce8530e59b03e1aab4bc260cc14ddbc7dad761f9107d944e6/ptemcee-1.0.0.tar.gz#sha256=58e7c1d9a477acd808668b5caa5cb4d61fc5f6cd1df02a391d0d04cd14453739 (from https://pypi.org/simple/ptemcee/). \nCommand errored out with exit status 1: python setup.py egg_info Check the logs for full command output.\nERROR: Could not find a version that satisfies the requirement ptemcee (from pyfstat)\nERROR: No matching distribution found for ptemcee\n```\n\n\nWell, the solution I found is download the **ptemcee-1.0.0.tar.gz** file from the url above, extract its content, and edit the **setup.py** file like follows:\n\n\n```\nWhere:\n \n# Use UTF-8 if Python 3.\nmajor, minor1, minor2, release, serial = sys.version_info\ndef read(filename):\n    kwargs = {'encoding': 'utf-8'} if major > 3 else {}\n    with open(filename, **kwargs) as f:\n        return f.read()\n \nChange for that:\n \n# Use UTF-8 if Python 3.\nmajor, minor1, minor2, release, serial = sys.version_info\ndef read(filename):\n    kwargs = {'encoding': 'utf-8'} if major >= 3 else {}\n    with open(filename, **kwargs) as f:\n        return f.read()\n```\n\nSo, if you are using Python 3, really force to use the utf-8 encoding. Then, save the changes in setup.py file and compress the entire ptemcee-1.0.0 folder again using:\n<br>\n`tar -czf ptemcee.tar.gz ptemcee-1.0.0`\n<br>\nPut the new ptemcee-1.0.0.tar.gz in your working directory and execute the next command:\n<br>\n`pip install ptemcee.tar.gz`\n<br>\nIf you see something like that then it's working well:\n\n```\nProcessing .\\working\\ptemcee.tar.gz\nRequirement already satisfied: numpy in %anaconda%\\lib\\site-packages (from ptemcee==1.0.0) (1.20.1)\nBuilding wheels for collected packages: ptemcee\n  Building wheel for ptemcee (setup.py): started\n  Building wheel for ptemcee (setup.py): finished with status 'done'\n  Created wheel for ptemcee: filename=ptemcee-1.0.0-py3-none-any.whl size=18550 sha256=cc77a5f2f2981e574e666e38c9d6a291eb685f5983498124e9ffc141c9b81705\n  Stored in directory: %AppData%\\Local\\Temp\\pip-ephem-wheel-cache-l6mmtmdp\\wheels\\67\\70\\7e\\156459d8552201484191c0d975a4d0fe625b844dacdf61e52b\nSuccessfully built ptemcee\nInstalling collected packages: ptemcee\nSuccessfully installed ptemcee-1.0.0\n```\n\n\nI hope this help. Thanks :)\n\n<br>\n\n**EDIT:**\n \n**Sorry, but actually It looks that there is no version of Lalsuite working for Windows. So It's useless install Ptemcee before :(**",
    "2001698": "Hi @zollkron ,\n\nIt's a pity you had to discover this the long way, sorry about that. \nAs you mentioned, there is no LALSuite release working for windows at the moment.\n\nTo my understanding, the quickest and simplest solution is to use a Kaggle kernel.\n\nCheers,"
  }
}