I don't want to use conda in ArcGIS Pro. What are my options?
October 7, 2020 1:00 PM   Subscribe

Is there a good guide for how to use Pip to install packages for ArcGIS Pro? Or do you have advice for a better way to do it?

The Python package manager in ArcGIS Pro, conda, does not work well, and I want to use something small and effective, like Pip. I tried using Anaconda, but that required installing an Ubuntu subsystem on Windows, and I couldn't figure out how to get it to talk to ArcGIS Pro. Also, I have been warned that I need to install packages using conda or else they won't interact with ArcGIS Pro.
posted by Alex Haist to Computers & Internet (6 answers total) 1 user marked this as a favorite
 
Best answer: I don’t know ArcGIS Pro specifically but am pretty familiar with the other tools you mentioned. First of all Anaconda is just a specific distribution of conda (the other main one is “miniconda” which just comes with less stuff installed by default), so it’s not a conda replacement. Next, conda and pip may both be “package managers” in a sense, but they have different and complementary functions. Specifically, conda allows you to set up an “environment,” the purpose of which is to let you have different versions of Python itself installed without conflicting with one another, as well as both Python packages and non-Python tools. If you have some big analysis pipeline, having the wrong version of something or not being able to install some library can break the whole thing, hence conda (it’s also great if you don’t have root access to a machine). Pip on the other hand is only for managing Python libraries; it automates downloading and installing them. Dealing with conda environments is just out of its scope. Also your system’s pip is by default going to install Python packages system-wide, which may or may not be “visible” within a conda environment. Because of that people usually recommend that if you do use conda for a project, that you also use it to manage Python dependencies.

That said, there is a way to use pip itself inside a conda environment. You have to first activate your environment and then run conda install pip (and then make sure you’re actually using the conda environment’s pip instead of your system’s pip). If you do things this way then pip should be able to install Python packages in a way that ArcGIS can hopefully see them (again, with the caveat that I haven’t used it — but I do use other tools that are distributed as conda environments).

The other thing I’ll say is that it sounds like you may be running into issues with conda’s speed. To some extent this is just the name of the game (and I’ve heard it’s worse on Windows because of something to do with the filesystem). However there are a few tricks you can try. The first is to use mamba (sorry on my phone and can’t link) which is an alternate solver that is a kind of “drop in” replacement and that in my experience is much faster. You can just use mamba install wherever you would normally use conda install. Other tricks include setting strict channel priority. This is a long shot but I would also make sure you’re not running conda off of a network share or some other very slow drive; it does a lot of little file transactions that can take forever if you’re limited by disk I/O.
posted by en forme de poire at 10:36 PM on October 7, 2020 [1 favorite]


2nding everything pear shaped says above, and although you seem pretty determined anaconda doesn't work for you it might be worth posting some details of what seems to be wrong. It can be very frustrating if you have two packages that won't both install due to conflicting dependencies especially after it's spent ages downloading stuff.
posted by samj at 1:18 AM on October 8, 2020 [1 favorite]


Response by poster: Anaconda seems to be too much for my computer. It freezes and glitches and takes forever to do anything.
posted by Alex Haist at 8:34 AM on October 8, 2020


Can you be more specific? Here’s a few questions that get at what I mean: At what points do you see freezing and glitching? Is it solving the environment that’s slow, or something else? If you have the process manager open, is it using all of your CPU or memory? Also, how old is your computer and what are the specs?
posted by en forme de poire at 9:28 AM on October 8, 2020


Response by poster: I have something a bit embarrassing to admit after en forme de poire's thoughtful, detailed, and kind reply. (Although, to be fair, telling me that mamba might work did inspire me to find the actual solution to this problem, and also, I learned things about the differences between pip and conda!)

The actual solution: It had not occurred to me to use the Python command console to update packages. I would open ArcGIS, go to the Python package manager, and try to do things from there. However, when I use "condo install package" in the Python command console, everything works well. I'm afraid I'm new enough to all of this that I didn't ask the right question.

As for Anaconda, I would have to reinstall it to replicate the problems, and perhaps I will do so some day! But right now, conda installed from ArcGIS Pro and the Python command console are happily installing packages in the correct cloned environment in ArcGIS Pro.
posted by Alex Haist at 9:53 AM on October 8, 2020 [1 favorite]


Awesome! Glad I could help, and don’t feel bad, these shaggy scientific computing juggernauts have a whole mess of moving parts to keep straight.
posted by en forme de poire at 8:14 PM on October 8, 2020 [1 favorite]


« Older Can I reverse a compression on a JPEG   |   Best science-based parenting books Newer »
This thread is closed to new comments.