2

I am trying to include the ray into my own package. However, there are some dependencies needed for using ray that should be installed via pip install ray[all].

If I just add ray[all] into the install_requires of setup.py, like:

setup(
    ...
    install_requires=[
        ...
        "ray==1.0.0",
        "ray[all]==1.0.0",
    ]
)

Then running pip install -e . can not install the dependencies specified in ray[all]. However, I wish my user can install everything simply via running pip install -e ..

Can anyone provide a solution for this issue? Thanks!

  • perhaps [this](https://stackoverflow.com/questions/36490897/how-to-install-python-module-extras-with-pip-requirements-txt-file) answers your question. – Miguel Trejo Nov 22 '20 at 01:00
  • Just asking for information ..is `[all]` even an option? Also, wouldn't `requirements.txt` be better? – Abhishek Rai Nov 22 '20 at 04:25

1 Answers1

0

Try pip install -e .[all].

In general pip install -e .[extras] should work for all python packages that are packaged with setuptools.

Alex
  • 1,388
  • 1
  • 10
  • 19
  • 1
    `[]` are shell metacharacters. You'd probably have to put that part in quotes to protect them. Or is that the purpose of the leading `.`? – John Gordon Dec 02 '20 at 21:40
  • quotes might make sense: `pip install -e '.[all]'` – richliaw Dec 03 '20 at 19:21
  • The purpose of the `.` is to specify the root directory of the method. When I tested this on my bash shell, this worked without quotes, though the quotes shouldn't hurt. – Alex Dec 03 '20 at 19:55
  • 1
    Ah ha! If you have file(s) named a, b, or c, then the shell will expand `[abc]` to those filenames; otherwise the shell passes a literal `[abc]` to the command. You must not have had any files named e, x, t, r, a, or s. – John Gordon Dec 04 '20 at 16:02