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

NameError: name 'copy' is not defined #2

Closed
adenant opened this issue Oct 5, 2021 · 3 comments
Closed

NameError: name 'copy' is not defined #2

adenant opened this issue Oct 5, 2021 · 3 comments

Comments

@adenant
Copy link

adenant commented Oct 5, 2021

Hi,

Thank you for the tutorial. I tried to replicate the procedure, but when I ran the script for image chipping, I experienced the following error: "NameError: name 'copy' is not defined" (Image capture attached). I'm using Python 3.9.7. Do you know what causing the problem might be? Thank you.

image

@PratyushTripathy
Copy link
Owner

Hi @adenant,

Thank you for flagging this bug. You are doing it right, the problem is in the pyrsgis module and will be fixed in the next version. Till then could you please manually fix this on your system? Here's how:

  1. Find and open the "*pyrsgis\ml_init_.py" (you can see the full path the in the error message).
  2. Go to line 134 and replace copy.copy with deepcopy.

Hope this works. Let me know if it does not.

@adenant
Copy link
Author

adenant commented Oct 6, 2021

Hi @PratyushTripathy

Thanks for the response. I fixed the issue, and the code for the first part ran. However, when I started the second part, there were no image chips found in the imagechip folder, is it an issue with the pyrgis as well?

@PratyushTripathy
Copy link
Owner

@adenant Please read the Medium blog carefully. If you use this function, there won't be any image chips in the folder. Image chips will be generated if you use the QGIS plugin. If you use this, it will directly load the chips as array and store in the 'features' variable.

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

2 participants