<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Sharing an ArcMap Python Toolbox in ArcMap Questions</title>
    <link>https://community.esri.com/t5/arcmap-questions/sharing-an-arcmap-python-toolbox/m-p/1267445#M4340</link>
    <description>&lt;P&gt;I need to share/locally distribute an ArcMap Python Toolbox. I tried to proceed similarly to the &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/geoprocessing_and_python/distributing-python-modules.htm" target="_self"&gt;description for ArcGIS Pro&lt;/A&gt; but I ran into some issues. Mainly, it did not include the .pyt file.&lt;/P&gt;&lt;P&gt;My Toolbox directory looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markdown"&gt;Toolbox
├  setup.py
├  Readme.txt
├ Example_data
│       ├ Subdirectory_with_files_and_folders_0
│       └ Subdirectory_with_files_and_folders_1
├── External
│       ├ Script_to_be_run_externally_in_Python_3.py
│       ├ Script_to_be_run_externally_in_Matlab.m
│       └ Even_more_such_scripts.py
├── Spectral (some entire Python package I copied here from Github)
│       └ All_files_and_subdirectories_of_this_additional_package
└── Toolbox
        ├ Functions.py
        ├ Classes.py
        └ Toolbox.pyt&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The following is my setup.py file:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import os 
from setuptools import setup 
 
def read(fname): 
    return open(os.path.join(os.path.dirname(__file__), fname)).read() 
 
setup(name='Toolbox', 
      version='1.0', 
      author='Me', 
      description=("Some description"), 
      long_description=read('Readme.txt'), 
      python_requires='~=2.7.16', 
      packages=['Toolbox', 'Spectral'], 
      package_data={'Toolbox':['External/*',  
                  'Example_data/*']}
      )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to create a dist archive calling the Python executable of an ArcPro installation I also have on the machine (and no, I cannot simply switch to ArcPro with the entire project; using ArcMap was not my choice):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markdown"&gt;&amp;gt; O:
&amp;gt; cd O:\path\to\my\toolbox
&amp;gt; "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\python.exe" setup.py sdist&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the first Python Package/Toolbox I am trying to distribute, so there might be major errors or violations of best practices. Perhaps there is a lot to change here? Any help appreciated.&lt;/P&gt;</description>
    <pubDate>Tue, 14 Mar 2023 09:19:16 GMT</pubDate>
    <dc:creator>Manu</dc:creator>
    <dc:date>2023-03-14T09:19:16Z</dc:date>
    <item>
      <title>Sharing an ArcMap Python Toolbox</title>
      <link>https://community.esri.com/t5/arcmap-questions/sharing-an-arcmap-python-toolbox/m-p/1267445#M4340</link>
      <description>&lt;P&gt;I need to share/locally distribute an ArcMap Python Toolbox. I tried to proceed similarly to the &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/geoprocessing_and_python/distributing-python-modules.htm" target="_self"&gt;description for ArcGIS Pro&lt;/A&gt; but I ran into some issues. Mainly, it did not include the .pyt file.&lt;/P&gt;&lt;P&gt;My Toolbox directory looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markdown"&gt;Toolbox
├  setup.py
├  Readme.txt
├ Example_data
│       ├ Subdirectory_with_files_and_folders_0
│       └ Subdirectory_with_files_and_folders_1
├── External
│       ├ Script_to_be_run_externally_in_Python_3.py
│       ├ Script_to_be_run_externally_in_Matlab.m
│       └ Even_more_such_scripts.py
├── Spectral (some entire Python package I copied here from Github)
│       └ All_files_and_subdirectories_of_this_additional_package
└── Toolbox
        ├ Functions.py
        ├ Classes.py
        └ Toolbox.pyt&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The following is my setup.py file:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import os 
from setuptools import setup 
 
def read(fname): 
    return open(os.path.join(os.path.dirname(__file__), fname)).read() 
 
setup(name='Toolbox', 
      version='1.0', 
      author='Me', 
      description=("Some description"), 
      long_description=read('Readme.txt'), 
      python_requires='~=2.7.16', 
      packages=['Toolbox', 'Spectral'], 
      package_data={'Toolbox':['External/*',  
                  'Example_data/*']}
      )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to create a dist archive calling the Python executable of an ArcPro installation I also have on the machine (and no, I cannot simply switch to ArcPro with the entire project; using ArcMap was not my choice):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markdown"&gt;&amp;gt; O:
&amp;gt; cd O:\path\to\my\toolbox
&amp;gt; "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\python.exe" setup.py sdist&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the first Python Package/Toolbox I am trying to distribute, so there might be major errors or violations of best practices. Perhaps there is a lot to change here? Any help appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Mar 2023 09:19:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcmap-questions/sharing-an-arcmap-python-toolbox/m-p/1267445#M4340</guid>
      <dc:creator>Manu</dc:creator>
      <dc:date>2023-03-14T09:19:16Z</dc:date>
    </item>
  </channel>
</rss>

