danijar / crafter

Benchmarking the Spectrum of Agent Capabilities

Home Page:https://danijar.com/crafter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot install crafter

geoleva opened this issue · comments

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 "", line 2, in
File "", line 34, in
File "~AppData\Local\Temp\pip-install-qn4q8ono\crafter_8c8a23be6c8f433b9c43fe2ca828a022\setup.py", line 10, in
long_description=pathlib.Path('README.md').read_text(),
File "~AppData\Local\Programs\Python\Python39\lib\pathlib.py", line 1267, in read_text
return f.read()
File "~AppData\Local\Programs\Python\Python39\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 6432: character maps to
[end of output]

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',
    ],
)