ArcREST icon indicating copy to clipboard operation
ArcREST copied to clipboard

arcrest_package on PyPi doesn't work with getting started example

Open tbuckl opened this issue 9 years ago • 6 comments

the upside is that i installed from a git clone and python setup.py and everything worked fine. the downside is that the readme does not suggest that solution.

my setup: Python 2.7.11 | Anaconda 2.3.0 (x86_64)

install using pip install arcrest_package

the code here:
https://github.com/Esri/ArcREST#getting-started

throws the following error

ArcRestHelperError                        Traceback (most recent call last)
test.py in <module>()
      3 
      4 config = {'username': 'username', 'password': 'password'}
----> 5 token = securityhandlerhelper.securityhandlerhelper(config)
      6 admin = arcrest.manageorg.Administration(securityHandler=token.securityhandler)
      7 content = admin.content

/Users/thomasbuckley/anaconda/lib/python2.7/site-packages/arcresthelper/securityhandlerhelper.pyc in __init__(self, securityinfo)
    357                 "line": line,
    358                 "filename":  filename,
--> 359                 "synerror": synerror,
    360             })
    361 

ArcRestHelperError: {'function': 'securityhandlerhelper_init', 'line': 'line 292', 'synerror': "KeyError: 'security_type'", 'filename': '/anaconda/lib/python2.7/site-packages/arcresthelper/securityhandlerhelper.py'}

tbuckl avatar Sep 06 '16 22:09 tbuckl

Wait- I am getting this error as well. Installed through PyCharm. How does one fix this?

traggatmot avatar Dec 12 '16 15:12 traggatmot

is there a quick work around? Directions to install differently? This problem is on my work computer, Window 10 pro, and I am unfamiliar with how to install differently than thru PyCharm (all my previous python work was on a mac, and I had a workable understanding of that process).

traggatmot avatar Dec 12 '16 15:12 traggatmot

just place the arcrest and arcresthelper folders into site-packages in you python folder.

MikeMillerGIS avatar Dec 12 '16 16:12 MikeMillerGIS

I did that and it didn't work.

traggatmot avatar Dec 12 '16 16:12 traggatmot

I tested this both on 2.7 and 3.x. The version in master works fine. I think we need to update pypi with this version. @achapkowski

MikeMillerGIS avatar Jan 09 '17 13:01 MikeMillerGIS

I also tried installing this through PIP. It states it successfully installed arcrest-package-3.5.6 and import arcrest statements work. However, I can't get connected to AGOL when running the script through IDLE.

Very simple sample code from here:

import arcrest
username = "myusername"
password = "mypwd"
sh = arcrest.AGOLTokenSecurityHandler(username, password)

leads to AttributeError: 'module' object has no attribute 'AGOLTokenSecurityHandler'

Sample code from the Github readme:

import arcrest
from arcresthelper import securityhandlerhelper
config = {
	"username": "myusername",
	"password": "mypwd"
}
token = securityhandlerhelper.securityhandlerhelper(config)
admin = arcrest.manageorg.Administration(securityHandler=token.securityhandler)
content = admin.content
userInfo = content.users.user()
userInfo.folders

leads to

Traceback (most recent call last):
  File "C:\repos\vegetation\functions\test.py", line 8, in <module>
    from arcresthelper import securityhandlerhelper
  File "C:\Python27\ArcGIS10.2\lib\site-packages\arcresthelper\__init__.py", line 4, in <module>
    from . import featureservicetools
  File "C:\Python27\ArcGIS10.2\lib\site-packages\arcresthelper\featureservicetools.py", line 5, in <module>
    from .securityhandlerhelper import securityhandlerhelper
  File "C:\Python27\ArcGIS10.2\lib\site-packages\arcresthelper\securityhandlerhelper.py", line 5, in <module>
    from arcrest import security
ImportError: cannot import name security

pfgis avatar Jan 13 '17 12:01 pfgis