<?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 Re: Do not name your Python script &amp;quot;pytest.py&amp;quot; with ArcGIS Pro installed in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/do-not-name-your-python-script-quot-pytest-py-quot/m-p/366872#M16094</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/laugh.png" /&gt;&amp;nbsp; Not to mention potential copyright infringement on the name&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/395856_pytest.jpg" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 06 Feb 2018 18:29:47 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2018-02-06T18:29:47Z</dc:date>
    <item>
      <title>Do not name your Python script "pytest.py" with ArcGIS Pro installed</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/do-not-name-your-python-script-quot-pytest-py-quot/m-p/366871#M16093</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 22px;"&gt;Cut to the chase:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;If you attempt to import the &lt;STRONG&gt;arcgis&lt;/STRONG&gt; module (or even parts of it) in your python script, then &lt;EM style="text-decoration: underline;"&gt;&lt;STRONG&gt;do not name&lt;/STRONG&gt;&lt;/EM&gt; your python script "pytest.py". You will see some very strange behavior and your script will fail. The name of your script&amp;nbsp;will conflict with pandas initialization scripts, which just-so-happen to have a variable named "pytest".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 22px;"&gt;The Long Version (skip if you are squeamish):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I have ArcGIS Pro 2.1 with the patch installed. I was troubleshooting a script and decided to create a simple python test script to figure out what was going on. I innocently named it "pytest.py". I suddenly started seeing strange errors I hadn't previously seen when attempting to execute my script. Okay, fine, I thought. Let me see if I can manually run these commands "import arcgis" in the Python Shell. What happened next made no sense at all - the Python Shell responds by re-running my "pytest.py" script and the same errors occurred! What? I was in a completely different session.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I uninstalled ArcGIS Pro, deleted the Python folder and reinstalled ArcGIS Pro. I opened the Python Shell and manually entered the command "import arcgis". Again, it responded by re-running my "pytest.py" script and errored out. This fried my brain. The day ended and I went home.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After a long night of nightmares of Python acting weird, I came to work this morning and carefully examined the &lt;EM&gt;Traceback&lt;/EM&gt; results. I saw that the Pandas package was reporting "AttributeError: module 'pytest' has no attribute 'mark'". &lt;STRONG&gt;It suddenly clicked:&lt;/STRONG&gt; I decided to rename my script "mytest.py" and everything worked fine and the manual command errors also disappeared.&amp;nbsp;It turns out that t&lt;SPAN&gt;he name of your script&amp;nbsp;will conflict with pandas initialization scripts, which is part of arcgis intialization, which just-so-happen &lt;SPAN&gt;have a variable&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;named "pytest".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just thought I'd put this out there for the next poor soul who attempts to name a python test script "&lt;STRONG&gt;pytest.py&lt;/STRONG&gt;" and &lt;STRONG&gt;import arcgis&lt;/STRONG&gt; inside of it. And yes, I learned to pay more attention to traceback results &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Feb 2018 18:21:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/do-not-name-your-python-script-quot-pytest-py-quot/m-p/366871#M16093</guid>
      <dc:creator>alex_friant</dc:creator>
      <dc:date>2018-02-06T18:21:22Z</dc:date>
    </item>
    <item>
      <title>Re: Do not name your Python script "pytest.py" with ArcGIS Pro installed</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/do-not-name-your-python-script-quot-pytest-py-quot/m-p/366872#M16094</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/laugh.png" /&gt;&amp;nbsp; Not to mention potential copyright infringement on the name&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/395856_pytest.jpg" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Feb 2018 18:29:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/do-not-name-your-python-script-quot-pytest-py-quot/m-p/366872#M16094</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-02-06T18:29:47Z</dc:date>
    </item>
    <item>
      <title>Re: Do not name your Python script "pytest.py" with ArcGIS Pro installed</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/do-not-name-your-python-script-quot-pytest-py-quot/m-p/366873#M16095</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/people/alexfriant"&gt;alexfriant&lt;/A&gt;‌, I converting this thread to a discussion since you are mainly sharing and not asking a question or for help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Feb 2018 21:04:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/do-not-name-your-python-script-quot-pytest-py-quot/m-p/366873#M16095</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2018-02-06T21:04:33Z</dc:date>
    </item>
    <item>
      <title>Re: Do not name your Python script "pytest.py" with ArcGIS Pro installed</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/do-not-name-your-python-script-quot-pytest-py-quot/m-p/366874#M16096</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the heads up-&amp;nbsp; I've distributed this url to our user community.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Feb 2018 21:27:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/do-not-name-your-python-script-quot-pytest-py-quot/m-p/366874#M16096</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2018-02-06T21:27:20Z</dc:date>
    </item>
    <item>
      <title>Re: Do not name your Python script "pytest.py" with ArcGIS Pro installed</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/do-not-name-your-python-script-quot-pytest-py-quot/m-p/366875#M16097</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oops! Thanks, my bad.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Feb 2018 21:49:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/do-not-name-your-python-script-quot-pytest-py-quot/m-p/366875#M16097</guid>
      <dc:creator>alex_friant</dc:creator>
      <dc:date>2018-02-06T21:49:18Z</dc:date>
    </item>
    <item>
      <title>Re: Do not name your Python script "pytest.py" with ArcGIS Pro installed</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/do-not-name-your-python-script-quot-pytest-py-quot/m-p/366876#M16098</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ha ha, yes, I did find that once I did some googling!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Feb 2018 21:50:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/do-not-name-your-python-script-quot-pytest-py-quot/m-p/366876#M16098</guid>
      <dc:creator>alex_friant</dc:creator>
      <dc:date>2018-02-06T21:50:02Z</dc:date>
    </item>
  </channel>
</rss>

