|
POST
|
Right, unfortunately that script still imports ArcPy, so it doesn't help determine whether the problem affects all Python code or is specifically within ArcPy. Can you see if this script runs successfully? try:
unicode
except:
print("In Python 3, all strings are unicode") If that also fails, it lets us know that the issue is affecting all Python code. If it prints the output, then its something in the relationship with ArcPy specifically. Cheers, Shaun
... View more
03-27-2023
08:37 AM
|
0
|
2
|
4027
|
|
POST
|
Got it. Pro ships with a very rudimentary IDE called IDLE, but for most users they'll want something more sophisticated. If you have choices, I would recommend looking at Visual Studio Code, you shouldn't need to do any work with custom environments to get it to work, you can point it at the Python environment that ships with Pro (arcgispro-py3). Spyder is a somewhat complicated case, because it also has all its dependencies managed through conda, but it can work. I would start by creating a cloned environment following these instructions: https://pro.arcgis.com/en/pro-app/latest/arcpy/get-started/clone-an-environment.htm Once you've created that custom environment, it should be possible to install spyder, but it isn't an entirely simple process. Some have had success adding it through pip, I would look at threads like this one for further feedback if Spyder is important to your workflow.
... View more
03-27-2023
08:30 AM
|
1
|
0
|
1372
|
|
POST
|
Right, the function returns a Raster object because you passed in a raster in the previous step. In your original example of hillshade = arcpy.sa.Hillshade(input_dem) the type of input_dem isn't explicit If you pass in a string or layer name, then hillshade will be a Result object, but if you are passing in a Raster object, you'll get a Raster result (this is how I'd recommend working with rasters from ArcPy). The scratch workspace can be different things, it isn't guaranteed to be a temporary location but is configuration dependent. You could set it to a temporary location yourself, you can also use the ARCTMPDIR environment variable to affect this behavior. If the location is e.g. a temporary folder inside of TEMP, it still won't be removed automatically, but would be cleaned up by some Windows processes or tools.
... View more
03-27-2023
08:25 AM
|
0
|
0
|
2445
|
|
POST
|
Probably for most cases where you want to work with more Python rasters, you'll want to start with arcpy.Raster, I think its documentation covers the general problem and some of your questions well, and while Zandbergen's book is solid, the documentation is generally authoritative. In the example you provided, the result will be an arcpy.Result object, but if you unwrap this with hs_raster = hillshade.getOutput(0), you'll get the resulting raster path. The location will be specified by the value of arcpy.env.scratchWorkspace. Using the raster class instead gives you a little more insight into the rasters and will let you work with them in a nicer way.
... View more
03-25-2023
07:48 PM
|
1
|
2
|
2476
|
|
POST
|
Where will you be using the layer? If you're working with the JavaScript API, you should be able to add it directly with https://developers.arcgis.com/javascript/latest/sample-code/layers-geojson/. If you'd like to use it more generally across products (e.g. add it to Pro), you might be better served by getting a free account from https://developers.arcgis.com/ and adding it as a normal feature service. You could do this with e.g. the Python API, and then you can just plug into the other systems which well understand feature services.
... View more
03-25-2023
07:16 PM
|
1
|
0
|
1433
|
|
POST
|
The first case is a known bug (BUG-000143771) that we will address in the next release. For the raster case, I'm less clear that would work by default, could you share what gave you that impression? If the raster is large enough, it would exhaust memory, and I would expect that the raster to be written to the disk by default. I believe it creates a temporary raster, so if for example you were chaining together operations, you could run save and allow the intermediary rasters to be discarded. Or if you explicitly know the raster will fit in memory, you can write the output to it directly with e.g. memory\hillshade as the output.
... View more
03-25-2023
06:58 PM
|
1
|
1
|
2480
|
|
POST
|
Did you do any specific configuration to add more verbose warnings or other configuration changes? I believe that VSCode + ArcPy is a common combination in use, and the `unicode` call, while failing, is expected to because it is wrapped in a try/except block which will raise on Python 3. These should ultimately be removed from the ArcPy code in the future, but I wouldn't expect a Python import to fail on them. You could check if only your code is set to debug, but also try making a dummy script with the same try / except lines as you're seeing raise, and see if that also fails. Cheers, Shaun
... View more
03-25-2023
06:43 PM
|
0
|
4
|
4037
|
|
POST
|
Can you describe what you're trying to accomplish? Pro ships with the Python API already, so unless you have reasons to need the very latest builds, you can use it from the default environment that ships with Pro. If you do need an even newer version, you can get it but don't think that post well covers the problem. By default, each release of Pro supports a specific major.minor version of the Python API, as parts of the Python distribution itself depend on the Python API and are tested at that major.minor release.
... View more
03-25-2023
06:37 PM
|
0
|
2
|
1385
|
|
POST
|
Got it. That would be great, once we have a clear set of interactions causing this we can get a reproducible case together and start debugging it. I don't think we have had anything like this happen before and wouldn't normally expect any interaction between the two "worlds" of .NET and Python.
... View more
03-22-2023
07:56 AM
|
1
|
9
|
2545
|
|
POST
|
Does your Python script work from the command line without the Pro SDK installed? It'd be good to see if this only happens specifically in an interaction with that component or is more broadly occurring. Thanks!
... View more
03-22-2023
07:45 AM
|
1
|
11
|
2547
|
|
IDEA
|
03-22-2023
07:00 AM
|
0
|
0
|
1328
|
|
IDEA
|
03-21-2023
02:55 PM
|
0
|
0
|
1345
|
|
POST
|
When you uninstall, the installer can only remove the files that it specifically laid down. If there are newer versions, or files it didn't install, it cannot delete them. The instructions provided ensure that there isn't anything left over which falls outside the scope of what the installer can do. When you create the environment with `conda create` and target packages, those packages will be downloaded from the internet independently of the installation. This differs from the normal installation process which uses `--clone` and copies the packages from the provided arcgispro-py3 environment. If there are issues with your arcgispro-py3 environment, cloning doesn't help because as you mention it will result in an equivalently corrupt environment, but creating a new environment doesn't suffer this same fate. Cheers, Shaun
... View more
03-21-2023
01:37 PM
|
1
|
0
|
3443
|
|
POST
|
OK, could you try creating a custom environment, set that as the active environment for Pro and see if it reproduces there? To isolate whether something is wrong with the default environment, try creating a fresh one from the command line with: conda create -n pro-custom arcpy=3.1
proswap pro-custom After that, try to reopen Pro and a notebook.
... View more
03-17-2023
09:53 AM
|
0
|
0
|
2551
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 11-24-2025 09:10 PM | |
| 1 | 08-12-2022 10:14 PM | |
| 1 | 05-05-2025 10:56 AM | |
| 1 | 04-04-2025 09:03 PM | |
| 1 | 02-09-2023 10:10 PM |
| Online Status |
Offline
|
| Date Last Visited |
12-19-2025
01:14 PM
|