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-202202.1.2045.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ffe998b6ecb63e005bfd2a76ce1b5d6ec6ce07420e6214574a7f1df26dfb24a4 |
|
MD5 | 8e4b0ca2e487c71bef3a2a38992e0c98 |
|
BLAKE2b-256 | 569f1ed5004ab7c9e9c7cba55a6bfa739dda92f5ac3f0d1ba6f93d18dd8acf6d |
Hashes for archook_dbc-202202.1.2045-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ecdfc1f39644623b393b2d9aeb16d232740829ef5cc39ab05d20cb82986f813 |
|
MD5 | 0f2760af22c8e2b970878786cf006249 |
|
BLAKE2b-256 | 4cf6055da02482ba7d958956099212203479fdead24be234acd92ab4032092e7 |