-
Notifications
You must be signed in to change notification settings - Fork 155
Unable to import arcrest in arcgis pro #243
Comments
@CTLocalGovTeam - Can you do the following from your Pro Python Windows:
Example output:
Then see if ArcREST was installed in one of those paths? Thanks |
sys.path outputs this:
ArcREST was installed to 'c:\Python34\lib\site-packages' I do have python27 installed and it also has ArcREST installed and works fine in ArcGIS Desktop. |
Update: But now, I cannot import arcresthelper |
@CTLocalGovTeam can you pull the latest version and run the setup.py again? |
@achapkowski Pulled ArcREST from master and when i try to run setup.py, it complains. |
What files/folders are in the SRC folder? Sent from my Verizon Wireless 4G LTE DROID |
Finally, got it to work! |
@CTLocalGovTeam sorry that I have to open this thread again, but I have some difficulties using arcrest in ArcGIS Pro. I have done the same steps as you have done... I have CDed into the src directory and ran setup.py from there, but when I want to use arcrest in ArcGIS Pro it always says that the module arcrest cannot be found. I printed out the sys.path and copied the two folders "arcrest" and "arcresthelper" to "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages" manually. After doing so another error message appears: I think the problem is the syntax. The scripts are written in 2.7 but Pro is using 3.x. Any ideas? |
You need to use the most recent version in master. The version you have used a python 2.7 format for catching exceptions. This does not work in 3. These have been removed in master. Here is line 43 in web/_base. - https://github.com/Esri/ArcREST/blob/master/src/arcrest/web/_base.py#L43 |
Thanks a lot :), that was the solution for this error. I am still wondering why I have to change one python script (_base.py) manually. I downloaded the last version (ArcRest 3.5.3) and I thought that such a problem would be adressed :). After fixing this problem another error is showing up. It is the same as mentioned above by @CTLocalGovTeam: As you can see in the following picture, there is a file "common.py": Is it maybe possible that I work with an old version? If I try to run for example "Delete Data from Feature Servcie" I get the following error in ArcGIS Pro: |
ArcRest will work with py 3.x. ArcRest Helper was never completely converted. You can preform your script with just ArcRest.
You will have better luck with the code in master branch.
|
I am back next week and can take a look at why the import is failing.
|
I just tried with version in Master and the import works fine. I would remove the ArcRest and ArcRestHelper folders from your python folder and manually copy them back from master. this works in python 3.x |
Thanks for the hint :). I removed all files from ArcRest and started a new installation. The import of arcrest and arcresthelper works fine now, but when I want to use the tool "Remove Data from Feature Service" I get some error messages. I have logged the messages / errors with Issue #317 and Issue #318. I imported the Toolbox from the Master folder and I have tested this tool in ArcGIS Pro 1.3 and 1.4. |
If you can submit a PR with the fix, that would be great.
|
Done :) |
@MikeMillerGIS
ArcRest v3.5.3
Bug
Repro Steps
The text was updated successfully, but these errors were encountered: