|
POST
|
I too cannot create a new python env after updating, also spyder is no longer shown and I had that working just fine...what do I need to do to get spyder back? I can actually see the environments being created with the names I'm giving them, however the "manage environments" interface in arcgispro does not list them as a choice. I did the above suggestion and waited for the blue progress bar to stop...nothing. The docs and yourself refer to "restarting" arcgispro - is there some other way to "restart" other than exiting the program and relaunching it? my log (conda_debug.log --I don't have a "conda_log.txt" as above - should I?) indicates an issue with Numpy: INFO:conda.proconfig:Detected ArcGISPro as product DEBUG:__main__:conda.cli.main called with ('C:\\Program Files\\ArcGIS\\Pro\\bin\\Python\\Scripts\\conda.exe', 'proswap', '-p', 'C:\\Users\\xxx\\AppData\\Local\\ESRI\\conda\\envs\\Python3', '--json') DEBUG:__main__:Ignoring first argument (C:\Program Files\ArcGIS\Pro\bin\Python\Scripts\conda.exe), as it is not a subcommand Swap: Directory environment detected Swap: Received request for proswap to local environment C:\Users\xxx\AppData\Local\ESRI\conda\envs\Python3 Swap: After path resolution, environment is C:\Users\xxx\AppData\Local\ESRI\conda\envs\Python3, named Python3, is local? True Swap: The environment C:\Users\xxx\AppData\Local\ESRI\conda\envs\Python3 doesn't contain NumPy, which is required for ArcGIS Pro. Any Ideas?
... View more
07-06-2018
12:08 PM
|
0
|
3
|
2591
|
|
POST
|
This just happened to me on Windows 10, how did you fix this again? I'm installing 10.6...
... View more
06-25-2018
12:40 PM
|
0
|
1
|
3008
|
|
POST
|
Did you figure out a workaround for KML for the error you mention above? We're still getting the "Unable to load" error on local KML files we try to upload while building the app in WAB dev edition...thanks!
... View more
05-14-2018
10:13 AM
|
0
|
1
|
381
|
|
POST
|
So this is from that post - "The following code would turn off SSL certification entirely - can you check if it resolves this problem? However, please note that this isn't a safe thing to do as it turns off SSL certification verficiation for the python process and isn't recommended for production. import ssl
ssl._create_default_https_context = ssl._create_unverified_context
gis = ... " --where would I insert this into the code above? In order to completely disable SSL just for testing...the "I just use :6443" part of that thread -I get the same error, but I'd like to try simply disabling SSL, - or can you suggest what I should do exactly to the code above from that thread? Thanks!
... View more
05-07-2018
03:31 PM
|
0
|
2
|
2517
|
|
POST
|
Do you mean 7443(Portal) or 6443(Server) here? I'm having the same issue...thanks!
... View more
05-07-2018
03:18 PM
|
0
|
0
|
7630
|
|
POST
|
I'm trying to run this script against our federated Portal to add basemaps for offline. The only way I can seem to access our Portal (I've tested in jupyter notebook) without SSL errors thru python is if I include the "verify_cert=False" parameter. Can someone please show me how to modify the "prepareEsriBasemapsForOfflineUse.py" python script such that the certificate errors are ignored? Like where exactly I should insert the "verify_cert=False" parameter below (python noob here). I seem to recall not having this problem on one of our older servers with this script, maybe one that wasn't https... Thanks in advance! IOError: [Errno socket error] [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661) #!/usr/bin/env python
# Requires Python 2.7+
# Sample Usage:
# python addOfflineBasemaps.py -u <destinationPortal> -o <portalAdmin>
# -s <portalPassword> -f <destFolder>
# -a <agoUsername> -p <agoPassword>
import urllib
import json
import argparse
def generateToken(username, password, portalUrl):
'''Retrieves a token to be used with API requests.'''
parameters = urllib.urlencode({'username' : username,
'password' : password,
'client' : 'referer',
'referer': portalUrl,
'expiration': 60,
'f' : 'json'})
response = urllib.urlopen(portalUrl + '/sharing/rest/generateToken?',
parameters).read()
try:
jsonResponse = json.loads(response)
if 'token' in jsonResponse:
return jsonResponse['token']
elif 'error' in jsonResponse:
print jsonResponse['error']['message']
for detail in jsonResponse['error']['details']:
print detail
except ValueError, e:
print 'An unspecified error occurred.'
print e
def searchPortal(portal, query=None, totalResults=None, sortField='numviews',
sortOrder='desc', token=''):
'''
Search the portal using the specified query and search parameters.
Optionally provide a token to return results visible to that user.
'''
# Default results are returned by highest
# number of views in descending order.
allResults = []
if not totalResults or totalResults > 100:
numResults = 100
else:
numResults = totalResults
results = __search__(portal, query, numResults, sortField, sortOrder, 0,
token)
if not 'error' in results.keys():
if not totalResults:
totalResults = results['total'] # Return all of the results.
allResults.extend(results['results'])
while (results['nextStart'] > 0 and
results['nextStart'] < totalResults):
# Do some math to ensure it only
# returns the total results requested.
numResults = min(totalResults - results['nextStart'] + 1, 100)
results = __search__(portal=portal, query=query,
numResults=numResults, sortField=sortField,
sortOrder=sortOrder, token=token,
start=results['nextStart'])
allResults.extend(results['results'])
return allResults
else:
print results['error']['message']
return results
def __search__(portal, query=None, numResults=100, sortField='numviews',
sortOrder='desc', start=0, token=None):
'''Retrieve a single page of search results.'''
params = {
'q': query,
'num': numResults,
'sortField': sortField,
'sortOrder': sortOrder,
'f': 'json',
'start': start
}
if token:
# Adding a token provides an authenticated search.
params['token'] = token
request = portal + '/sharing/rest/search?' + urllib.urlencode(params)
results = json.loads(urllib.urlopen(request).read())
return results
def groupSearch(query, portalUrl, token=''):
'''Search for groups matching the specified query.'''
# Example 1: query all groups owned by a user.
# 'owner:johndoe'
# Example 2: query groups with Operations in the name.
# 'Operations'
# Example 3: query all groups with public access.
# 'access:public'
parameters = urllib.urlencode({'q': query, 'token': token, 'f': 'json'})
request = (portalUrl + '/sharing/rest/community/groups?' + parameters)
groups = json.loads(urllib.urlopen(request).read())
return groups['results']
def getUserContent(username, portalUrl, token):
''''''
parameters = urllib.urlencode({'token': token, 'f': 'json'})
request = (portalUrl + '/sharing/rest/content/users/' + username +
'?' + parameters)
print request
content = urllib.urlopen(request).read()
return json.loads(content)
def getItemDescription(itemId, portalUrl, token=''):
'''Returns the description for a Portal for ArcGIS item.'''
parameters = urllib.urlencode({'token' : token,
'f' : 'json'})
response = urllib.urlopen(portalUrl + "/sharing/rest/content/items/" +
itemId + "?" + parameters).read()
return json.loads(unicode(response, 'utf-8'))
def createFolder(username, title, portalUrl, token):
'''Creates a new folder in a user's content.'''
parameters = urllib.urlencode({'title': title,
'token' : token,
'f' : 'json'})
response = urllib.urlopen(portalUrl + '/sharing/rest/content/users/' +
username + '/createFolder?', parameters).read()
return json.loads(response)
def addServiceItem(username, folder, description, serviceUrl, portalUrl,
token, thumbnailUrl='', serviceUsername=None,
servicePassword=None):
'''Creates a new item in a user's content.'''
# Update the description with unicode safe values.
descriptionJSON = __decodeDict__(json.loads(description))
parameters = {'item': descriptionJSON['title'],
'url': serviceUrl,
'thumbnailurl': thumbnailUrl,
'overwrite': 'false',
'token' : token,
'f' : 'json'}
if serviceUsername and servicePassword:
# Store the credentials with the service.
parameters.update({'serviceUsername': serviceUsername,
'servicePassword': servicePassword})
# Add the item's description (with safe values for unicode).
parameters.update(descriptionJSON)
# Encode and post the item.
postParameters = urllib.urlencode(parameters)
response = urllib.urlopen(portalUrl + '/sharing/rest/content/users/' +
username + '/' + folder + '/addItem?',
postParameters).read()
return json.loads(response)
# Helper functions for decoding the unicode values in the response json.
def __decodeDict__(dct):
newdict = {}
for k, v in dct.iteritems():
k = __safeValue__(k)
v = __safeValue__(v)
newdict[k] = v
return newdict
def __safeValue__(inVal):
outVal = inVal
if isinstance(inVal, unicode):
outVal = inVal.encode('utf-8')
elif isinstance(inVal, list):
outVal = __decode_list__(inVal)
return outVal
def __decode_list__(lst):
newList = []
for i in lst:
i = __safeValue__(i)
newList.append(i)
return newList
# Run the script.
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('-u', '--portal', required=True,
help=('url of the Portal (e.g. '
'https://portal.domain.com:7443/arcgis)'))
parser.add_argument('-o', '--portalAdmin', required=True,
help='Portal admin username')
parser.add_argument('-s', '--portalPassword', required=True,
help='Portal admin password')
parser.add_argument('-a', '--agoAdmin', required=True,
help='ArcGIS Online admin username')
parser.add_argument('-p', '--agoPassword', required=True,
help='ArcGIS Online admin password')
parser.add_argument('-f', '--folder', required=False,
help='Optional destination folder')
# Read the command line arguments.
args = parser.parse_args()
agoAdmin = args.agoAdmin
agoPassword = args.agoPassword
portal = args.portal
portalAdmin = args.portalAdmin
portalPassword = args.portalPassword
folderTitle = args.folder
# Get a token for the Portal for ArcGIS.
print 'Getting token for ' + portal
token = generateToken(username=portalAdmin, password=portalPassword,
portalUrl=portal)
# Get the destination folder ID.
folderId = ''
if folderTitle == None:
# No folder specified. Folder is root.
print 'Using the root folder...'
folderId = '/'
else:
# Check if the folder already exists.
userContent = getUserContent(portalAdmin, portal, token)
for folder in userContent['folders']:
if folder['title'] == folderTitle:
folderId = folder['id']
# Create the folder if it was not found.
if folderId == '':
print 'Creating folder ' + args.folder + '...'
newFolder = createFolder(portalAdmin, folderTitle, portal, token)
folderId = newFolder['folder']['id']
print 'Using folder ' + folderTitle + ' (id:' + folderId + ')'
# Get the ArcGIS Online group ID.
query = 'owner:esri title:Tiled Basemaps'
# Search for the public ArcGIS Online group (no token needed).
sourceGroup = groupSearch(query, 'https://www.arcgis.com')[0]['id']
# Get the items in the ArcGIS Online group specified above.
basemaps = searchPortal('https://www.arcgis.com', 'group:' + sourceGroup)
# Add the basemaps as new items in the Portal.
for basemap in basemaps:
# Get the item description.
description = getItemDescription(basemap['id'],
'https://www.arcgis.com')
serviceUrl = description['url']
thumbUrl = ('https://www.arcgis.com' +
'/sharing/rest/content/items/' + description['id'] +
'/info/' + description['thumbnail'])
newDescription = json.dumps(
{'title': description['title'],
'type': description['type'],
'snippet': description['snippet'],
'description': description['description'],
'licenseInfo': description['licenseInfo'],
'tags': ','.join(description['tags']),
'typeKeywords': ','.join(description['typeKeywords']),
'accessInformation': description['accessInformation']}
)
try:
result = addServiceItem(portalAdmin, folderId, newDescription,
serviceUrl, portal, token, thumbUrl,
agoAdmin, agoPassword)
if 'success' in result:
print 'Successfully added ' + basemap['title']
elif 'error' in result:
print 'Error copying ' + basemap['title']
print result['error']['message']
for detail in result['error']['details']:
print detail
else:
print 'Error copying ' + basemap['title']
print 'An unhandled error occurred.'
except:
print 'Error copying ' + basemap['title']
print 'An unhandled exception occurred.'
print 'Copying complete.'
... View more
05-04-2018
11:16 AM
|
0
|
4
|
3304
|
|
POST
|
I'm trying to run the example python script here: Example: Prepare Esri basemaps for use in offline workflows—Portal for ArcGIS (10.5.x) | ArcGIS Enterprise and am getting the same error on our 10.5.1 Portal - could you show me how to bypass the SSL error using this script as an example? Thanks!
... View more
05-03-2018
02:36 PM
|
0
|
0
|
3897
|
|
POST
|
Do you have a webappbuilder app located on your ArcGIS.com or Portal My Content? This will give you the secret ID to register your webappbuilder, when you launch the .bat it'll look to this registered webapp. You should only have to do it once.
... View more
02-06-2018
10:42 AM
|
1
|
1
|
14769
|
|
POST
|
Hi Dan - I'm not generating it, it just looks like that in our Portal - wondering if something went wrong during install/etc. These are existing tags entered for our Portal items, they used to look fine, now they look like that.
... View more
04-25-2017
03:02 PM
|
0
|
1
|
977
|
|
POST
|
Why are my tags, seen in the My Content Item Details, now preceded with a "u 'tag-text-right-here'" in my Portal? Basically all of our tags now look like - u 'tag1', u 'tag2' etc. --thanks!
... View more
04-25-2017
10:18 AM
|
0
|
3
|
1438
|
|
POST
|
Hi Kelly Hutchins - we didn't have any luck with tech support today, is there any way I could IM you the address of one of our webapps, just to see if you're seeing the same thing?
... View more
01-05-2017
01:49 PM
|
0
|
1
|
1882
|
|
POST
|
Hi Kelly - I don't, actually everything's behind our firewall. I just commented here because this is the same exact behaviour we're seeing and I was curious, it started on Monday, previous Friday everything was fine. Our IT dept. indicated that they applied an MS/Windows patch on Fri., I looked and the patch affects IE and Windows Server 2012, possibly that has something to do with it? Not sure, but FF/Chrome started throwing same error "Unable to load //xxxx.xxxx.com/portal/sharing/rest/portals/self?f=json&dojo.preventCache=1483641xxx790 status: 0" however IE still works.
... View more
01-05-2017
10:38 AM
|
0
|
2
|
1882
|
|
POST
|
Do you guys have any suggestions on how I could modify this page to include elevation(z) inside that popup derived from the Terrain Layer service? Essentially I'm trying to make that x/y, lat/long popup, except with an elevation from the best source possible, I was thinking the terrain service, but if there's another good elevation source (open source, etc.) that would work in this context I'd love to hear about it - thanks in advance for any ideas!
... View more
01-05-2017
10:12 AM
|
0
|
2
|
6898
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-12-2022 03:29 PM | |
| 1 | 10-24-2024 10:49 AM | |
| 4 | 10-24-2024 12:36 PM | |
| 1 | 10-24-2024 10:21 AM | |
| 6 | 09-06-2024 11:10 AM |
| Online Status |
Offline
|
| Date Last Visited |
Monday
|