Error 210 in ArcGIS Pro / ArcGIS Notebook

1496
6
03-10-2020 02:10 PM
deleted-user-3K8mKpoPb261
New Contributor III

Hi,

Could someone help why I'm having Error 210 on this script?

For info, I'm running the script using ArcGIS Notebook with ArcGIS Pro.

6 Replies
DanPatterson_Retired
MVP Emeritus

a *.dbf file has to go into a folder, If you want a geodatabase table, then a *.gdb needs to be specified

Your workspace name doesn't look right

0 Kudos
deleted-user-3K8mKpoPb261
New Contributor III

Actually, my workspace is a folder. I named it specifically like that. And i tried to rename it as well but it's still not working.

0 Kudos
DanPatterson_Retired
MVP Emeritus

Try a folder that is different, or "raw encode the folder path.  Either the \U will make the path unusable, or the \n later on

p = "C:\Users\jrm236admin\Documents\new\Hurricane\folder\hurricane_dbf.dbf"

  File "<ipython-input-1-e0812d7d099a>", line 1
    p = "C:\Users\jrm236admin\Documents\new\Hurricane\folder\hurricane_dbf.dbf"
       ^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

# ---- raw encoded... a little 'r' goes a long way

p = r"C:\Users\jrm236admin\Documents\new\Hurricane\folder\hurricane_dbf.dbf"

print(p)
C:\Users\jrm236admin\Documents\new\Hurricane\folder\hurricane_dbf.dbf
deleted-user-3K8mKpoPb261
New Contributor III

Thanks, Dan! But is there a way to raw encode the output with TableToTable function. It's asking for both the output path and output name. And there's no option to raw encode the output.

0 Kudos
DanPatterson_Retired
MVP Emeritus

Try ...

ValidateTableName—ArcPy Functions | Documentation 

It seems you have your workspace raw encoded, but it either doesn't like it in combination with the new table name.

Also, I don't see

arcpy.env.overwriteOutput anywhere in your script

Checking for the existence of data—ArcPy Get Started | Documentation 

Also, I totally recommend not using c:\users for anything unless you are stuck in a shared environment.  If you can make your own folder ensuring the path subfolders don't begin with \g, \t, \u, \a, \b

p = "c:\t\a\n\b"
p
'c:\t\x07\n\x08'

print(p)
c:

# ---- r works, or \\ or /
p = r"c:\t\a\n\b"
print(p)
c:\t\a\n\b

or the os module's path join

p = ['C:\\', 't', 'a', 'n', 'b']

os.path.join(*p)

'C:\\t\\a\\n\\b'
0 Kudos
deleted-user-3K8mKpoPb261
New Contributor III

I tried these workaround but it seemed to not have fixed the issue. This script doesn't even work i stand alone as well.

0 Kudos