0

I am trying to convert coordinates to longitude and latitude using Pyproj, however I get an error that I am unable to solve:

b'no arguments in initialization list'

from pyproj import Proj, transform

inProj = Proj(init='epsg:3942')
outProj = Proj(init='epsg:4326')
x1,y1 = 685833.3,6236964.799
x2,y2 = transform(inProj,outProj,x1,y1)
print(x2,y2)

Any idea how I can solve this?

Many thanks for your help!

Peslier53
  • 587
  • 1
  • 7
  • 21

1 Answers1

0

You activate the environment and then install everything other than Python in it. But latest proj builds set PROJ_LIB and you need to activate the environment after installing it. Easiest fix was to request all needed packages when creating the environment, and then activate it.

Make sure you:

  • Youare installing in an environment, not the root.
  • activate after installing proj (or pyproj).
  • Make sure you have Cython installed.

I've created a simple virtual environment with virtualenv for python3.7 and your script runs fine.

Iakovos Belonias
  • 1,217
  • 9
  • 25