question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"no arguments in initialization list" runtime error

See original GitHub issue

Hi, I’m running into a cryptic error. My CRS in the geopandas dataframe seems to be properly set, however I cannot convert it to any other CRS.

>>> print(gdf_PLU.crs)
epsg:2193
>>>gdf_PLU.to_crs(epsg=4326)
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-92-46b32e6c8012> in <module>()
      1 print(gdf_PLU.crs)
----> 2 gdf_PLU.to_crs(epsg=4326)

~/anaconda3/envs/hthf/lib/python3.6/site-packages/geopandas/geodataframe.py in to_crs(self, crs, epsg, inplace)
    384         else:
    385             df = self.copy()
--> 386         geom = df.geometry.to_crs(crs=crs, epsg=epsg)
    387         df.geometry = geom
    388         df.crs = geom.crs

~/anaconda3/envs/hthf/lib/python3.6/site-packages/geopandas/geoseries.py in to_crs(self, crs, epsg)
    283             except TypeError:
    284                 raise TypeError('Must set either crs or epsg for output.')
--> 285         proj_in = pyproj.Proj(self.crs, preserve_units=True)
    286         proj_out = pyproj.Proj(crs, preserve_units=True)
    287         project = partial(pyproj.transform, proj_in, proj_out)

~/anaconda3/envs/hthf/lib/python3.6/site-packages/pyproj/__init__.py in __new__(self, projparams, preserve_units, **kwargs)
    356         # on case-insensitive filesystems).
    357         projstring = projstring.replace('EPSG','epsg')
--> 358         return _proj.Proj.__new__(self, projstring)
    359 
    360     def __call__(self, *args, **kw):

_proj.pyx in _proj.Proj.__cinit__ (_proj.c:1170)()

RuntimeError: b'no arguments in initialization list'

I can’t find this error message in any other issue. From similar issues it seems some data files could be missing (if so, how can I install them; I’m using the binary that is dragged in by conda-forge geopandas). Or is it something else?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:6
  • Comments:69 (13 by maintainers)

github_iconTop GitHub Comments

11reactions
AlexandraKappcommented, Jul 30, 2019

so I had the same problem. Using conda uninstall pyproj and then pip install pyproj worked to run the code

from pyproj import Proj Proj(‘+init=epsg:2193’, preserve_flags=True)

With pip version 2.2.1 is installed, so that workes, but conda uses Version 1.9.6.

But once I installed geopandas, conda would install pyproj with Version 1.9.6 again and then my code would also crashed again.

It worked, once I manually deleted the pyproj folder in anaconda\Lib\site-packages instead of using conda uninstall. And then use pip install pyproj.

11reactions
ycebearcommented, Mar 6, 2019

Thanks a lot for all the helpful comments ! The solution of @rickantonais worked for me too:

1. no additional download necessary, but introduce the following code:
2. import os
3. os.environ['PROJ_LIB']=r"C:[... _path to_ ….]\Anaconda3\Library\share"  
Read more comments on GitHub >

github_iconTop Results From Across the Web

RuntimeError: b'no arguments in initialization list'
1. I ran into an error on an Anaconda, Windows 10 installation in which the pyproj package's file datadir.py was pointing to the...
Read more >
Why do I get error "Runtime: b'no arguments in initialization list ...
When I first bring in the feature class as a gpd dataframe, it shows no crs, so I use a function to find...
Read more >
GeoPandas RunTimeError when attempting to re-project a ...
I am working through online documentation and have encountered a RuntimeError: b'no arguments in initialization list' from the below code.
Read more >
Why do I get error "Runtime: b'no arguments in initialization list ...
GIS: Why do I get error " Runtime : b' no arguments in initialization list '" when running to_crs?Helpful? Please support me on...
Read more >
RuntimeError: b'no arguments in initialization list' - DevPress
I'm trying to solve my issue in my own but I couldn't, I'm trying to run this code in every format you can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found