Timeline for ArcGIS error with Python Toolbox that imports matplotlib?
Current License: CC BY-SA 3.0
9 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 1, 2018 at 20:00 | vote | accept | wowohweewah | ||
Mar 1, 2018 at 20:00 | answer | added | wowohweewah | timeline score: 2 | |
Mar 1, 2018 at 0:32 | comment | added | wowohweewah | Every instance of Python in PATH or PYTHON_PATH points to ArcGISx6410.5. This includes for user and system. Running the toolbox from CMD with the python command results in no errors, loads, then since it's not a command line tool, exits without doing anything. I'm sure I could whip up a programmatic way of running it via a .py script which would run, but that would defeat the purpose of the ArcToolbox. At this point I'm just trying a uninstall/reinstall of ArcGIS entirely, but the same setup worked w/o a problem for coworkers. | |
Feb 28, 2018 at 23:58 | comment | added | Michael Stimson | You can see from the paths that it's bouncing from 64bit to 32bit libs, do you get these errors when you execute from CMD? It may be something in your %PATH% and/or %PYTHONPATH% system environment variables that's forcing the read from 32bit libs.. you can change these variables before importing using os.environ.set("PATH","semi-colon delimited list of folders to search") Note: this only changes the path variable for the currently executing python session not for all time or any other processes so it's safe to change without doing permanent damage. | |
Feb 28, 2018 at 23:41 | comment | added | wowohweewah | @MichaelStimson, it's 64-bit and background processing is enabled. Imports shouldn't be coming from 32-bit at all since 64-bit should be used. This toolbox works with lots of big data, 64-bit is basically a necessity. If python was run from the command line it's definitely 64-bit as I checked the environment variables. Seems like it will run in 64-bit but Arc checks syntax in 32-bit which raises the error before I can even load the toolbox. I don't know why Arc likes to switch between 32/64-bit python willy-nilly, but this wasn't an issue before I upgraded to 10.5 (from 10.2). | |
Feb 28, 2018 at 16:51 | comment | added | dslamb | Some other solutions are found here: stackoverflow.com/questions/18898131/… Also consider downloading the premade windows binaries from here: lfd.uci.edu/~gohlke/pythonlibs (They tend to work a lot better). Also try running your script outside of ArcGIS as a standalone; Python GUIs crash inside of the Arc environment. | |
Feb 27, 2018 at 22:38 | comment | added | Michael Stimson | Did you install the 64bit MatPlotLib? The import error looks like it can find the file but it's not a 32bit DLL as expected. You have mentioned 64bit background processing but are you actually using it? If you're using check syntax it's likely to be 32bit, same if you're running from command line... I would recommend ditching 64bit background geoprocessing altogether, it causes too many complications like this where half your imports are from 64bit and the other half are from 32bit python. | |
Feb 27, 2018 at 20:04 | history | edited | PolyGeo♦ | CC BY-SA 3.0 |
edited tags; edited title
|
Feb 27, 2018 at 18:54 | history | asked | wowohweewah | CC BY-SA 3.0 |