-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"no arguments in initialization list" runtime error #134
Comments
A bit of digging found that the data file for all EPSG codes is in
So that seems fine. Still unclear what the problem here is. |
Can you share the data or a simple example that reproduces the error? |
I'll need to dig it out of a larger code base and change to dummy data, but will try that in a few hours. |
@rgommers Try this code in the Python console. >>> from pyproj import Proj
>>> Proj('+init=epsg:2193', preserve_flags=True) Does it produce an error? This is what should be passed in that line, please try it, too. >>> Proj({'init': 'epsg:2193', 'no_defs': True}, preserve_flags=True) Does that error? |
@micahcochran both of those work fine. |
@rgommers That's exactly what that line should be doing in Python 3.6. Unless you are having problems with Fiona (doubtful): >>> from fiona.crs import from_epsg
>>> from_epsg(2193)
{'init': 'epsg:2193', 'no_defs': True} |
Okay here's a standalone example that managed to isolate the problem; with @micahcochran's suggestions things work as expected. I'd say this is still a valid issue - a clearer error would have allowed finding the problem more easily. If you agree, I can send a PR for that.
gives
|
I'd accept a PR for an improved error message. |
I'm encountering this error still and nothing in this thread has helped. I have tried:
Every single one of them returns Python version is 3.6 and pyproj version is 1.9.5.1, installed with anaconda |
I do notice however that @rgommers' folder where he found all the projection definitions (site-packages/pyproj/data/epsg) does not seem to exist for me, instead all I found was a python file called |
After a bit of frigging around I was able to figure out the problem. I downloaded the repo source code and copied the folder After that, the library worked perfectly. Perhaps it is a problem with using Anaconda to install it, but this extremely crucial data folder was simply not copied, or was possibly copied to the wrong location. |
@iboates I'm facing the same issue as you. I copied the Update: I solved my issue! Anaconda weirdly did not install the dependencies as it usually does. So after installing Cython, it seems to finally work. |
I'm also facing the same issue, but comments above by @Eskapp Eskapp make no sense to me. I also use Anaconda. Can you clarify what exactly needs to be done to clear this error? |
Trying to clarify @Jens-R-Pedersen : Then, I realized that Cython was not installed in the environment I was working in. So I installed it and after that the error disappeared and everything works perfectly. I would suggest checking that Cython is installed, the first thing to try. |
Thank you for the response.
I have verified that Cython is installed. Still get the error.
I looked at your reference to the data folder below, but I don’t see any way to copy this??? Please excuse my ignorance on how to use Github.
Thanks again,
Jens
From: eepaillard <notifications@github.com>
Sent: Wednesday, November 21, 2018 11:14 AM
To: jswhit/pyproj <pyproj@noreply.github.com>
Cc: Jens-R-Pedersen <jpedersen2017@hotmail.com>; Mention <mention@noreply.github.com>
Subject: Re: [jswhit/pyproj] "no arguments in initialization list" runtime error (#134)
Trying to clarify @Jens-R-Pedersen<https://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FJens-R-Pedersen&data=02%7C01%7C%7C2b67965204774b48dbcd08d64fe57556%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636784244260235840&sdata=QA1LYBpxdRh1jDCkpFLbfrawI0i0R7sjf1JCdFSDPoU%3D&reserved=0> :
I copied the data folder (located here: https://github.com/jswhit/pyproj/tree/master/lib/pyproj/) in C:\Anaconda3\Lib\site-packages\pyproj\ (which I am not sure is useful or not because after that, the error was still there)
Then, I realized that Cython was not installed in the environment I was working in. So I installed it and after that the error disappeared and everything works perfectly. I would suggest checking that Cython is installed, the first thing to try.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<https://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fjswhit%2Fpyproj%2Fissues%2F134%23issuecomment-440779421&data=02%7C01%7C%7C2b67965204774b48dbcd08d64fe57556%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636784244260235840&sdata=UewR%2FYjcyQKMAYSMPrKC6cODnNgnFu36xgZbk7eEce4%3D&reserved=0>, or mute the thread<https://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAqjaJRqeEpKWF_TxtifxJ78-YSAMA1gGks5uxaXmgaJpZM4VAHGh&data=02%7C01%7C%7C2b67965204774b48dbcd08d64fe57556%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636784244260235840&sdata=j2MOxRwHCK1acrOEfRmSt3ZH%2BSWIxp4Wsc1%2Bfc2IP50%3D&reserved=0>.
|
@Jens-R-Pedersen You can clone the repo or download it as a zip file. |
I am also having the same problem. Basically, I try to change crs of a dataframe by the following line and it is not been working for the last week: dataframe2 = dataframe1.to_crs(epsg='4326') |
We seem to be triggering this in the initial Cartopy AppVeyor setup, but only on Python 3.6 and not 2.7. Note that the 2.7 build also pins Cython 0.17 and proj4 4.9.1, among others, and then ends up with pyproj 1.9.4. The 3.6 build uses the latest of everything, ending up with pyproj 1.9.5.1. |
OK, I actually figured out the issue we were having. We activate the environment and then install everything other than Python in it. But latest proj builds set So for anyone else hitting this, make sure you a) are installing in an environment, not the root, and; b) activate after installing proj (or pyproj). |
I experienced the same Error (using an anaconda python 3.6 and pyproj 1.9.5.1) and fixed it by manually downloading the data directory as suggested by @Eskapp and then set the This fixed the issue. Maybe this is due to an error in the conda recipe? |
@jfnk: I think so, in my case I was also missing the data directory with an anaconda install, and downloading it manually and sticking it where it was expected to be fixed the issue. |
I was having the same issue in a 32-bit miniconda Python 2.7 environment. I did the same thing @jfnk did, and everything worked great. Thanks! |
Hi, I am experiencing the same issue but nothing proposed in this topic helps. I am running Python 3.7.2, without Anaconda, on OsX Mojave. I should have everything installed, the 'data' folder in pyproj is there (I downloaded and overwrote it again just to be sure). I find really strange that the same code, on my old laptop (same kind of Python installation, without conda) and on the very same files, worked flawlessly. Now it's not working, it returns this error when I try to set the crs, but I really don't understand what's the matter here. |
Installing the latest version of cython would help |
Hello Guys. I'm really new to Python and am running into the same error. I've been trying to work through this introductory course to Python for remote sensing purposes https://github.com/patrickcgray/open-geo-tutorial I get the issue in the following Jupyter notebook: chapter_4_vector.ipynb I get the following runtime error: RuntimeError: b'no arguments in initialization list' Would anyone be willing to walk me through? |
Hi, guys. |
hey guys ! thank you so much for the help and suggestions.
|
Can you provide this information: - pyproj version (`python -c "import pyproj; print(pyproj.__version__)"`)
- PROJ version (`python -c "import pyproj; print(pyproj.proj_version_str)"`)
- Python version (`python -c "import sys; print(sys.version.replace('\n', ' '))"`)
- Operation System Information (`python -c "import platform; print(platform.platform())"`) |
Also, I haven't seen |
This solution worked for me as well. Installed pyproj with conda. Windows 7. |
It was working till yesterday. Today I booted up my system, started the notebook and now it is not working :(
1.9.6 @jessedhenderson - This does not work for me.
|
gives:
|
so I had the same problem. Using conda uninstall pyproj and then pip install pyproj worked to run the code
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. |
I have this same problem in a Jupyter Notebook, but it works fine in Visual Studio Code. Any ideas as to how this could be? |
Maybe your running the code in a different env in the jupyter notebook? |
I have only the one base environment. What's also weird is that if I export the python script from VSCode as a Jupyter Notebook, VSCode launches the Jupyter Notebook, and the Jupyter Notebook works! This is not, however, a great solution as it involves extra steps. |
Interestingly, if I launch either JupyterLab or Jupyter Notebook from Anaconda Navigator, rather than from an Anaconda Powershell Prompt, I get no errors! Shouldn't these all be the same? |
I encountered this error when I tried to run:
On the following setup:
I fixed the error by editing the file |
Why is this closed? And couldn't possibly understand how to fix it. @smcateer solution works, but this should be fixed in conda iteself. Took me only 72 hours to understand how to tackle this :( |
Not an issue on pyproj>=2 |
@shakedk, you will need to re-create your environment and use the strict option:
|
Will this installed version 2 and up? Because using it regularly installed pyproj 1.9.6 and I wasn't able to update it manually. |
Yes, it should. |
@smcateer's answer (#134 (comment)) worked for me as well.. and for all those who somehow missed where to look for the file |
+1 for comment #134 |
it reaally works for me !!! Thanks a lot. |
|
it really works..as simple as it is. Thanks @zuzhaoye |
Hi, I tried the most recent post. Replacing pyproj installed from anaconda and installing it with pip. It no longer gives an error, However the function has unexpected behavior.
returns
the function is running, but does not return the newly updated CRS Edit: I didnt save the updated dataframe into the variable needed to set |
I had the same problem with pycharm. And I didnt have most of the folders that u guys mentioned above in my pyproj folder. And its version was 1.9. So I updated it to version 2... using conda. I think u should do it with conda rather than pip. During the installation, I found out that when I was installing geopandas it hadn't install MKL-2020.0 properly. When I updadet pyproj, MKL-2020.0 installed as well. And after that everything worked well and I had the needed folders in pyproj folder! |
gdf.to_crs('epsg = 4682') File "", line 1, in File "C:\Users\hafez\anaconda3\envs\ocean\lib\site-packages\geopandas\geodataframe.py", line 534, in to_crs File "C:\Users\hafez\anaconda3\envs\ocean\lib\site-packages\geopandas\geoseries.py", line 423, in to_crs File "C:\Users\hafez\anaconda3\envs\ocean\lib\site-packages\pyproj_init_.py", line 362, in new File "_proj.pyx", line 129, in _proj.Proj.cinit RuntimeError: b'no arguments in initialization list' |
@zuzhaoye 's solution:
Worked for me, albeit it throws up a warning message, documenting it here:
|
this one fixed mine |
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.
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?
The text was updated successfully, but these errors were encountered: