Locates arcpy and makes it available to the running python distribution
Project description
archook
Searches the (windows) system for arcgis and makes arcpy available to python (regardless of pythonpath/system path/registry settings). It's typically used when using a python distribution that's wasn't installed by ArcGIS. Ones downloaded direct from Python.org or a conda environment for two examples.
If ArcGIS is not found, an ImportError
is thrown.
Use pro=True
to target ArcGIS Pro instead of ArcGIS Desktop.
Example usage
ArcGIS Desktop
try:
import archook #The module which locates arcgis
archook.get_arcpy()
import arcpy
except ImportError:
# do whatever you do if arcpy isnt there.
ArcGIS Pro
try:
import archook #The module which locates arcgis
archook.get_arcpy(pro=True)
import arcpy
except ImportError:
# do whatever you do if arcpy isnt there.
Note: You may need to create a conda-meta
directory in your Python interpreter's directory (referred to by sys.prefix
) if you get an error like the following:
ImportError("arcpy needs to run within an active ArcGIS Conda environment")
Installation
Regular install with pip:
pip install archook
Install in developer mode using Git:
git clone https://github.com/JamesRamm/archook.git
pip install --editable .\archook
Install in developer mode manually:
- Fetch https://github.com/JamesRamm/archook/archive/master.zip
- unzip
%userprofile%\downloads\archook-master.zip
- run
pip install --editable path\to\archook-master
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for archook_dbc-202012.2.1925.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | cba3ad0556f463dc0b16c981e66c75c57392821c63126b1f3772ffe321e75fa8 |
|
MD5 | d67bbc33c9f838afd6045c7fa6c4af9f |
|
BLAKE2b-256 | 6235801eb71f1f6e228a1f2da4ee58e22e7553f840becfbcbc60ba47f28fbee0 |
Hashes for archook_dbc-202012.2.1925-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c7ad5f8627da9d52216f0d733425a2b215dd517e68990a1e79641eef3b988a7 |
|
MD5 | 5373bea5e150f6760e839e328c614b6c |
|
BLAKE2b-256 | 0aa2d108edd6b654b743df60368d7b50a61d683e7ce22d138de60356fe06bc31 |