Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AttributeError: module 'pyproj' has no attribute 'pyproj_datadir'

Have had a nightmare downloading basemap, have had so many errors and fixing them, but yet another shows up. I now keep getting the following error:

Using spyder I write:

from mpl_toolkits.basemap import Basemap

And it outputs:

 File "/anaconda3/lib/python3.7/site-packages/mpl_toolkits/basemap/__init__.py", 
line 152, in <module>
    epsgf = open(os.path.join(pyproj.pyproj_datadir,'epsg'))

AttributeError: module 'pyproj' has no attribute 'pyproj_datadir'

I tried:

pip install pyproj==1.9.6

but within a large amount of text a line in red says:

Failed building wheel for pyproj
like image 881
James Lloyd Avatar asked Apr 19 '19 23:04

James Lloyd


1 Answers

i was working through the same nightmare of installing basemap in Windows and for this error your fix with

pip install pyproj==1.9.6

worked for me, but I had to close Spyder (or Jupyter or any IDE). Having it open gave a Permission Error during the pip install. I got this from this post: Python - PIP install trouble shooting - PermissionError: [WinError 5] Access is denied

like image 155
Joris Avatar answered Oct 20 '22 15:10

Joris