rish-16 / gpt2client

āœšŸ» gpt2-client: Easy-to-use TensorFlow Wrapper for GPT-2 117M, 345M, 774M, and 1.5B Transformer Models šŸ¤– šŸ“
MIT License
372 stars 74 forks source link

Error when trying to install #4

Closed deviousname closed 4 years ago

deviousname commented 5 years ago

Collecting gpt2-client Using cached https://files.pythonhosted.org/packages/e5/b6/ebad2de6f982d155e088c4493db83fc174df22a9b8be686518191e13dfda/gpt2_client-1.9.7.tar.gz ERROR: Command errored out with exit status 1: command: 'C:\Users\xxx\AppData\Local\Programs\Python\Python36\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\xxx\AppData\Local\Temp\pip-install-7q2_3hj1\gpt2-client\setup.py'"'"'; file='"'"'C:\Users\xxx\AppData\Local\Temp\pip-install-7q2_3hj1\gpt2-client\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info cwd: C:\Users\xxx\AppData\Local\Temp\pip-install-7q2_3hj1\gpt2-client\ Complete output (7 lines): Traceback (most recent call last): File "", line 1, in File "C:\Users\xxx\AppData\Local\Temp\pip-install-7q2_3hj1\gpt2-client\setup.py", line 7, in long_description = f.read() File "C:\Users\xxx\AppData\Local\Programs\Python\Python36\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 38: character maps to

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

rish-16 commented 5 years ago

Hey there, thanks for pointing this bug out. You can try installing it this way:

python3 -m pip install --upgrade --force-reinstall numpy gpt2-client

Usually, it's a numpy problem. If this still does not answer your query, would you mind sharing your OS and details about your system?

Thanks!

basicx91 commented 5 years ago

I received the same error, but was able to get it to work by removing the following lines from setup.py:

this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.md')) as f:
    long_description = f.read()

I'm very inexperienced with python and programming languages in general so I'm not sure what caused the error specifically, but I was able to get it to install correctly by removing those lines. Hope it helps

druidOfCode commented 4 years ago

Yup, I'm having the same problem here. It seems there's a character in the Readme.md thats at fault. Issue was solved for me by reverting to 1.9.2 (Only thought downgrading might fix it since it installed just fine awhile back on another machine of mine).

pip install gpt2_client -U
  Downloading https://files.pythonhosted.org/packages/e5/b6/ebad2de6f982d155e088c4493db83fc174df22a9b8be686518191e13dfda/gpt2_client-1.9.7.tar.gz
    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\user\Miniconda3\envs\tf_gpu\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-6x0sqf6c\\gpt2-client\\setup.py'"'"'; __file__='"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-6x0sqf6c\\gpt2-client\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
         cwd: C:\Users\user\AppData\Local\Temp\pip-install-6x0sqf6c\gpt2-client\
    Complete output (7 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\user\AppData\Local\Temp\pip-install-6x0sqf6c\gpt2-client\setup.py", line 7, in <module>
        long_description = f.read()
      File "C:\Users\user\Miniconda3\envs\tf_gpu\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 38: character maps to <undefined>
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
jochemstoel commented 4 years ago

I want to confirm this. The emojis on the first line of eadme.md are causing the installer to crash, remove the two emojis and it works like a charm.

rish-16 commented 4 years ago

Hey everyone, I'm removing the emojis in the next update. Do stay tuned!