google / dopamine

Dopamine is a research framework for fast prototyping of reinforcement learning algorithms.
https://github.com/google/dopamine
Apache License 2.0
10.42k stars 1.36k forks source link

“python_requires” should be set with “>=3.5”, as dopamine-rl 4.0.2 is not compatible with all Python versions. #191

Closed PyVCEchecker closed 2 years ago

PyVCEchecker commented 2 years ago

Currently, the keyword argument python_requires of setup() is not set, and thus it is assumed that this distribution is compatible with all Python versions. However, I found it is not compatible with Python2. My local Python version is 2.7, and I encounter the following error when executing “pip install dopamine-rl”

Collecting dopamine-rl
  Downloading dopamine_rl-4.0.2.tar.gz (110 kB)
     |████████████████████████████████| 110 kB 85 kB/s 
    ERROR: Command errored out with exit status 1:
     command: /usr/local/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-l4lzhe/dopamine-rl/setup.py'"'"'; __file__='"'"'/tmp/pip-install-l4lzhe/dopamine-rl/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 /tmp/pip-install-l4lzhe/dopamine-rl/pip-egg-info
         cwd: /tmp/pip-install-l4lzhe/dopamine-rl/
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-l4lzhe/dopamine-rl/setup.py", line 22, in <module>
        import pathlib
    ImportError: No module named pathlib
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

I noticed that setup.py imported the module pathlib. pathlib only exists in Python 3.5 and above, resulting in installation failure of dopamine-rl in Python2.

Way to fix: modify setup() in setup.py, add python_requires keyword argument:

setup(…
     python_requires='>=3.5'
     …)

Thanks for your attention. Best regrads, PyVCEchecker

psc-g commented 2 years ago

thank you for bringing this to our attention! this has been fixed here: https://github.com/google/dopamine/commit/e87f2e020205400dbb10bf7cbd1672547a1488e0