I had been trying to install office 364 library to access csv in SharePoint and it messed up my python environment. I've been using Visual Studio 2017 to create add-ins for desktop for years. Have a lot of python doing stuff in the background like updating and overwriting hosted feature classes. I was using the Pro Python environment in VS.
I upgraded pro to 3.4 and now when I try to "from arcgis.gis import GIS " I get the following error.
numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject
I can transfer the script to Pro into a python toolbox and it runs fine from pro.
It's really messed up and have no idea how to repair this. Grasping at straws and any ideas would be very much appreciated.
Solved! Go to Solution.
plus many more
make sure you have a version of pandas and numpy supported in your environment that is supported by the current version of Pro.
Hey @MichaelKohler
I would check to see which environment your Pro is using, going to Project -> Python, and viewing it there. You can also clone your environment to verify everything is working.
I would also be sure that the Python environment is correctly pointing to the arcgispro-py3 environment that your Pro uses. This lets you use the libraries that Pro accesses. Somewhere here: C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3
You can also try reinstalling numpy:
conda install --force-reinstall numpy
Cody
VS shows ArcPro 3.6 and Python 2.7 (32-bit) for python envs.
ArcPro 3.6 is pointing to the correct directory "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3"
I'm not sure why, when in pro, i can open python window and import GIS. But in VS, when I use the same env, I get the error.
I cloned the env in pro and updated all packages. This clone env can also import successfully in pro but not in VS.
I cloned the pro env and did the install --force. it showed that it was successful. Then I did the same with pandas.
Still not working
Thank you
plus many more
make sure you have a version of pandas and numpy supported in your environment that is supported by the current version of Pro.
I had looked at those, and more, yesterday and most of it went over my head. Was already in a funk so nothing really worked or was sinking in. Reinstalled the SDK for desktop and was able to get the addin working so i could change a user name for a database. So I had a win for the day. Then I quit for the night. The link below helped.
Pandas was version 2.0.2 in the default pro env. numpy was version 1.24.3.
created a clone inside of Pro and did the below pip on the clone env.
pip install --upgrade pandas.
after that Pandas was 2.2.3 and numpy was 2.2.3
Thank you very much.
don't clone and then use pip.
If you want to use anything outside of what is provided by arcgis pro, just create and environment and install your packages from conda 'defaults'. You, of course, won't be able to use any "arc..." stuff from that environment.
I have separate environments that I created... not cloned... to do my python/numpy/scipy/whatever stuff (python 3.13 and numpy 2.2.x are pretty sweet 😉 )
if cloning.... no pip, conda only and 'defaults' is preferable over 'conda-forge'
if not cloning ... create an environment
pip will work in many circumstances, but get used to recreating environments when things go bad
end of Friday missive