Bolton-and-Menk-GIS / restapi

Python API designed to work externally with ArcGIS REST Services to query and extract data, and view service properties. Uses arcpy for some functions if available, otherwise uses open source alternatives to interact with the ArcGIS REST API. Also includes a subpackage for administering ArcGIS Server Sites.
GNU General Public License v2.0
93 stars 31 forks source link

ValueError: 'fields' in __slots__ conflicts with class variable #17

Closed geofbaum closed 4 years ago

geofbaum commented 6 years ago

Installed this today to play around with it, however I've gotten two errors now one of which I was able to bypass and this one: ValueError: 'fields' in __slots__ conflicts with class variable

I do not know if the first one that I attempted to fix caused this one but my first issue was that I was getting a Module not found error for the shp_helper module as it was being called from open_restapi. I was able to make it find the shp_help file by changing the import statement in open_restapi to from restapi import shp_helper but that has lead me to this new error.

I'm just testing it through a jupyter notebook, and I'm running it on a Win10 64bit system. Python version is 3.6.3. Here is the full error info from the notebook output.

D:\Anaconda3\lib\site-packages\restapi\common_types.py:61: UserWarning: No Arcpy found, some limitations in functionality may apply.
  warnings.warn('No Arcpy found, some limitations in functionality may apply.')

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
D:\Anaconda3\lib\site-packages\restapi\common_types.py in <module>()
     53 
---> 54     import arcpy
     55     from .arc_restapi import *

ModuleNotFoundError: No module named 'arcpy'

During handling of the above exception, another exception occurred:

ValueError                                Traceback (most recent call last)
<ipython-input-7-ee02b14c4dc4> in <module>()
----> 1 import restapi

D:\Anaconda3\lib\site-packages\restapi\__init__.py in <module>()
     11 #-------------------------------------------------------------------------------
     12 from . import _strings
---> 13 from .common_types import *
     14 try:
     15     from . import admin

D:\Anaconda3\lib\site-packages\restapi\common_types.py in <module>()
     60     setattr(sys.modules[__name__], '__opensource__', True)
     61     warnings.warn('No Arcpy found, some limitations in functionality may apply.')
---> 62     from .open_restapi import *
     63     has_arcpy = False
     64     class Callable(object):

D:\Anaconda3\lib\site-packages\restapi\open_restapi.py in <module>()
    479         return '<restapi.GeometryCollection [{}]>'.format(self.geometryType)
    480 
--> 481 class GeocodeHandler(object):
    482     """class to handle geocode results"""
    483     __slots__ = [SPATIAL_REFERENCE, 'results', FIELDS, 'formattedResults']

ValueError: 'fields' in __slots__ conflicts with class variable

Please let me know if I can provide any more information.

CalebM1987 commented 6 years ago

Sorry for getting to this so late, I will look into this.

msaminsky commented 6 years ago

Having the exact same issues and error messages running on the Ubuntu WSL Windows 10, python 3.6.5. I'll try running it through Windows python environment to see if I hit the same issues.

CalebM1987 commented 5 years ago

Is this still an issue? I commented out the __slots__ line a while back, but forgot to post here. I have been slacking on my maintenance of this package :(

philnagel commented 4 years ago

Haven't heard a response on this, so we'll assume this has been resolved. Feel free to re-open if needed.