Comments (21)
I had the same issue and resolved it by installed the conda package from anaconda.org as follows:
conda install -c https://conda.anaconda.org/ioos pyproj
from pyproj.
I may have a related, new problem on Anaconda3 Windows with version 1.9.5.1-py36hb98d9bb_1
The value of pyproj.datadir.pyproj_datadir is
"C:/Users/icg174/Anaconda3\share\proj"
while the data is actually located in
C:/Users/icg174/Anaconda3/Library/share/
so both the formatting of the path seperators is off and the reference to the PROJ_DIR is missing as well as that there is a discrepancy between the listed and actual data path.
The last build version 1.9.5.1-py36_0 has the data files in a subdirectory of the package and also checks on the value of PROJ_DIR.
from pyproj.
I ran into this problem in 64 bit Windows 10, Python 2.7. I had installed pyproj from the ioos channel as others have suggested and received version 1.9.4. This did not work for me - I got the same error mentioned in the original post.
I went with a different solution: upgrade pyproj to 1.9.5 using the .whl file available on Christoph Gohlke's website. It's not very neat, but it did the job.
from pyproj.
I have the same problem for Proj and transform functions ! (same config as jorisvandenbossche btw)
from pyproj.
Run this:
import pyproj, os.path
os.path.exists(pyproj.pyproj_datadir + '/epsg')
This returns True
for mine, which works when I put in the offending epsg snippet.
What is the value of pyproj.pyproj_datadir
? That is suppose to be the location of the epsg file (among others). If Proj.4 library can't find that file, it shouldn't work.
from pyproj.
How I get epsg dir?
from pyproj.
epsg is a text file with PROJ.4 codes for projections. Here is the location of epsg on github folder for this project.
from pyproj.
It returns False for me (tested in a fresh conda environment):
>>> import pyproj, os.path
>>> os.path.exists(pyproj.pyproj_datadir + '/epsg')
False
and it gives a strange value for pyproj_datadir
:
>>> pyproj.pyproj_datadir
'C:\x07root\\stage\\Library\\share\\proj'
from pyproj.
As I said in the original issue, I was able to get a working version on python 3.4 by downgrading to 1.9.3 and using the JimInCO channel for win64 (https://anaconda.org/JimInCO/pyproj). The output is then:
>>> import pyproj
>>> pyproj.__version__
'1.9.3'
>>> pyproj.Proj('+init=epsg:4326 +no_defs=True')
<pyproj.Proj object at 0x00000000020A9348>
>>> import pyproj, os.path
>>> os.path.exists(pyproj.pyproj_datadir + '/epsg')
True
>>> pyproj.pyproj_datadir
'C:\\Anaconda\\envs\\test_pyproj_py3\\lib\\site-packages\\pyproj\\data'
(but using pyproj 1.9.4 of that channel leads to the same error as the pyproj version from the default anaconda channel, so it seems a problem with version 1.9.4)
from pyproj.
Using the following install for windows with 32-bit python 2.7 solved my problem too
conda install -c https://conda.anaconda.org/ioos pyproj
from pyproj.
Another option is adding environment variable 'PROJ_DIR', set to position of pyproj\data (where the 'epsg' file resides), i.e. \Anaconda2\Lib\site-packages\pyproj\data (and, possibly, restarting to update env. vars).
After that running 'print pyproj.pyproj_datadir' shold give correct location, and 'os.path.exists(pyproj.pyproj_datadir + '/epsg')' should return true.
from pyproj.
I had upgraded pyproj to 1.9.5.1 using conda default channel, problem solved on windows.
from pyproj.
I think can replicate what @joernu76 describes, with miniconda on Windows:
pyproj 1.9.5.1 py36haf3c679_3 conda-forge
Copying the files from ...\Library\share
to ...\share\proj
as a workaround seems to fix my install.
from pyproj.
@joernu76 , @tomalrussell
The value of pyproj.datadir.pyproj_datadir is ...\share\proj. However, the problem is that I do not have "proj" in "/share". My files are in "...\Library\share" like in your case. Any idea how to fix it?
from pyproj.
I can confirm that the problem still exists. I simply took the entire contents of Library\share and put them in \share\proj (which I had to create) and everything was right as rain. I would like to know what the contents of \proj\ look like so I can delete out the extraneous files though.
from pyproj.
Perhaps this is related: I get the same error for pyproj 1.9.6, my pyproj.datadir.pyproj_datadir
shows an empty string (Windows). However, as suggested here if I do conda uninstall pyproj
and install with pip install pyproj
, it works.
from pyproj.
set the project lib path to the share folder of the conda environment:
import os
os.environ['PROJ_LIB'] =r'C:\Users{usename}\AppData\Local\Continuum\anaconda3\envs{conda_environment_name}\Library\share';
from pyproj.
Can you try the most recent version of pyproj (>=2.1.0) and check if this issue persists?
from pyproj.
At least for me: my problem was related to using MingW64 Console under Windows 7 - this does not work with the conda-forge pypi feedstock (but doesn't affect the pip-package approach)
from pyproj.
Related to #216
from pyproj.
My solution:
I edited line 152 of ...site-packages/mpl_toolkits/basemap/init.py
replaced pyproj_datadir = os.eviron['PROJ_LIB'] with
pyproj_datadir = '/home/user/anaconda3/lib/python3.7/site-packages/pyproj'
Worked for me!
from pyproj.
Related Issues (20)
- Invert lat lon "Transformer" HOT 1
- Internal Proj Error: proj_create: unrecognized format / unknown name HOT 4
- Inverted x/y for transformation from WSG84 to LV95 (EPSG:2056) HOT 3
- muslinux wheel missing HOT 1
- test_azimuthal_equidistant fails with PROJ 9.4.0 HOT 1
- test failure in test_crs_cf.py HOT 2
- Add proj_query_geodetic_crs_from_datum HOT 2
- 3.6.1: pytest fails in `test/crs/test_crs_cf.py::test_azimuthal_equidistant` unit HOT 1
- A question about pyproj/_datadir.pyx HOT 2
- geometry_area_perimeter limitations not documented HOT 1
- Calculate area of arbitrary polygon on Earth's surface HOT 4
- Interrupted Mollweide gives wrong result on inverse projections of some lat/lons. HOT 1
- test_datum__from_epsg fails with PROJ 9.4.1 HOT 4
- Proj4 export from a bound CRS object fails HOT 4
- Antipodes don't match when calculated numerically HOT 7
- Bad_alloc with pyroj import in QGIS plugin
- Conversion of array to scalar when transforming 1 element arrays leads to DeprecationWarning HOT 3
- Small memory leak HOT 3
- WHL: Window x64 builds failing HOT 7
- MGA94 and MGA2020 unexpected transformation HOT 7
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 pyproj.