Comments (7)
What version of requests do you have installed?
from osmnx.
I've just checked : 2.4.3 for Python 3 (I just tested the previous code with this Python version) and requests 2.12.1 for Python 2 !
from osmnx.
Make sure you have the most recent version of requests in both environments, with: pip install requests --upgrade
from osmnx.
Yes, I've got the most recent version on Python 3.4 available with pip --upgrade ! It's always 2.4.3, no changes.
For Python 2.7 upgrade didn't work, but I didn't use it for these particular case.
from osmnx.
Ok. Try upgrading OSMnx to its latest beta version: 0.1b2:
pip install osmnx --upgrade --pre
I added a new piece of code that should let it work with old versions of requests, include v2.4.x.
from osmnx.
That's nice, thank you very much !
I used also sudo pip3 install --ignore-installed requests command, because I found an "owed by OS" message very strange.
By curiosity, which requests version do you have ? I'm quite sure that 2.4.3 is the most recent on my system !
Now I've got OSMnx 0.1b2 version (just checked it), so I ran the same command but... new error :-/...
---------------------------------------------------------------------------
NetworkXPointlessConcept Traceback (most recent call last)
<ipython-input-2-0d3afc68e96a> in <module>()
----> 1 ox.plot_graph(ox.graph_from_place('Modena, Italy'))
/usr/local/lib/python3.4/dist-packages/osmnx/osmnx.py in graph_from_place(query, network_type, simplify, retain_all, truncate_by_edge, name, which_result, buffer_dist, timeout, memory, max_query_area_size, clean_periphery)
1815 # create graph using this polygon(s) geometry
1816 G = graph_from_polygon(polygon, network_type=network_type, simplify=simplify, retain_all=retain_all,
-> 1817 truncate_by_edge=truncate_by_edge, name=name, timeout=timeout, memory=memory, max_query_area_size=max_query_area_size, clean_periphery=clean_periphery)
1818
1819 log('graph_from_place() returning graph with {:,} nodes and {:,} edges'.format(len(G.nodes()), len(G.edges())))
/usr/local/lib/python3.4/dist-packages/osmnx/osmnx.py in graph_from_polygon(polygon, network_type, simplify, retain_all, truncate_by_edge, name, timeout, memory, max_query_area_size, clean_periphery)
1749 # truncate graph by polygon to return the graph within the polygon that caller wants
1750 # don't simplify again - this allows us to retain intersections along the street that may now only connect 2 street segments in the network, but in reality also connect to an intersection just outside the polygon
-> 1751 G = truncate_graph_polygon(G_buffered, polygon, retain_all=retain_all, truncate_by_edge=truncate_by_edge)
1752
1753 # count how many street segments in buffered graph emanate from each intersection in un-buffered graph, to retain true counts for each intersection, even if some of its neighbors are outside the polygon
/usr/local/lib/python3.4/dist-packages/osmnx/osmnx.py in truncate_graph_polygon(G, polygon, retain_all, truncate_by_edge)
1320 if not retain_all:
1321 G = remove_isolated_nodes(G)
-> 1322 G = get_largest_component(G)
1323
1324 return G
/usr/local/lib/python3.4/dist-packages/osmnx/osmnx.py in get_largest_component(G, strongly)
1098 else:
1099 # if the graph is not connected and caller did not request retain_all, retain only the largest weakly connected component
-> 1100 if not nx.is_weakly_connected(G):
1101 G = max(nx.weakly_connected_component_subgraphs(G), key=len)
1102 log('Graph was not connected, retained only the largest weakly connected component ({:,} of {:,} total nodes) in {:.2f} seconds'.format(len(G.nodes()), original_len, time.time()-start_time))
/usr/local/lib/python3.4/dist-packages/networkx-1.11-py3.4.egg/networkx/algorithms/components/weakly_connected.py in is_weakly_connected(G)
/usr/local/lib/python3.4/dist-packages/networkx-1.11-py3.4.egg/networkx/utils/decorators.py in _not_implemented_for(f, *args, **kwargs)
66 ' '.join(graph_types))
67 else:
---> 68 return f(*args,**kwargs)
69 return _not_implemented_for
70
/usr/local/lib/python3.4/dist-packages/networkx-1.11-py3.4.egg/networkx/algorithms/components/weakly_connected.py in is_weakly_connected(G)
176 if len(G) == 0:
177 raise nx.NetworkXPointlessConcept(
--> 178 """Connectivity is undefined for the null graph.""")
179
180 return len(list(weakly_connected_components(G))[0]) == len(G)
NetworkXPointlessConcept: Connectivity is undefined for the null graph.
Do you prefer that I open a new issue with that and close this one ?
Thank you again for your time and advices !
from osmnx.
I'm using requests 2.12.1 in both my Python (3.5 and 2.7) environments.
Regarding the NetworkXPointlessConcept, there's an open issue for that right now: #8. Would you comment on that issue with your details as I'm working on it there?
from osmnx.
Related Issues (20)
- Add function to merge parallel roads HOT 4
- Publish v2 pre-releases HOT 1
- Issues with plotting and basic stats when using DiGraphs HOT 1
- AttributeError: module 'osmnx' has no attribute 'convert' HOT 1
- InsufficientResponseError while HOT 1
- FutureWarning: The 'unary_union' attribute is deprecated HOT 4
- Issue with graph_from_bbox on Visual Studio code. HOT 5
- plot_graph raises an MPL error while running in a remote Linux machine HOT 1
- Change bounding box coordinates' order for v2.0.0? HOT 2
- Graph route animations HOT 3
- `consolidate_intersections` crashes with dictionary for tolerances HOT 4
- Bounding Box doesn't work in ox.features_from_bbox(bbox, tags) HOT 1
- We need a fucntion that can generate gdf_nodes and gdf_edges from locallly downloaded road network loaded using geopandas as gdf HOT 3
- No Modules 1.9.3 HOT 1
- Unions filter HOT 5
- Optimize _remove_polygon_holes function for improved performance with complex geometries HOT 9
- Response Error for some network types/cities HOT 1
- Feature request: truncate_by_nearest_edge while generating graph from point HOT 1
- TypeError when using graph_from_bbox in OSMnx 2.0.0b1 HOT 9
- Incompatible with the version of numpy 2.1.0.rc1 when using 2.0.0b1 HOT 4
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 osmnx.