<?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: ImportError: PyCapsule_Import could not import module &amp;quot;datetime&amp;quot; in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/importerror-pycapsule-import-could-not-import/m-p/1356534#M9364</link>
    <description>&lt;P&gt;arctoolbox functions like CopyFeatures would be expecting arcpy based on python 3.9.18, your base&lt;/P&gt;&lt;P&gt;...Base Python on machine is 3.11...&lt;/P&gt;&lt;P&gt;if you are working in different python versions, are you switching back to an arcpy/arcgis happy environment first?&lt;/P&gt;</description>
    <pubDate>Mon, 04 Dec 2023 20:00:31 GMT</pubDate>
    <dc:creator>DanPatterson</dc:creator>
    <dc:date>2023-12-04T20:00:31Z</dc:date>
    <item>
      <title>ImportError: PyCapsule_Import could not import module "datetime"</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/importerror-pycapsule-import-could-not-import/m-p/1356527#M9363</link>
      <description>&lt;P&gt;Hello, I have been running some scripts for a while without issue.&amp;nbsp; Even after upgrading to ArcGis 3.1.1&lt;BR /&gt;&lt;BR /&gt;Now, started receiving this error at random times in the code:&lt;BR /&gt;&lt;BR /&gt;(this error shows it occurred in CopyFeatures, sometimes it happens during other functions)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Fatal Python error: InitDatetime: Could not import datetime C API&lt;BR /&gt;Python runtime state: initialized&lt;BR /&gt;ImportError: PyCapsule_Import could not import module "datetime"&lt;/P&gt;&lt;P&gt;Current thread 0x000025ac (most recent call first):&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py", line 512 in &amp;lt;lambda&amp;gt;&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\management.py", line 4690 in CopyFeatures&lt;/P&gt;&lt;P&gt;installed:&lt;BR /&gt;Conda version is 4.1.4&lt;BR /&gt;Base Python on machine is 3.11&lt;BR /&gt;PyCharm 2021.1.3 (Community Edition)&lt;BR /&gt;Build #PC-211.7628.24, built on June 29, 2021&lt;BR /&gt;Runtime version: 11.0.11+9-b1341.60 amd64&lt;BR /&gt;VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.&lt;BR /&gt;Windows 10 10.0&lt;BR /&gt;GC: G1 Young Generation, G1 Old Generation&lt;BR /&gt;Memory: 2048M&lt;BR /&gt;Cores: 16&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tried the following:&lt;/P&gt;&lt;P&gt;1. uninstalled:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ArcGIS Pro&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Pycharm&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Python&lt;/P&gt;&lt;P&gt;2. removed any lingering folders for:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ArcGIS Pro&lt;BR /&gt;&amp;nbsp;&amp;nbsp; pip cache&lt;BR /&gt;&lt;BR /&gt;3. re-installed all 3 (from 1)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Been working with ArcGis for about a year now, still learning.&amp;nbsp; &amp;nbsp;Any guidance on this would be appreciated.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2023 19:49:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/importerror-pycapsule-import-could-not-import/m-p/1356527#M9363</guid>
      <dc:creator>Rob24</dc:creator>
      <dc:date>2023-12-04T19:49:26Z</dc:date>
    </item>
    <item>
      <title>Re: ImportError: PyCapsule_Import could not import module "datetime"</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/importerror-pycapsule-import-could-not-import/m-p/1356534#M9364</link>
      <description>&lt;P&gt;arctoolbox functions like CopyFeatures would be expecting arcpy based on python 3.9.18, your base&lt;/P&gt;&lt;P&gt;...Base Python on machine is 3.11...&lt;/P&gt;&lt;P&gt;if you are working in different python versions, are you switching back to an arcpy/arcgis happy environment first?&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2023 20:00:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/importerror-pycapsule-import-could-not-import/m-p/1356534#M9364</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2023-12-04T20:00:31Z</dc:date>
    </item>
    <item>
      <title>Re: ImportError: PyCapsule_Import could not import module "datetime"</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/importerror-pycapsule-import-could-not-import/m-p/1356536#M9365</link>
      <description>&lt;P&gt;Hi Dan,&amp;nbsp; &amp;nbsp;Thank you for the response,&lt;/P&gt;&lt;P&gt;I currently only work with the ArcGIS Python so the interpreter is set to Conda environment pointing to the arcgispro-py3 env.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2023 20:07:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/importerror-pycapsule-import-could-not-import/m-p/1356536#M9365</guid>
      <dc:creator>Rob24</dc:creator>
      <dc:date>2023-12-04T20:07:46Z</dc:date>
    </item>
    <item>
      <title>Re: ImportError: PyCapsule_Import could not import module "datetime"</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/importerror-pycapsule-import-could-not-import/m-p/1356572#M9366</link>
      <description>&lt;P&gt;&lt;SPAN&gt;.Base Python on machine is 3.11...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;came from your error message, do you have other python versions installed?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2023 20:55:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/importerror-pycapsule-import-could-not-import/m-p/1356572#M9366</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2023-12-04T20:55:37Z</dc:date>
    </item>
    <item>
      <title>Re: ImportError: PyCapsule_Import could not import module "datetime"</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/importerror-pycapsule-import-could-not-import/m-p/1356576#M9367</link>
      <description>&lt;P&gt;Hi Dan,&lt;/P&gt;&lt;P&gt;I only have python 3.11&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2023 21:06:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/importerror-pycapsule-import-could-not-import/m-p/1356576#M9367</guid>
      <dc:creator>Rob24</dc:creator>
      <dc:date>2023-12-04T21:06:28Z</dc:date>
    </item>
    <item>
      <title>Re: ImportError: PyCapsule_Import could not import module "datetime"</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/importerror-pycapsule-import-could-not-import/m-p/1356581#M9368</link>
      <description>&lt;P&gt;you have arcgis pro installed, hence you should have python 3.9,18 installed as well&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\management.py", line 4690 in CopyFeatures&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;arcpy is built against 3.9.18&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2023 21:12:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/importerror-pycapsule-import-could-not-import/m-p/1356581#M9368</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2023-12-04T21:12:40Z</dc:date>
    </item>
    <item>
      <title>Re: ImportError: PyCapsule_Import could not import module "datetime"</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/importerror-pycapsule-import-could-not-import/m-p/1356590#M9369</link>
      <description>&lt;P&gt;Dan,&amp;nbsp; &amp;nbsp;I can uninstall python 3.11 and go grab 3.9.18 .&lt;BR /&gt;&lt;BR /&gt;I'm wondering if this explains why sometimes it would actually run fine and other times just error out (erratic behavior) .&amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2023 21:21:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/importerror-pycapsule-import-could-not-import/m-p/1356590#M9369</guid>
      <dc:creator>Rob24</dc:creator>
      <dc:date>2023-12-04T21:21:47Z</dc:date>
    </item>
    <item>
      <title>Re: ImportError: PyCapsule_Import could not import module "datetime"</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/importerror-pycapsule-import-could-not-import/m-p/1356594#M9370</link>
      <description>&lt;P&gt;That would be useful and I would recommend a complete reinstall of Pro if you use it mostly&lt;/P&gt;&lt;P&gt;Don't be worried about the title, the procedure is what is important&lt;/P&gt;&lt;P&gt;&lt;A href="https://support.esri.com/en-us/knowledge-base/problem-arcgis-pro-freezes-on-the-initializing-screen-b-000020558" target="_blank"&gt;Problem: ArcGIS pro Freezes on the Initializing Screen before the Sign in Dialog Box Displ (esri.com)&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2023 21:32:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/importerror-pycapsule-import-could-not-import/m-p/1356594#M9370</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2023-12-04T21:32:37Z</dc:date>
    </item>
    <item>
      <title>Re: ImportError: PyCapsule_Import could not import module "datetime"</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/importerror-pycapsule-import-could-not-import/m-p/1356597#M9371</link>
      <description>&lt;P&gt;Thank you Dan!,&amp;nbsp; I will try this route and report back.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2023 21:37:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/importerror-pycapsule-import-could-not-import/m-p/1356597#M9371</guid>
      <dc:creator>Rob24</dc:creator>
      <dc:date>2023-12-04T21:37:05Z</dc:date>
    </item>
    <item>
      <title>Re: ImportError: PyCapsule_Import could not import module "datetime"</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/importerror-pycapsule-import-could-not-import/m-p/1357088#M9375</link>
      <description>&lt;P&gt;Update:&amp;nbsp; still having the same issue.&amp;nbsp; I installed ArcGIS 3.1.1 (without installing Python separately).&amp;nbsp; and the error keeps coming back to CopyFeatures.&lt;BR /&gt;&lt;BR /&gt;in the pycharm terminal:&lt;/P&gt;&lt;P&gt;python --version&lt;BR /&gt;Python 3.9.16&lt;BR /&gt;&lt;BR /&gt;I know you mentioned arcpy was built against 3.9.18 so I don't know if this is now the issue.&lt;BR /&gt;&lt;BR /&gt;still do not understand why these same scripts where working for months and without changes or updates and started getting this error.&lt;BR /&gt;&lt;BR /&gt;either way, thank you for the help&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/215600"&gt;@DanPatterson&lt;/a&gt; I appreciate it!&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2023 20:01:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/importerror-pycapsule-import-could-not-import/m-p/1357088#M9375</guid>
      <dc:creator>Rob24</dc:creator>
      <dc:date>2023-12-05T20:01:17Z</dc:date>
    </item>
    <item>
      <title>Re: ImportError: PyCapsule_Import could not import module "datetime"</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/importerror-pycapsule-import-could-not-import/m-p/1357131#M9376</link>
      <description>&lt;P&gt;Tech Support would be your best option if you removed all python, pycharm and Pro installations.&lt;/P&gt;&lt;P&gt;There is little use in installing 3.1.1 if you are having problems&lt;/P&gt;&lt;P&gt;Pro 3.2 uses 3.9.18&lt;/P&gt;&lt;P&gt;Good luck&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2023 21:49:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/importerror-pycapsule-import-could-not-import/m-p/1357131#M9376</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2023-12-05T21:49:13Z</dc:date>
    </item>
    <item>
      <title>Re: ImportError: PyCapsule_Import could not import module "datetime"</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/importerror-pycapsule-import-could-not-import/m-p/1357164#M9377</link>
      <description>&lt;P&gt;Hi Dan, that is my next step, appreciate your time!&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2023 22:42:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/importerror-pycapsule-import-could-not-import/m-p/1357164#M9377</guid>
      <dc:creator>Rob24</dc:creator>
      <dc:date>2023-12-05T22:42:36Z</dc:date>
    </item>
    <item>
      <title>Re: ImportError: PyCapsule_Import could not import module "datetime"</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/importerror-pycapsule-import-could-not-import/m-p/1358530#M9390</link>
      <description>&lt;P&gt;Good morning!&lt;BR /&gt;I have a similar problem!&lt;BR /&gt;I created a script from the export of an ArcGis Pro model, using Python from ArcGis Pro 3.2 (Python 3.9.18 [MSC v.1931 64 bit (AMD64)] on win32), recently installed.&lt;BR /&gt;When executing the script, the message appears when executing the command: arcpy.conversion.ExportFeatures&lt;BR /&gt;ImportError: PyCapsule_Import could not import module "datetime"&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If anyone has an idea on how to solve it....&lt;/SPAN&gt;&lt;BR /&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 08 Dec 2023 13:42:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/importerror-pycapsule-import-could-not-import/m-p/1358530#M9390</guid>
      <dc:creator>Luiz_RobertoArueira_da_Silva</dc:creator>
      <dc:date>2023-12-08T13:42:36Z</dc:date>
    </item>
    <item>
      <title>Re: ImportError: PyCapsule_Import could not import module "datetime"</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/importerror-pycapsule-import-could-not-import/m-p/1358559#M9391</link>
      <description>&lt;P&gt;copy the script here so people can see what might be causing the issue&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/python-blog/code-formatting-the-community-version/ba-p/1007633" target="_blank"&gt;Code formatting ... the Community Version - Esri Community&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Dec 2023 14:52:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/importerror-pycapsule-import-could-not-import/m-p/1358559#M9391</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2023-12-08T14:52:35Z</dc:date>
    </item>
    <item>
      <title>Re: ImportError: PyCapsule_Import could not import module "datetime"</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/importerror-pycapsule-import-could-not-import/m-p/1358731#M9393</link>
      <description>&lt;P&gt;Sorry, I don't have permission to share the code.&lt;/P&gt;&lt;P&gt;A part of the command that generates the error:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;print ("select by location camada realizado")

# Process: Export Features (Export Features) (conversion)
Incidentes_filtrado = "in_memory\\Incidentes_filtrado"
arcpy.conversion.ExportFeatures(in_features=incidentes_Layer1, out_features=Incidentes_filtrado, field_mapping="uuid .....&lt;/LI-CODE&gt;&lt;P&gt;login efetuado&lt;BR /&gt;select by attribute camada do realizado&lt;BR /&gt;select by location camada realizado&lt;BR /&gt;ImportError: PyCapsule_Import could not import module "datetime"&lt;BR /&gt;&lt;BR /&gt;Thanks foo your time!&lt;/P&gt;</description>
      <pubDate>Fri, 08 Dec 2023 19:56:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/importerror-pycapsule-import-could-not-import/m-p/1358731#M9393</guid>
      <dc:creator>Luiz_RobertoArueira_da_Silva</dc:creator>
      <dc:date>2023-12-08T19:56:30Z</dc:date>
    </item>
    <item>
      <title>Re: ImportError: PyCapsule_Import could not import module "datetime"</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/importerror-pycapsule-import-could-not-import/m-p/1358748#M9394</link>
      <description>&lt;P&gt;You will have to contact tech support.&amp;nbsp; There isn't enough information to decipher a possible cause with what is given&lt;/P&gt;</description>
      <pubDate>Fri, 08 Dec 2023 20:38:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/importerror-pycapsule-import-could-not-import/m-p/1358748#M9394</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2023-12-08T20:38:15Z</dc:date>
    </item>
  </channel>
</rss>

