Select to view content in your preferred language

Using the Python API with Minimum Dependencies in v2.4.0+

380
2
03-26-2025 02:36 PM
fdeters
Regular Contributor

TL;DR: 2.4.0 apparently broke the ability to work with content in the API without installing a bunch of unnecessary dependencies. I would love to be wrong!

---

Following the guidance on using the Python API with minimum dependencies, I've happily set up several projects to only use the content management tools available in the API. I love this capability because it greatly reduces install time and disk size when using virtual environments.

Before 2.4.0, my process looked something like this:

python -m venv venv
venv/scripts/activate

pip install arcgis --no-deps

Which I would then follow with installing other minimum dependencies for the Python API, including those listed in the documentation (plus several that were not listed). I could then easily access and manipulate WebMap objects.

In 2.4.0

With the 2.4.0 release of the API, it seems that I can no longer work with Web Maps in a setup with minimum dependencies. When I try to import the new Map class `from arcgis.map import Map`, I get a message that there is no `arcgis.map` module. Indeed, looking in my `venv/Lib` folder, there is no `map` module inside `arcgis`. 

After some digging around, I figured I needed to install the separate `arcgis-mapping` package. This is where the real problems begin:

  1. I tried `pip install arcgis-mapping`. That brought a whole bunch of unnecessary dependencies along.
  2. I tried `pip install arcgis-mapping --no-deps`. That worked!
  3. I ran my script `python main.py`. Oops, I'm missing some minimum dependencies for `arcgis-mapping`. No big deal.
  4. I start installing the dependencies as the error messages call for them. Before too long, I'm installing IPython and a bunch of other dependencies that (I think) shouldn't be necessary to work with a Web Map.

So at this point, it seems to me that I can't work with a Map object without installing a lot of dependencies that I don't need. Is there a way to still use the API with minimum dependencies?

2 Replies
DanPatterson
MVP Esteemed Contributor

Since you have found the link, regarding minimum dependencies, it might be worthwhile looking at the "issues" section of their github site to see if any similar questions have popped up and been closed

Esri/arcgis-python-api: Documentation and samples for ArcGIS API for Python

I would post a query directly on their github site, it gets more traffic from the developers than here


... sort of retired...
fdeters
Regular Contributor

Thanks @DanPatterson, I'll make an issue in the GitHub repo (didn't see any existing open or closed issues that looked similar).

0 Kudos