Esri / ArcREST

python package for REST API (AGS, AGOL, webmap JSON, etc..)
Apache License 2.0
192 stars 155 forks source link

ArcREST ImportError: No module named Security #257

Closed GitGwest closed 8 years ago

GitGwest commented 8 years ago

ArcRest or ArcRestHelper

I have two scripts that I am testing, one of which worked fine until yesterday afternoon, however the code wasn't changed. When I execute the addItem sample, I receive the following error. Has there been an update to the ArcRest folder or security.py?

File "C:/GISDEV01/dropbox_to_AGOL.py", line 7, in from arcresthelper import securityhandlerhelper File "C:\Users\gwest\AppData\Local\Continuum\Anaconda2\arcresthelperinit.py", line 4, in from . import featureservicetools File "C:\Users\gwest\AppData\Local\Continuum\Anaconda2\arcresthelper\featureservicetools.py", line 5, in from .securityhandlerhelper import securityhandlerhelper File "C:\Users\gwest\AppData\Local\Continuum\Anaconda2\arcresthelper\securityhandlerhelper.py", line 5, in from arcrest import security ImportError: cannot import name security

The second error that I receive when executing addItem_webmap is;

Traceback (most recent call last): File "C:/GISDEV01/arcrest.py", line 92, in securityHandler = security.AGOLTokenSecurityHandler(username, NameError: name 'security' is not defined

Process finished with exit code 1

achapkowski commented 8 years ago

@GitGwest there has been no update.

Please ensure the packages exist. Maybe try reinstalling them.

GitGwest commented 8 years ago

The packages do exist, I've re-installed several times. I will try re-starting. I just tried to add the line from.arcrest.security import security in the addItem_webmap sample, and received

Traceback (most recent call last): File "C:/GISDEV01/dropbox_to_AGOL.py", line 5, in import arcrest File "C:\GISDEV01\arcrest.py", line 10, in from arcrest.security import security ImportError: No module named security

achapkowski commented 8 years ago

@GitGwest did you pull the dev or master branch?

The python file is right here: https://github.com/Esri/ArcREST/blob/master/src/arcrest/security/security.py

GitGwest commented 8 years ago

@achapkowski Master Branch

achapkowski commented 8 years ago

@GitGwest what version of python?

achapkowski commented 8 years ago

@GitGwest I just tested in Python 2.7.10, 3.4 and 3.5 all worked.

GitGwest commented 8 years ago

@achapkowski Python 2.7, can you verify where the install should be placed? I have been installing ArcRest and arcresthelper under site-packages

GitGwest commented 8 years ago

I just tried a fresh install in a completely new environment, and I receive the same error.

Traceback (most recent call last): File "C:/Documents and Settings/gwest/My Documents/untitled/arcrest.py", line 8, in import arcrest File "C:\Documents and Settings\gwest\My Documents\untitled\arcrest.py", line 10, in from arcrest import security ImportError: cannot import name security

GitGwest commented 8 years ago

Not sure what the issue was; but everything is working correctly now.