<?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 ImportError: No module named '_base' when importing arcpy in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/importerror-no-module-named-base-when-importing/m-p/741599#M57327</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have been running into some configuration errors while trying to import arcpy module into a simple Python script file, and I suspect that the errors might have something to do with the environment variables settings. Prior to the error above, I was running into a &lt;EM&gt;&lt;STRONG&gt;"ImportError: No module named 'arcpy'"&lt;/STRONG&gt;&lt;/EM&gt; error, which was related to incorrect environment variables. I have both Python 2.7 and Python 3.4 installed on my computer, and I would like to be able to use both of them in my code, but I'm not sure if that's possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt;&lt;STRONG&gt;Operating System:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5;"&gt; Windows 7&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Application:&lt;/STRONG&gt; ArcGIS for Desktop version 10.2.1&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Path to ArcGIS:&lt;/STRONG&gt; C:\Program Files (x86)\ArcGIS\Desktop10.2&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Path to Python 2.7:&lt;/STRONG&gt; C:\Python27&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Path to Python 3.4:&lt;/STRONG&gt; C:\Python34&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Python IDE:&lt;/STRONG&gt; PyCharm Community Edition 4.5.1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;Environment Variables:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;PATH: &lt;/STRONG&gt;C:\Python27\;C:\Python34\;D:\Documents and Settings\pkundu\AppData\Roaming\npm;C:\Program Files (x86)\Java\jre7\bin&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;PYTHONPATH:&lt;/STRONG&gt; C:\Program Files (x86)\ArcGIS\Desktop10.2\bin;C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy;C:\Program Files (x86)\ArcGIS\Desktop10.2\ArcToolbox\Script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I try to run a very basic command:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;import arcpy&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;I get the following error:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; File "D:/Documents and Settings/pkundu/Desktop/pytest/testpy2.py", line 6, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; import arcpy&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; File "C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy\arcpy\__init__.py", line 21, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; from arcpy.geoprocessing import gp&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; File "C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy\arcpy\geoprocessing\__init__.py", line 14, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; from _base import *&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;ImportError: No module named '_base'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Process finished with exit code 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;Would greatly appreciate a solution to this problem as I have not seen any other posts regarding this error. Most other posts have to do with the "&lt;EM&gt;ImportError: No module named 'arcpy'"&lt;/EM&gt; error I was experiencing before I edited my environment variables to the ones listed above. When I followed the error code, I found that the geoprocessing folder contains both the "__init__.py" file and the &lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;"_base.py" file&lt;/SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 May 2015 16:45:10 GMT</pubDate>
    <dc:creator>PiyaliKundu</dc:creator>
    <dc:date>2015-05-28T16:45:10Z</dc:date>
    <item>
      <title>ImportError: No module named '_base' when importing arcpy</title>
      <link>https://community.esri.com/t5/python-questions/importerror-no-module-named-base-when-importing/m-p/741599#M57327</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have been running into some configuration errors while trying to import arcpy module into a simple Python script file, and I suspect that the errors might have something to do with the environment variables settings. Prior to the error above, I was running into a &lt;EM&gt;&lt;STRONG&gt;"ImportError: No module named 'arcpy'"&lt;/STRONG&gt;&lt;/EM&gt; error, which was related to incorrect environment variables. I have both Python 2.7 and Python 3.4 installed on my computer, and I would like to be able to use both of them in my code, but I'm not sure if that's possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt;&lt;STRONG&gt;Operating System:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5;"&gt; Windows 7&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Application:&lt;/STRONG&gt; ArcGIS for Desktop version 10.2.1&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Path to ArcGIS:&lt;/STRONG&gt; C:\Program Files (x86)\ArcGIS\Desktop10.2&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Path to Python 2.7:&lt;/STRONG&gt; C:\Python27&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Path to Python 3.4:&lt;/STRONG&gt; C:\Python34&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Python IDE:&lt;/STRONG&gt; PyCharm Community Edition 4.5.1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;Environment Variables:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;PATH: &lt;/STRONG&gt;C:\Python27\;C:\Python34\;D:\Documents and Settings\pkundu\AppData\Roaming\npm;C:\Program Files (x86)\Java\jre7\bin&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;PYTHONPATH:&lt;/STRONG&gt; C:\Program Files (x86)\ArcGIS\Desktop10.2\bin;C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy;C:\Program Files (x86)\ArcGIS\Desktop10.2\ArcToolbox\Script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I try to run a very basic command:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;import arcpy&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;I get the following error:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; File "D:/Documents and Settings/pkundu/Desktop/pytest/testpy2.py", line 6, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; import arcpy&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; File "C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy\arcpy\__init__.py", line 21, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; from arcpy.geoprocessing import gp&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; File "C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy\arcpy\geoprocessing\__init__.py", line 14, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; from _base import *&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;ImportError: No module named '_base'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Process finished with exit code 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;Would greatly appreciate a solution to this problem as I have not seen any other posts regarding this error. Most other posts have to do with the "&lt;EM&gt;ImportError: No module named 'arcpy'"&lt;/EM&gt; error I was experiencing before I edited my environment variables to the ones listed above. When I followed the error code, I found that the geoprocessing folder contains both the "__init__.py" file and the &lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;"_base.py" file&lt;/SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 May 2015 16:45:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/importerror-no-module-named-base-when-importing/m-p/741599#M57327</guid>
      <dc:creator>PiyaliKundu</dc:creator>
      <dc:date>2015-05-28T16:45:10Z</dc:date>
    </item>
    <item>
      <title>Re: ImportError: No module named '_base' when importing arcpy</title>
      <link>https://community.esri.com/t5/python-questions/importerror-no-module-named-base-when-importing/m-p/741600#M57328</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't understand your path, could you check..mine using ArcMap 10.3 which uses Python 2.7.x is&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; import sys
&amp;gt;&amp;gt;&amp;gt; sys.path
['', ...'C:\\Python27\\ArcGIS10.3\\DLLs',
'C:\\Python27\\ArcGIS10.3\\lib',
'C:\\Python27\\ArcGIS10.3\\lib\\plat-win',
'C:\\Python27\\ArcGIS10.3\\lib\\lib-tk',
'C:\\Python27\\ArcGIS10.3\\Lib\\site-packages\\pythonwin',&amp;nbsp; # only for PythonWin
'C:\\Python27\\ArcGIS10.3',
'C:\\Python27\\ArcGIS10.3\\lib\\site-packages',
'C:\\Program Files (x86)\\ArcGIS\\Desktop10.3\\bin',
'C:\\Program Files (x86)\\ArcGIS\\Desktop10.3\\ArcPy',
'C:\\Program Files (x86)\\ArcGIS\\Desktop10.3\\ArcToolBox\\Scripts',
'C:\\Python27\\ArcGIS10.3\\lib\\site-packages\\win32',
'C:\\Python27\\ArcGIS10.3\\lib\\site-packages\\win32\\lib']
&amp;gt;&amp;gt;&amp;gt;&lt;/PRE&gt;&lt;P&gt;Python 3.x is only used by ArcGIS Pro&lt;/P&gt;&lt;P&gt;What is that you need in 3.4?&amp;nbsp; The differences are really not major with the exception of access to previously non-existent modules.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:34:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/importerror-no-module-named-base-when-importing/m-p/741600#M57328</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-12T07:34:16Z</dc:date>
    </item>
    <item>
      <title>Re: ImportError: No module named '_base' when importing arcpy</title>
      <link>https://community.esri.com/t5/python-questions/importerror-no-module-named-base-when-importing/m-p/741601#M57329</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I resolved the problem by uninstalling Python 3.4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure if there's a workaround for also having Python 3.4 on your machine and running arcpy, but I wasn't able to get it to work for some reason.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That's kind of a shame. What if someone had other Python scripts already written in Python 3.4? Would they have to delete Python 3.4 and revert back to 2.7?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 May 2015 18:42:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/importerror-no-module-named-base-when-importing/m-p/741601#M57329</guid>
      <dc:creator>PiyaliKundu</dc:creator>
      <dc:date>2015-05-28T18:42:38Z</dc:date>
    </item>
    <item>
      <title>Re: ImportError: No module named '_base' when importing arcpy</title>
      <link>https://community.esri.com/t5/python-questions/importerror-no-module-named-base-when-importing/m-p/741602#M57330</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There was no specific reason other than wanting to get familiar with the newer Python version, but say if someone had other files already written in 3.4 before trying to run arcpy? Would they have to delete Python 3.4 in order to get arcpy to work?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 May 2015 18:43:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/importerror-no-module-named-base-when-importing/m-p/741602#M57330</guid>
      <dc:creator>PiyaliKundu</dc:creator>
      <dc:date>2015-05-28T18:43:45Z</dc:date>
    </item>
    <item>
      <title>Re: ImportError: No module named '_base' when importing arcpy</title>
      <link>https://community.esri.com/t5/python-questions/importerror-no-module-named-base-when-importing/m-p/741603#M57331</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No...you set up the paths properly and both can coexist nicely.&amp;nbsp; But you solved your own problem, which is good.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 May 2015 18:59:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/importerror-no-module-named-base-when-importing/m-p/741603#M57331</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2015-05-28T18:59:46Z</dc:date>
    </item>
    <item>
      <title>Re: ImportError: No module named '_base' when importing arcpy</title>
      <link>https://community.esri.com/t5/python-questions/importerror-no-module-named-base-when-importing/m-p/741604#M57332</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just wanted to share my problem and a fix.&lt;/P&gt;&lt;P&gt;We get quarterly update from our data provider, and the code is written in Python 2.7, and I really have not had the time to begin to convert 2.7 to 3.6 code.&lt;/P&gt;&lt;P&gt;I need part of the code to run in 3.6 because part of the data goes to our Google Cloud Storage. I separated this function and used subprocess.call("C:\Program Files\ArcGIS\Pro\bin\Python\Scripts\propy.bat", "file.py"]), and was getting the '_base' error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the file.py, when importing libraries, I imported sys and then removed all the paths to 2.7, then called arcpy:&lt;/P&gt;&lt;P&gt;import sys&lt;BR /&gt; listPath = sys.path&lt;BR /&gt; sys.path.remove(listPath[1])&lt;BR /&gt; sys.path.remove(listPath[1])&lt;BR /&gt; sys.path.remove(listPath[1])&lt;/P&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried listPath.startswith("c:\\program files (x86)\\arcgis") but it didn't find all the 2.7 paths.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will only delete the paths&amp;nbsp;&lt;SPAN style="text-decoration: underline;"&gt;temporarily!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jan 2019 19:29:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/importerror-no-module-named-base-when-importing/m-p/741604#M57332</guid>
      <dc:creator>NickSparks</dc:creator>
      <dc:date>2019-01-17T19:29:11Z</dc:date>
    </item>
  </channel>
</rss>

