How to initialize arcgis python library

529
4
Jump to solution
01-11-2021 01:08 AM
tino415
New Contributor II

Hello,

I'm triing python arcgis sdk and I did:

```bash

pip install arcgis

```

And then

```python

from arcgis.gis import GIS
from arcgis.features import GeoAccessor, GeoSeriesAccessor

```

And I get

```

Traceback (most recent call last):

File "/usr/local/lib/python3.5/site-packages/IPython/core/interactiveshell.py", line 3325, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)

File "<ipython-input-4-876ff2e6ffd8>", line 2, in <module>
from arcgis.features import GeoAccessor, GeoSeriesAccessor

File "/usr/local/lib/python3.5/site-packages/arcgis/__init__.py", line 3, in <module>
from . import (features, geoanalytics, geocoding, geometry,

File "/usr/local/lib/python3.5/site-packages/arcgis/features/__init__.py", line 22, in <module>
from .layer import FeatureLayer, Table, FeatureLayerCollection

File "/usr/local/lib/python3.5/site-packages/arcgis/features/layer.py", line 254
attachment_path = os.path.join(path, f'{md5_hash}.jpg')
^
SyntaxError: invalid syntax

```

What is going on?

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
DanPatterson
MVP Esteemed Contributor
0 Kudos
4 Replies
DanPatterson
MVP Esteemed Contributor

You probably don't have the correct relase number if you are using python 3.5 since the most current uses python 3.6.x  See the instructions for creating and environment and installing using conda

ArcGIS API For Python | ArcGIS for Developers

 


... sort of retired...
0 Kudos
tino415
New Contributor II

Thank you for your answer,

mentioned tutorial is using arcgis pro I'm not sure if it is same thing as the thing I have in jp notebooks in arcgis online,

secondli when I check pip package I installed on https://pypi.org/project/arcgis/ it list 3.5 as supported python version and esri is there mentioned as mantainer, should I consider this package as something outdated and no longer supported or unofficial? If it is unofficial, is there place where I can report a issue?

Sadly, task I'm working have limited resources, I think it is not feasible to update python or change package manager (I noticed tutorial is using conda)

I managed to achieve what I wan't using nodejs sdk since it is also used in target environment...

0 Kudos
tino415
New Contributor II

*If it is unofficialofficial, is there place where I can report a issue?

0 Kudos
DanPatterson
MVP Esteemed Contributor

The github site is the best place to report issues

Esri/arcgis-python-api: Documentation and samples for ArcGIS API for Python (github.com)

 


... sort of retired...
0 Kudos