Problem with running the tutorials

Hi everyone,
I’m trying to run the code in the tutorial 1_search_algorithms/tutorial_uninformed_search, but for all algorithms in section 3 I get this error message:

AttributeError: 'numpy.int64' object has no attribute 'intersects'

Any ideas what the problem could be and how I could fix it?
Thank you in advance and happy holidays!

Hi ge64neg.

Thank you for your question.

In short, please first verify that your Shapely version with pip list. If it is version 2.0, please try to overwrite the package Shapely with a lower version via pip install Shapely==1.8.5 or an even lower version, for example, pip install Shapely==1.7.0.

The following is the explanation: Our code depends on a package called Shapely, which is updated to version 2.0 after the announcement of our exercise. Since we don’t specify the required version of it in requirements.txt, it is automatically the up-to-date version and breaks our code. Overwriting it with an older version helps based on our test. We will for sure update the requirements.txt later. If you would like not to mess up with the conda environment, you could wait for our update.

Best regards,
Mingxuan

1 Like

Hi Mingxuan,

Thank you for your quick response. This solved my problem!

Now I get the following warning when I run the cell in section 1, but I think I can simply ignore it for now and continue working on the task even before the announced update of requirements.txt, correct?

y:1263: ShapelyDeprecationWarning: STRtree will be changed in 2.0.0 and will not be compatible with versions < 2.
  self._strtee = STRtree(list(self._buffered_polygons.values()))

Best regards,
Alexander

I also have the same issue. I followed the suggestion mentioned below and restarted the kernel, but I still get the same error. What did I miss? Furthermore, when I try to install Shapely version 1.7.0, I get a ‘metadata-generation-failed’ error.

Hi Alexander,

as to your question: yes, you can go further without waiting for the updated version of requirement.txt.

Thank you for reporting this warning. Unfortunately I didn’t see this warning on my PC. I run codes on a locally installed Ubuntu 20.04. Could you please provide some information about the OS and platform you’re using?

Best,
Mingxuan

Hi stephdinu8356,

Thank you for reporting you situation. Unfortunately I did not come across the same error as you and I run code with exactly Shapely 1.7.0. Based on our test, Shapely 1.8.5 should also work for our code. You can install 1.8.5 if 1.7.0 doesn’t work for you.

As to your error, does the error stop you from further proceeding the exercise? When/ at which part of code do you have this error?

Best.
Mingxuan

Hi MingxuanChe,

when I want to install an older Shapely version as you suggested, I get the following error:

Any hint what I’m doing wrong?

EDIT: it works after following this:

Hi ge86huf,

I think there should be no space between “==” and “1.8.5”. The command should be as follows:

pip install Shapely==1.8.5

Hope this can help you.

Edit: I just noticed that it’s my typo in the original post. Sorry for the inconvenience.

Best,
Mingxuan