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

ModuleNotFoundError: No module named 'requests_cache.core' #93

Closed
bwakkie opened this issue Dec 20, 2021 · 10 comments
Closed

ModuleNotFoundError: No module named 'requests_cache.core' #93

bwakkie opened this issue Dec 20, 2021 · 10 comments

Comments

@bwakkie
Copy link

bwakkie commented Dec 20, 2021

I got the following error after pip install ...

Python 3.9.9 (main, Nov 20 2021, 21:30:06)
[GCC 11.1.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pygbif import occurrences as occ
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/sliss/.local/lib/python3.9/site-packages/pygbif/__init__.py", line 44, in <module>
    from .caching import caching
  File "/home/sliss/.local/lib/python3.9/site-packages/pygbif/caching.py", line 2, in <module>
    from requests_cache.core import remove_expired_responses
ModuleNotFoundError: No module named 'requests_cache.core'

Solution: edit pygbif/caching.py
And change in line 2: requests_cache.core to requests_cache

(source: https://requests-cache.readthedocs.io/en/stable/user_guide/troubleshooting.html
ModuleNotFoundError: No module named 'requests_cache.core': This module was deprecated in v0.6 and removed in v0.8. Just import from requests_cache instead of requests_cache.core.)

@elsadg
Copy link

elsadg commented Jan 14, 2022

Hi, I am still having issues after the change requests_cache.core to requests_cache was made in line 2.

@bwakkie
Copy link
Author

bwakkie commented Jan 15, 2022

What type of issues? Can you add an error message?

@elsadg
Copy link

elsadg commented Jan 19, 2022

I was getting exactly the same message you get in your first comment (see below) but now it seems to work fine.

    from requests_cache.core import remove_expired_responses
ModuleNotFoundError: No module named 'requests_cache.core'

@agrosh24
Copy link

I am having this exact same problem, I cannot get it to work. I have the same error message as well.

@bwakkie
Copy link
Author

bwakkie commented Feb 21, 2022

@agrosh24 Did you try the suggested solution from my first post?

@Becheler
Copy link

I am running into the same issue.

Installing from pypi with pip3 install pygbif leads to

ModuleNotFoundError: No module named 'requests_cache.core'

Installing development version with pip3 install git+git://github.com/sckott/pygbif.git#egg=pygbif leads to

 ModuleNotFoundError: No module named 'appdirs'

And after that what seems like a cascade of failed dependencies (beginning with appdirs, geojson_rewind then geomet) :/

@Becheler
Copy link

Becheler commented Feb 22, 2022

I ended up fixing it with the following lines:

pip3 install appdirs geojson_rewind geomet requests_cache
pip3 install git+git://github.com/sckott/pygbif.git#egg=pygbif

@juanpac96
Copy link

additionally I wanted to complement the previous answer, in case you are using google colab. the way i solved the problem was like this.

!pip install folium==0.2.1
!pip3 install appdirs geojson_rewind geomet requests_cache
!pip3 install git+git://github.com/sckott/pygbif.git#egg=pygbif

Even so, I think that some libraries should be updated or changed to prevent these incompatibility problems and not have to use so many previous configurations to be able to run the GBIF client.

@fkyeeb
Copy link

fkyeeb commented May 23, 2022

If you go onto https://requests-cache.readthedocs.io/en/stable/user_guide/troubleshooting.html. The request_core package says: "requests_cache.core: This module was deprecated in v0.6 and removed in v0.8. Just import from requests_cache instead of requests_cache.core."

A simple solution is to open the python file in the pygbif package that is importing requests_cache.core, and change that to import requests_cache.

@MattBlissett
Copy link
Member

Thanks for the comments everyone.

We've just released version 0.6.1, which updates the required dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants