ドキュメント内で:<\/SPAN><\/P>http:\/\/solutions.arcgis.com\/utilities\/help\/utility-network-automation\/tool-reference\/stage-utility-network.htm<\/A><\/SPAN><\/P><\/SPAN><\/P><\/SPAN><\/P>.# 新しいユーティリティネットワークを作成する <\/SPAN><\/SPAN><\/P>arcpy<\/SPAN><\/SPAN>.<\/SPAN><\/SPAN>pt<\/SPAN><\/SPAN>.<\/SPAN>StageUtilityNetwork<\/SPAN>(<\/SPAN>sde<\/SPAN>, <\/SPAN>service_territory<\/SPAN>, <\/SPAN>dataset<\/SPAN>, <\/SPAN>network_name<\/SPAN>)<\/SPAN><\/SPAN><\/P><\/BLOCKQUOTE>スタンドアロンのスクリプトを実行していて、次のエラーメッセージが表示されました。"<\/P>in <module><\/SPAN> arcpy.pt.StageUtilityNetwork(<\/SPAN>AttributeError: module 'arcpy' has no attribute 'pt'<\/SPAN><\/P><\/SPAN><\/P>なぜこれが起きているのか分かりません..<\/SPAN><\/P><\/BODY><\/HTML>
<\/SPAN><\/P><\/SPAN><\/P>.# 新しいユーティリティネットワークを作成する <\/SPAN><\/SPAN><\/P>arcpy<\/SPAN><\/SPAN>.<\/SPAN><\/SPAN>pt<\/SPAN><\/SPAN>.<\/SPAN>StageUtilityNetwork<\/SPAN>(<\/SPAN>sde<\/SPAN>, <\/SPAN>service_territory<\/SPAN>, <\/SPAN>dataset<\/SPAN>, <\/SPAN>network_name<\/SPAN>)<\/SPAN><\/SPAN><\/P><\/BLOCKQUOTE>スタンドアロンのスクリプトを実行していて、次のエラーメッセージが表示されました。"<\/P>in <module><\/SPAN> arcpy.pt.StageUtilityNetwork(<\/SPAN>AttributeError: module 'arcpy' has no attribute 'pt'<\/SPAN><\/P><\/SPAN><\/P>なぜこれが起きているのか分かりません..<\/SPAN><\/P><\/BODY><\/HTML>
Many thanks @Vicky for the hint!
So this simply and only worked for me: arcpy.StageUtilityNetwork_pt()
Yes, I made sure I already have the cloned python environment.
Hi Sami,
Good to know that at least one of the method is working for you.
UtilityNetworkPackageTools arcpy.pt is a module of the ArcPy site package. Both arcpy.pt.StageUtilityNetwork() and arcpy.StageUtilityNetwork_pt() are the same function but use different name/way to call the function of UtilityNetworkPackageTools.
Somehow, you are not able to load the pt module but call arcpy.StageUtilityNetwork_pt() directly. It might something wrong in the python clone environment with an installed site package.
May try to clone another python environment and install untools again through ArcGIS Pro> Python Package Manager. Then test the pt model again in the new clone environment.
I used the ArcGIS Pro 2.3.3 with untools 2.3.3.
Not sure if you got the solution yet.
It might worth to check with your python path where you installed the untools.
untools is normally required a clone python environment and it's a different python path from default ArcGIS Pro python location.
The different python path can be viewed from ArcGIS Pro /Python/management environment.
It will look similar to "C:\Users\Administrator\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone"
you can execute the arcpy.pt.StageUtilityNetwork() or arcpy.StageUtilityNetwork_pt() from there afer import arcpy library.
Did this machine have a previous version of Pro (eg 2.2) installed? Can you post a screenshot of the python backstage?
I also upgraded both to the ArcPro 2.3.3, and untools 2.3.3, still got the same error message:
arcpy.pt.StageUtilityNetwork(AttributeError: module 'arcpy' has no attribute 'pt'
It's 2.3.2, I ran your command in Pro python editor.
However, if I run it in a stand-alone, it gives exception, and at the end of the long error traceback:
raise ImportError('dateutil 2.5.0 is the minimum required version')ImportError: dateutil 2.5.0 is the minimum required version
What version of untools do you have installed? You can check by running the following from Python window:
import untools
print(untools.__version__)
Do you see the Utility Network Package Tools toolbox?
サインインしたメンバーは投稿、更新のフォローなどができます。初めてですか?無料アカウントを登録してください。
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.