materialsproject / api

New API client for the Materials Project
https://materialsproject.github.io/api/
Other
108 stars 40 forks source link

`botocore` dependency #838

Closed kavanase closed 1 year ago

kavanase commented 1 year ago

Hi! 😃 Just to flag, we're getting test failures with the new mp-api, due to botocore being required but not listed as a dependency. I think it should be added as a dependency in setup.py.

kavanase commented 1 year ago

Also to mention while I'm here, I noticed I was getting errors when importing MPRester with the current mp-api version, due to emmet.core._messages not being installed (with my current emmet-core version of 0.55.2, which is fine according to the current setup.py dependency of "emmet-core>=0.54.0").

Updating emmet-core to the current version (0.64.5) fixed this. From searching the repo, it's due to the emmet.core._messages import which was added in d5fb390. Just a heads up that you might want to update the dependency for this as well!

njzjz commented 1 year ago

We got the same error. The traceback is below:

   File "/opt/hostedtoolcache/Python/3.11.4/x64/lib/python3.11/site-packages/pymatgen/ext/matproj.py", line 28, in <module>
    from mp_api.client import MPRester as _MPResterNew
  File "/opt/hostedtoolcache/Python/3.11.4/x64/lib/python3.11/site-packages/mp_api/client/__init__.py", line 5, in <module>
    from .core import MPRestError
  File "/opt/hostedtoolcache/Python/3.11.4/x64/lib/python3.11/site-packages/mp_api/client/core/__init__.py", line 1, in <module>
    from .client import BaseRester, MPRestError
  File "/opt/hostedtoolcache/Python/3.11.4/x64/lib/python3.11/site-packages/mp_api/client/core/client.py", line 21, in <module>
    from botocore import UNSIGNED
ModuleNotFoundError: No module named 'botocore'
manassharma07 commented 1 year ago

After installing botocore, I am now getting: PermissionError: [Errno 13] Permission denied: '/home/adminuser/venv/lib/python3.9/site-packages/emmet/core/qchem/calc_types/enums.py'

munrojm commented 1 year ago

@kavanase thanks for mentioning this, I am in the process of hotfixing. The intention is to have boto3 and botocore as optional dependencies.

munrojm commented 1 year ago

Should be fixed now in the latest release.

manassharma07 commented 1 year ago

@munrojm Hi, there's something still going wrong for me. As I mentioned in my previous comment here (https://github.com/materialsproject/api/issues/838#issuecomment-1682928624), I am getting some error regarding emmet

image

I am using mp-api on a remote server that uses mp-api to host an application

munrojm commented 1 year ago

@manassharma07 which version of emmet-core do you have installed? You might want to try updating it.

manassharma07 commented 1 year ago

@munrojm Yeah, I already tried updating it to 0.64.5 based on a comment above (https://github.com/materialsproject/api/issues/838#issuecomment-1682505830) but no luck :( For now, I am using mp-api v0.33.3 in my application. Hope someone else can also reproduce the issue I am facing.

munrojm commented 1 year ago

@manassharma07 I actually see where the problem lies. I am going to try and add a fix now and patch release.

munrojm commented 1 year ago

@manassharma07, please try again after updating emmet-core and let me know if you still have the issue.

manassharma07 commented 1 year ago

@munrojm Yup, that does it. Works perfectly now! Thanks a lot for your help! Really appreciate the work!