edwardpopoola / pypaystack

A python wrapper for the Paystack API
MIT License
39 stars 32 forks source link

ModuleNotFoundError: No module named 'requests' #16

Open kmazi opened 2 years ago

kmazi commented 2 years ago

When I try to build an image of my python flask app, other packages in the requirement files are downloaded except pypaystack when I run pip install -r requirements.txt. I'm using python 3.10.1 python image. The failure message is similar to this:

error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [12 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-ydl8ygtk/pypaystack_eea4acce0f264442adff3cef05cee8af/setup.py", line 2, in <module>
          from pypaystack import version
        File "/tmp/pip-install-ydl8ygtk/pypaystack_eea4acce0f264442adff3cef05cee8af/pypaystack/__init__.py", line 3, in <module>
          from .customers import Customer
        File "/tmp/pip-install-ydl8ygtk/pypaystack_eea4acce0f264442adff3cef05cee8af/pypaystack/customers.py", line 1, in <module>
          from .baseapi import BaseAPI
        File "/tmp/pip-install-ydl8ygtk/pypaystack_eea4acce0f264442adff3cef05cee8af/pypaystack/baseapi.py", line 2, in <module>
          import requests
      ModuleNotFoundError: No module named 'requests'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

Has anyone experienced this before? If yes, how did you resolve it?

gray-adeyi commented 2 years ago

Module depends on requests....place requests above it and try again.

kmazi commented 2 years ago

Yea placing request above it works but I'm wondering why a package won't install it's dependencies.

gray-adeyi commented 2 years ago

It's probably the way it was packaged by it's author...wanted to clone and repackage it after no luck trying to reach out to it's developer but there's a lot of it's clone on PYPI. Haven't tried any though

SaviourBassey commented 2 years ago

I do not understand the "above". Please how do I place the requests above. I am currently having the same issues

gray-adeyi commented 2 years ago

I do not understand the "above". Please how do I place the requests above. I am currently having the same issues

Pending on your environment setup...if your're using pipenv, you place the "requests" dependency above the pypaystack in the Pipfile then install it

gray-adeyi commented 2 years ago

I don't think the package is still maintained by it's developers...i tried writing once but got no reply...there are many forks of this project on pypi but i remember what i did then was to clone this project and install only requests...it doesn't break this way when pushing to heroku but then, not the best solution out there.

SaviourBassey commented 2 years ago

Am new to this whole thing, I still do not understand.

I have both things installed already

gray-adeyi commented 2 years ago

you know what uninstall all and try this out i created a video to show how i fixed the issue https://youtu.be/MrqWC1ByqKo

gray-adeyi commented 2 years ago

Hi! I've republished this package as pypaystack2

pip install pypaystack2

No major changes were made it still works like pypaystack but you'll have to import from pypaystack2 more info at PyPaystack2

gray-adeyi commented 2 years ago

Just published a new version. I made some changes that aren't backwards compatible with it. But I've tried hard to create a documentation for it you can check it out here. https://pypi.org/project/pypaystack2/

gray-adeyi commented 2 years ago

Hi! I just got a message from someone trying to use pypaystack2 about a bug. "error importing Optional from optparse". that's my fault. if you're experiencing the same issue i've fixed it in the version 1.0.1.

gray-adeyi commented 2 years ago

Just added a simple tutorial to the documentation. you can find it out here https://gray-adeyi.github.io/pypaystack2/paystack-client-turorial.html

gray-adeyi commented 1 year ago

Merry Christmas developers! I'm glad to announce the release of version 1.0.2 of pypaystack2. Fixed bugs and included the the new Terminal API from paystack and a new way of using the API wrappers more info in the link https://gray-adeyi.github.io/pypaystack2/how-to-guides/