manu12121999 / RemoveBG-GIMP

A small GIMP plugin to easily remove the Background of an Image with remove.bg. Keeps the image size and the original Image
129 stars 16 forks source link

NameError: global name 'requests' is not defined #12

Closed moraybon closed 1 year ago

moraybon commented 1 year ago

Get the following error when running the plug in, any help please System win10

Traceback (most recent call last): File "C:\Program Files\GIMP 2\lib\gimp\2.0\python/gimpfu.py", line 741, in response dialog.res = run_script(params) File "C:\Program Files\GIMP 2\lib\gimp\2.0\python/gimpfu.py", line 362, in run_script return apply(function, params) File "C:\Users\Mo\AppData\Roaming\GIMP\2.10\plug-ins\remove_background.py", line 96, in remove_background response = requests.post( NameError: global name 'requests' is not defined

Ocelotsden commented 1 year ago

Same here. Removebg shows in filters It asks for and accepts key it runs and progress bar goes to end Then the Global name request error pops up.

I've removed and reinstalled Python multiple times and even tried older version, but no luck.

Screenshot 2022-10-07 155144

MikeUSNRet commented 1 year ago

And... Add me to the growing list of people that are getting this same error. Have uninstalled gimp and plugins, re-installed gimp from both gimp site and the microsoft store. have run and updated python, still no luck.

Ocelotsden commented 1 year ago

I actually finally solved mine today.

I had uninstalled/reinstalled both Python and Gimp multiple times. Even tried older versions of Python and nothing worked. Anyway, one last time I uninstalled Gimp, but instead of reinstalling from the files downloaded directly from Gimp, I installed gimp from the Windows Store as a Windows app. Then after placing the py file in the plugins folder and running the python files again from an administrative command prompt, it finally worked. After entering my key, it completed and removed the background of a photo.

I don't know if it was just something weird with my system or if it will work for others, but all I can think of is that Gimp from the Windows Store uses different directories in the install. Maybe the plugin was able to find all the files that way. Not sure, but it's finally working for me.

moraybon commented 1 year ago

Ocelotsden, did that and still did not work for me. thanks tho for posting a update

MikeUSNRet commented 1 year ago

A little over a month later and I'm still having this issue. have resintalled Python, Gimp, the plugin and updated pip etc etc etc and still no go Any ideas on how to fix this?:

manu12121999 commented 1 year ago

i just updated the plugin. Now it should work without requests.