GithubHelp home page GithubHelp logo

Comments (13)

HTenkanen avatar HTenkanen commented on July 28, 2024 2

This should be now fixed in the new release pyrosm v0.6.2 which fixes the numpy related issues. See #214

from pyrosm.

LuposX avatar LuposX commented on July 28, 2024 1

I removed shapely 2.0 and downgraded to shapely=1.8.5 and I didnt get said issue anymore, If the data I work with is very big I get the expception:
AttributeError: module 'numpy' has no attribute 'float', though.

You can try to use my attachment file, to create an envireoment, with the command conda env create --file requirement.yml it should work.
requirement.zip

from pyrosm.

momince avatar momince commented on July 28, 2024 1

Thank you so much. It worked. And to solve the problem,

"AttributeError: module 'numpy' has no attribute 'float'"

please use this line in your terminal

pip install "numpy<1.24"

from pyrosm.

Geometrein avatar Geometrein commented on July 28, 2024 1

Is anyone else experiencing the same:

AttributeError: module 'shapely.geos' has no attribute 'lgeos'
&
"AttributeError: module 'numpy' has no attribute 'float'"

errors even when using shapely=1.8.5& numpy=1.24?

from pyrosm.

HTenkanen avatar HTenkanen commented on July 28, 2024 1

Hi all! And thanks for active discussion and helping each other out!

@tfardet : There is a plan to start supporting shapely 2.0 and in general have a better memory management for the library. Unfortunately, I've been extremely busy at my day job and haven't found time for pyrosm. Hopefully, this situation will improve now during the coming months. However, all contributions to the library are also more than welcome to more quickly advance with things. 😉

from pyrosm.

tfardet avatar tfardet commented on July 28, 2024 1

@HTenkanen thanks for the quick answer!
I completely understand, I would also love to help but I can't spare the time it would require...
Good to know that things might move forward in the future, though, good luck and thanks for your work!

from pyrosm.

LuposX avatar LuposX commented on July 28, 2024

Fixed after downgrading to shapely=1.8.5
May have sth. to do with #191

from pyrosm.

momince avatar momince commented on July 28, 2024

I have installed shapely=1.8.5
now my kernel crashed. it happens again and again.
Can you please share how to build a completely new environment and the package version to avoid this "module 'shapely.geos' has no attribute 'lgeos' " issue?
Thanks.

from pyrosm.

LuposX avatar LuposX commented on July 28, 2024

Thanks for the tipp.
I think it worked, I am not sure I will keep an eye on it and see if the error occurs again.

from pyrosm.

tfardet avatar tfardet commented on July 28, 2024

Hi there, following up on this issue, are there plans to upgrade pyrosm to move to shapely>2 in the near future?
Of course, as this means rewriting the code to migrate from pygeos, I understand that this is not exactly a minor change.

from pyrosm.

snoop168 avatar snoop168 commented on July 28, 2024

Was wondering if there was any movement on this issue. I'm having issues being able to run on any python version 3.8 or higher. No matter what I do it doesnt work. I install with conda-forge and then downgrade both numpy and shapely as mentioned in this issue but I still run into issues. After downgrading I receive this warning
The Shapely GEOS version (3.10.3-CAPI-1.16.1) is incompatible with the GEOS version PyGEOS was compiled with (3.11.2-CAPI-1.17.2). Conversions between both will be slow.

If I continue anyway, when running get_data_by_custom_criteria(custom_filter=) I get a message saying the kernel crashed and will be automatically restarted. I am using Jupyter Labs.

Any update, or help would be appreciated. I was going to try to use Python 3.6 but it looks like a hassle to get Anaconda to create a venv with anything less than 3.8...

from pyrosm.

anastassiavybornova avatar anastassiavybornova commented on July 28, 2024

I removed shapely 2.0 and downgraded to shapely=1.8.5 and I didnt get said issue anymore, If the data I work with is very big I get the expception: AttributeError: module 'numpy' has no attribute 'float', though.

You can try to use my attachment file, to create an envireoment, with the command conda env create --file requirement.yml it should work. requirement.zip

For me this suggested solution worked on my macOS with the additional step of switching off pygeos use (os.environ['USE_PYGEOS'] = '0') when importing the packages, like so:

first, in the terminal

conda env create -f requirement.yml 
conda activate PSE

and then in the notebook (commented out = versions that in my case were installed in the PSE env)

import pyrosm # 0.6.1
import numpy # 1.23.5
import shapely # 1.8.5.post1
import pandas # 2.0.3
import geopandas # 0.13.2
import networkx # 3.1
import os
os.environ['USE_PYGEOS'] = '0'

from pyrosm.

MapMaker2023 avatar MapMaker2023 commented on July 28, 2024

First thanks & kudos to @HTenkanen for such a useful package. Actively using it for research on this project. The ability to create and save Pandana graphs is particular helpful.

Second, depreciating numpy to 1.19.5 after a conda install -c conda-forge pyrosm gets passed the AttributeError: module 'numpy' has no attribute 'float' for me.

from pyrosm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.