Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install multiple extra dependencies using the square brackets method in one pip install command. #8940

Closed
hongyi-zhao opened this issue Sep 30, 2020 · 3 comments

Comments

@hongyi-zhao
Copy link

Hi,

The following codes are the content of extras_require section of setup.py for pymatgen.

    extras_require={
        "provenance": ["pybtex"],
        "ase": ["ase>=3.3"],
        "vis": ["vtk>=6.0.0"],
        "abinit": ["netcdf4"],
        ':python_version < "3.7"': [
            "dataclasses>=0.6",
        ]},

So, if I want to install all of these extra dependencies with one run of pip, can I use the following command to do the trick:

$ pip install .[provenance,ase,vis,abinit] 

Regards,
HY

@uranusjr
Copy link
Member

yes

@karlicoss
Copy link

karlicoss commented Dec 11, 2020

Not sure if I should create a separate issue for that, but: before the new resolver it was possible to run something like pip install .[extra1] .[extra2]. Not it seems to fail, e.g.

$ pip3 install --user -e '.[testing]' '.[optional]'
Processing /adhoc-project
...
INFO: pip is looking at multiple versions of hpi[optional] to determine which version is compatible with other requirements. This could take a while.
ERROR: Cannot install hpi[optional]==0.2.20201126.dev4 and hpi[testing]==0.2.20201126.dev4 because these package versions have conflicting dependencies.

The conflict is caused by:
    hpi[optional] 0.2.20201126.dev4 depends on hpi 0.2.20201126.dev4 (from /adhoc-project)
    hpi[testing] 0.2.20201126.dev4 depends on hpi 0.2.20201126.dev4 (from /adhoc-project)

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

, whereas pip3 install --user -e '.[testing,optional]' works. Is this expected? The error message is a bit obscure, no way I would have guessed how to fix it without running into this issue :) Maybe worth adding a note about extras_require to the migration guide?
If necessary, happy to file a proper bugreport with a minimal reproducing example.

@uranusjr
Copy link
Member

This is known, see #8785.

karlicoss added a commit to karlicoss/HPI that referenced this issue Dec 11, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants