Cannot install crafter
I'm trying to get DREAMER v3 working, but can't get all dependencies to install. I'm using >> pip install crafter or with specific version 1.8.2, and getting the following error (I was able to install version 1.8.1, but then got the error in using yaml when trying to do load):
I am using pip (23.3.1), python (3.9), and setuptools (69.0.1). After >> pip install crafter, I get this error:
Collecting crafter==1.8.2 Using cached crafter-1.8.2.tar.gz (107 kB) Preparing metadata (setup.py) ... error error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [10 lines of output]
Traceback (most recent call last):
File "
note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed
same problem here. Unable to get it installed with pip. Only way is to install it manually or use it raw. Even then though it's unable to install crafter.
Could you try running pathlib.Path('README.md').read_text() from an interactive python interpreter in the repository root? Maybe pathlib does not fully support Windows?
Hi Danijar,
It indeed looks like that's the problem.
In the interactive python terminal I did the following:
import pathlib pathlib.Path('README.md').read_text()
I got the following output:
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Users\nickdv\AppData\Local\Programs\Python\Python311\Lib\pathlib.py", line 1058, in read_text with self.open(mode='r', encoding=encoding, errors=errors) as f: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\nickdv\AppData\Local\Programs\Python\Python311\Lib\pathlib.py", line 1044, in open return io.open(self, mode, buffering, encoding, errors, newline) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FileNotFoundError: [Errno 2] No such file or directory: 'README.md'
I have fixed the problem by using os instead of Pathlib:
import setuptools
import os
# Read the content of README.md
with open('README.md', 'r', encoding='utf-8') as file:
long_description = file.read()
setuptools.setup(
name='crafter',
version='1.8.3',
description='Open world survival game for reinforcement learning.',
url='http://github.com/danijar/crafter',
long_description=long_description,
long_description_content_type='text/markdown',
packages=['crafter'],
package_data={'crafter': ['data.yaml', 'assets/*']},
entry_points={'console_scripts': ['crafter=crafter.run_gui:main']},
install_requires=[
'numpy', 'imageio', 'pillow', 'opensimplex', 'ruamel.yaml',
],
extras_require={'gui': ['pygame']},
classifiers=[
'Intended Audience :: Science/Research',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3',
'Topic :: Games/Entertainment',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
],
)
I was able to solve this problem by setting an environment variable
PYTHONUTF8 = 1
After this change I was able to use
pip install crafter
I have fixed the problem by using os instead of Pathlib:
import setuptools import os # Read the content of README.md with open('README.md', 'r', encoding='utf-8') as file: long_description = file.read() setuptools.setup( name='crafter', version='1.8.3', description='Open world survival game for reinforcement learning.', url='http://github.com/danijar/crafter', long_description=long_description, long_description_content_type='text/markdown', packages=['crafter'], package_data={'crafter': ['data.yaml', 'assets/*']}, entry_points={'console_scripts': ['crafter=crafter.run_gui:main']}, install_requires=[ 'numpy', 'imageio', 'pillow', 'opensimplex', 'ruamel.yaml', ], extras_require={'gui': ['pygame']}, classifiers=[ 'Intended Audience :: Science/Research', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 3', 'Topic :: Games/Entertainment', 'Topic :: Scientific/Engineering :: Artificial Intelligence', ], )
Well, after you had managed to change the file setup.py, what did you do next?
The command pip install crafter still tries to install the file on github
Later, I succeeded by using pip install -e.