Coder Social home page Coder Social logo

Comments (21)

mtreiber avatar mtreiber commented on August 27, 2024 2

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.

joernu76 avatar joernu76 commented on August 27, 2024 2

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.

gaberosser avatar gaberosser commented on August 27, 2024 1

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.

antoinetri avatar antoinetri commented on August 27, 2024

I have the same problem for Proj and transform functions ! (same config as jorisvandenbossche btw)

from pyproj.

micahcochran avatar micahcochran commented on August 27, 2024

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.

johngonzalez avatar johngonzalez commented on August 27, 2024

How I get epsg dir?

from pyproj.

micahcochran avatar micahcochran commented on August 27, 2024

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.

jorisvandenbossche avatar jorisvandenbossche commented on August 27, 2024

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.

jorisvandenbossche avatar jorisvandenbossche commented on August 27, 2024

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.

bidhya avatar bidhya commented on August 27, 2024

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.

slava-kerner avatar slava-kerner commented on August 27, 2024

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.

jrovegno avatar jrovegno commented on August 27, 2024

I had upgraded pyproj to 1.9.5.1 using conda default channel, problem solved on windows.

from pyproj.

tomalrussell avatar tomalrussell commented on August 27, 2024

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.

burcukolbay avatar burcukolbay commented on August 27, 2024

@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.

sigbikes avatar sigbikes commented on August 27, 2024

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.

Sieboldianus avatar Sieboldianus commented on August 27, 2024

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.

deshmukhps95 avatar deshmukhps95 commented on August 27, 2024

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.

snowman2 avatar snowman2 commented on August 27, 2024

Can you try the most recent version of pyproj (>=2.1.0) and check if this issue persists?

from pyproj.

Sieboldianus avatar Sieboldianus commented on August 27, 2024

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.

snowman2 avatar snowman2 commented on August 27, 2024

Related to #216

from pyproj.

fasvello avatar fasvello commented on August 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.