Comments (13)
This should be now fixed in the new release pyrosm v0.6.2 which fixes the numpy related issues. See #214
from pyrosm.
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.
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.
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.
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.
@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.
Fixed after downgrading to shapely=1.8.5
May have sth. to do with #191
from pyrosm.
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.
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.
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.
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.
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.
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)
- No boundaries extracted (except administrative ones)
- " The kernel appears to have died. It will restart automatically"
- GEOSException: IllegalArgumentException: Argument must be Polygonal or LinearRing
- ModuleNotFoundError: No module named 'pyrosm_proto' HOT 1
- Question: regarding Documentation/code
- AttributeError: module 'numpy' has no attribute 'float' HOT 6
- pip install pyrosm fails v0.6.1. HOT 3
- ImportError: cannot import name 'TopologicalError' from 'shapely.geos' HOT 3
- AttributeError: module 'shapely.geos' has no attribute 'lgeos' HOT 2
- Members of relations do not appear in the columns HOT 1
- Error message when trying to download cycling network for Poznan HOT 1
- Unix to Datetime conversion does not work
- Update Python environments
- custom_filter get_pois not working with value True HOT 6
- Building geometry mismatch issue
- Is it possible to export the filtered OSM to OSM/XODR?
- Writing OSM PBF files?
- Error when modifying the example code for Basic Usage:Read street networks
- loading multipolygon
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyrosm.