marceloprates / prettymaps

A small set of Python functions to draw pretty maps from OpenStreetMap data. Based on osmnx, matplotlib and shapely libraries.
GNU Affero General Public License v3.0
11.04k stars 516 forks source link

Disappointed ! #38

Open jmbernabotto opened 2 years ago

jmbernabotto commented 2 years ago

Whatever the solution I try, I have an error. I'm so disappointed !!

With Colab : here the error after the build instruction (fig, ax = plt.subplots(figsize = (12, 12), constrained_layout = True)...)

ImportError
Traceback (most recent call last)

in () 41 ) 42 ---> 43 plt.savefig('../prints/macao.png') 44 plt.savefig('../prints/macao.svg') 3 frames /usr/local/lib/python3.7/dist-packages/matplotlib/backends/backend_agg.py in print_png(self, filename_or_obj, metadata, pil_kwargs, *args, **kwargs) 503 Keyword arguments passed to `PIL.Image.Image.save`. 504 --> 505 If the 'pnginfo' key is present, it completely overrides 506 *metadata*, including the default 'Software' key. 507 """ ImportError: cannot import name '_png' from 'matplotlib' (/usr/local/lib/python3.7/dist-packages/matplotlib/__init__.py) With my Mac, it's worth. I have a Mac Mini M1 and a Macbook Pro Intel. pip install git+https://github.com/marceloprates/prettymaps.git make an error. I'm sure my pip is useful because I often use it ! With a PC under Windows 10, same issue ! The only way I don't try it's Linux way. I'm going to try it ! I will be so happy when I will succeed to product a map ! Can somebody help me ?
ushham commented 2 years ago

I fixed this issue including the line in the first code cell: !pip install matplotlib==3.1.3

I am on a M1 Mac and it is now working fine.

jmbernabotto commented 2 years ago

@ushham you mean I have to do : !pip install matplotlib==3.1.3 !pip install git+https://github.com/abey79/vsketch#egg=vsketch !pip install git+https://github.com/marceloprates/prettymaps.git

?

ushham commented 2 years ago

Exactly, my first code box reads:

!pip install git+https://github.com/abey79/vsketch#egg=vsketch
!pip install git+https://github.com/marceloprates/prettymaps.git

!pip install matplotlib==3.1.3

!mkdir ../prints
!mkdir ../assets
!mkdir ../assets/Permanent_Marker/
!wget -O ../assets/Permanent_Marker/PermanentMarker-Regular.ttf https://github.com/marceloprates/prettymaps/raw/main/assets/Permanent_Marker/PermanentMarker-Regular.ttf

You then need to rerstart the runtime once these edits are made (Runtime -> restart runtime)

jmbernabotto commented 2 years ago

OK ! Thanks Ushham, I'm going to test it !

Le lun. 30 août 2021 à 12:31, ushham @.***> a écrit :

Exactly, my first code box reads: `!pip install git+https://github.com/abey79/vsketch#egg=vsketch !pip install git+https://github.com/marceloprates/prettymaps.git

!pip install matplotlib==3.1.3

!mkdir ../prints !mkdir ../assets !mkdir ../assets/Permanent_Marker/ !wget -O ../assets/Permanent_Marker/PermanentMarker-Regular.ttf https://github.com/marceloprates/prettymaps/raw/main/assets/Permanent_Marker/PermanentMarker-Regular.ttf`

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/marceloprates/prettymaps/issues/38#issuecomment-908231792, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJDEUSK5YSMH6VQYGZOSYALT7NMZHANCNFSM5DBPUX2Q .

jmbernabotto commented 2 years ago

unfortunately no way to install vsketch and prettymap here the response ERROR: Command errored out with exit status 1: git clone -q https://github.com/abey79/vsketch /private/var/folders/qv/v183qw9s6lj_35jwqy5_b72c0000gn/T/pip-req-build-hu3abp4z Check the logs for full command output.

ERROR: Command errored out with exit status 1: git clone -q https://github.com/marceloprates/prettymaps.git /private/var/folders/qv/v183qw9s6lj_35jwqy5_b72c0000gn/T/pip-req-build-a49tcdag Check the logs for full command output.

MrBeike commented 2 years ago

maybe u need this.
for vsketch:use this install method for prettymaps:Windows Binaries for Python Extension Packages 1.search for GDAL->download whl file->pip install xxx.whl

  1. search for Fiona->download whl file->pip install xxx.whl
jmbernabotto commented 2 years ago

thanks @MrBeike It's all very inconvenient and this is the first time I've had to do so much to install a library. :-(

ddb95 commented 2 years ago

@jmbernabotto did it work? I had the same issue, followed @ushham's advice and it works like a charm.

jmbernabotto commented 2 years ago

No, it does not work despite of @ushahm's advice :-(

Le mer. 1 sept. 2021 à 05:44, DEBADATTA BHATTACHARJEE < @.***> a écrit :

@jmbernabotto https://github.com/jmbernabotto did it work? I had the same issue, followed @ushham https://github.com/ushham's advice and it works like a charm.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/marceloprates/prettymaps/issues/38#issuecomment-909850420, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJDEUSOEZ2WC3BV772TQLV3T7WOQRANCNFSM5DBPUX2Q .

ddb95 commented 2 years ago

If you don't mind, can you let me know where you are getting the error?

ddb95 commented 2 years ago
  1. Add !pip install matplotlib==3.1.3


!pip install git+https://github.com/marceloprates/prettymaps.git

!pip install matplotlib==3.1.3

!mkdir ../prints

!mkdir ../assets

!mkdir ../assets/Permanent_Marker/

!wget -O ../assets/Permanent_Marker/PermanentMarker-Regular.ttf 

https://github.com/marceloprates/prettymaps/raw/main/assets/Permanent_Marker/PermanentMarker-Regular.ttf```
ddb95 commented 2 years ago
  1. Run the code block

  2. Restart the runtime once these edits are made (Runtime -> restart runtime) (if you ran the code block without editing)

jmbernabotto commented 2 years ago

Here the first error, when I launch : pip install pip install git+https://github.com/marceloprates/prettymaps.git

Collecting git+https://github.com/marceloprates/prettymaps.git Cloning https://github.com/marceloprates/prettymaps.git to /private/var/folders/qv/v183qw9s6lj_35jwqy5_b72c0000gn/T/pip-req-build-8yy8h_h8 Running command git clone -q https://github.com/marceloprates/prettymaps.git /private/var/folders/qv/v183qw9s6lj_35jwqy5_b72c0000gn/T/pip-req-build-8yy8h_h8 xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun WARNING: Discarding git+https://github.com/marceloprates/prettymaps.git. Command errored out with exit status 1: git clone -q https://github.com/marceloprates/prettymaps.git /private/var/folders/qv/v183qw9s6lj_35jwqy5_b72c0000gn/T/pip-req-build-8yy8h_h8 Check the logs for full command output. ERROR: Command errored out with exit status 1: git clone -q https://github.com/marceloprates/prettymaps.git /private/var/folders/qv/v183qw9s6lj_35jwqy5_b72c0000gn/T/pip-req-build-8yy8h_h8 Check the logs for full command output.

So I can’t follow next instructions

Le 1 sept. 2021 à 19:13, DEBADATTA BHATTACHARJEE @.***> a écrit :

pip install git+https://github.com/marceloprates/prettymaps.git <git+https://github.com/marceloprates/prettymaps.git>

larsjuvik commented 2 years ago

@jmbernabotto The solution presented here might help!

ddb95 commented 2 years ago

@jmbernabotto ok. Let me look if I can help you. Are you running it on Colab or local instance?

jmbernabotto commented 2 years ago

I tried both. Same issue.

Le 3 sept. 2021 à 05:26, DEBADATTA BHATTACHARJEE @.***> a écrit :

 @jmbernabotto ok. Let me look if I can help you. Are you running it on Colab or local instance?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

gonzalezhomar commented 2 years ago

maybe u need this. for vsketch:use this install method for prettymaps:Windows Binaries for Python Extension Packages 1.search for GDAL->download whl file->pip install xxx.whl

  1. search for Fiona->download whl file->pip install xxx.whl

This worked for me. Before running the installation cell, I installed the GDAL and Fiona with this method.

After that I ran the installation cell with !pip install git+https://github.com/abey79/vsketch#egg=vsketch !pip install git+https://github.com/marceloprates/prettymaps.git

But I had trouble with the import of shapely. So i ran pip uninstall shapely and installed it with conda install shapely. This solved some package dependencies.

With all that, I got prettymaps working on a local enviroment. I think it's worth it.