xl0 / lovely-tensors

Tensors, ready for human consumption

Home Page:https://xl0.github.io/lovely-tensors

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

❤️ Emoji breaks pip install

JohannesStutz opened this issue · comments

I've cloned the latest version of lovely-tensors from Github and tried to pip install -e . it. It failed with the following error:

C:/.../lovely-tensors> pip install -e .
Obtaining file:///C:/.../lovely-tensors
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [12 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\...\lovely-tensors\setup.py", line 8, in <module>
          config.read('settings.ini')
        File "C:\...\miniconda3\envs\nbdev\lib\configparser.py", line 697, in read
          self._read(fp, filename)
        File "C:\...\miniconda3\envs\nbdev\lib\configparser.py", line 1020, in _read
          for lineno, line in enumerate(fp, start=1):
        File "C:\...\miniconda3\envs\nbdev\lib\encodings\cp1252.py", line 23, in decode
          return codecs.charmap_decode(input,self.errors,decoding_table)[0]
      UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 770: character maps to <undefined>
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

After a bit trial and error, I've found the culprit: it is the ❤️ emoji in line 33 of settings.ini as well as line 1 of README.md. When I delete those, the installation runs fine. I cannot run WSL on this particular machine, so I haven't tested yet whether that's a problem just on Windows 🤔

  • Windows 10
  • Python 3.9.15
  • pip 22.2.2

Thank you. I think it's a bug in my setup.py - when opening README, we need to pass encoding="utf-8". I fixed it in my last commit to lovely-numpy. Would you like to send a PR for LT? Or I will fix it later today.

Looks like you need to pass it to config.read('settings.ini')as well.

Ah, good to know. I won’t have time today, so go ahead and fix it for lt as well, thank you 😊

@JohannesStutz, I pushed the changes. Don't have a windows setup handy, could you please confirm that it works for you?

@JohannesStutz, I'm closing it; please let me know if it still does not work for you.