JamesRamm / archook

Searches the system for arcgis and makes arcpy available to python (regardless of pythonpath/system path/registry settings)
GNU General Public License v2.0
81 stars 28 forks source link

Calling get_arcpy(pro=True) argument causes TypeError #25

Closed jesegal closed 4 years ago

jesegal commented 4 years ago

archook Version: 1.2.0 python 3.6

r = archook.get_arcpy(pro=True) TypeError: get_arcpy() got an unexpected keyword argument 'pro'

import archook r = archook.get_arcpy(pro=True) Traceback (most recent call last): File "", line 1, in TypeError: get_arcpy() got an unexpected keyword argument 'pro' r = archook.get_arcpy() r type(r) <class 'NoneType'>

mhw-at-yg commented 4 years ago

I don't think the archook version number can be right. Pro support wasn't added until afterwards. How did you install it?

jesegal commented 4 years ago

archook was installed into a virtual environment using: pip install archook

I've got both ArcGIS Desktop and Pro installed, but the Pro virtual env is activated when I did the above install.

jesegal commented 4 years ago

It installed using https://pypi.org/project/archook/ Looks like 1.2.0 is the only archook release there.

logan-pugh commented 4 years ago

@jesegal Until a new release is made I think you'll need to install using a git URL e.g. pip install git+https://github.com/JamesRamm/archook#egg=archook

jesegal commented 4 years ago

I'm still getting version 1.2.0 after following the suggestion supplied by @logan-pugh


(arcgispro-py3-clone2) C:\Users\jesegal\Source>pip install git+https://github.com/JamesRamm/archook#egg=archook Collecting archook Cloning https://github.com/JamesRamm/archook to c:\users\jesegal\appdata\local\temp\pip-install-4779nq37\archook Running command git clone -q https://github.com/JamesRamm/archook 'C:\Users\jesegal\AppData\Local\Temp\pip-install-4779nq37\archook' Building wheels for collected packages: archook Building wheel for archook (setup.py) ... done Created wheel for archook: filename=archook-1.2.0-py3-none-any.whl size=11183 sha256=deea304052c2be79b00e5256696b5412aab2d3c1631eebbb6c0d8ee065500d9f Stored in directory: C:\Users\jesegal\AppData\Local\Temp\pip-ephem-wheel-cache-ocvuszg5\wheels\5d\40\ef\8852a921be3251aa9154a69d3e8db4ca3d57432b53559a0bec Successfully built archook Installing collected packages: archook Successfully installed archook-1.2.0

logan-pugh commented 4 years ago

Hmm, you might try a few different things:

More info on this syntax here: https://pip.pypa.io/en/stable/reference/pip_install/#git

mhw-at-yg commented 4 years ago

Thanks for the extra info. The self-reported version number is wrong and I've opened a bug for that.

Do you still get the Type Error with this new install?

jesegal commented 4 years ago

Thanks for the assist, this helped. The Type Error issue is cleared. But there's a different problem now. It's failing with a KeyError as line 122, not liking that formatting using arguments by name with Py3.6. I'll open a new issue for that.

Python 3.6.6 |Anaconda, Inc.| (default, Jun 28 2018, 11:27:44) [MSC v.1900 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.

import archook archook.get_arcpy(pro=True) Traceback (most recent call last): File "", line 1, in File "C:\Users\jesegal\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone2\lib\site-packages\archook\archook.py", line 158, in get_arcpy winpaths, syspaths = get_pro_paths() File "C:\Users\jesegal\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone2\lib\site-packages\archook\archook.py", line 122, in get_pro_paths C, P KeyError: 'C'