PyCharacterAI
PyCharacterAI copied to clipboard
installation Issue on Windows OS
after running the specified installation command for PIP,
pip install PyCharacterAI
it gave me this error:
Collecting PyCharacterAI
Using cached PyCharacterAI-1.1.0.tar.gz (11 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [24 lines of output]
Traceback (most recent call last):
File "d:\Python Projects\JokeInsta\.venv\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
main()
File "d:\Python Projects\JokeInsta\.venv\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "d:\Python Projects\JokeInsta\.venv\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
return hook(config_settings)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\aritr\AppData\Local\Temp\pip-build-env-484h3e5m\overlay\Lib\site-packages\setuptools\build_meta.py", line 327, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=[])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\aritr\AppData\Local\Temp\pip-build-env-484h3e5m\overlay\Lib\site-packages\setuptools\build_meta.py", line 297, in _get_build_requires
self.run_setup()
File "C:\Users\aritr\AppData\Local\Temp\pip-build-env-484h3e5m\overlay\Lib\site-packages\setuptools\build_meta.py", line 497, in run_setup
super().run_setup(setup_script=setup_script)
File "C:\Users\aritr\AppData\Local\Temp\pip-build-env-484h3e5m\overlay\Lib\site-packages\setuptools\build_meta.py", line 313, in run_setup
exec(code, locals())
File "<string>", line 15, in <module>
File "<string>", line 6, in readme
File "C:\Users\aritr\AppData\Local\Programs\Python\Python311\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 0x8f in position 1636: character maps to <undefined>
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
A workaround solution.
I cloned the repo locally and then modified the setup.py file.
idk specifically what was causing the error, but my speculation is the readme() function in that file.
here the modified code,
from setuptools import setup, find_packages
def readme(): # <- idk what is causing this issue in this function, so i avoided using it.
with open('README.txt', 'r') as f:
return f.read()
setup(
name='PyCharacterAI',
version='1.1.0',
author='XtraF',
author_email='[email protected]',
description='An unofficial asynchronous api wrapper for Character AI.',
long_description='An unofficial asynchronous api wrapper for Character AI.', # <- replace the function call with any kind of string you want
long_description_content_type='text/markdown',
url='https://github.com/Xtr4F/PyCharacterAI',
packages=find_packages(),
install_requires=['uuid>=1.30',
'curl-cffi==0.5.9'],
classifiers=[
'Programming Language :: Python :: 3.10',
'License :: OSI Approved :: MIT License'
],
python_requires='>=3.7'
)