ArcGIS Pro Error of Import Python Modules

11-15-2021 12:29 AM
New Contributor II


I run into this error when importing Python modules to ArcGIS Pro 2.8.

Its last line is: Typeerror: expected string or bytes-like object.

Anyone has any ideas to sort this out?

Thank you.


0 Kudos
2 Replies
MVP Esteemed Contributor

do the import one at a time.

import os


import arcpy


import arcgis


import pandas

what is the message if it fails again?  (doing it one at a time narrows down the issue list)

... sort of retired...
New Contributor II

Thank Dan,

The same error message appeared, unfortunately. But thank you for trying to help. I really appreciate your contribution.

Anyway, I have sorted it out. I have just remembered that a few weeks ago, I cloned the Python Environment in ArcGIS to install Deep Learning Libraries. Unfortunately, I have not finished the process and the cloned Python Environment was activated. So, i guess the system could not locate the folders of the cloned Environment (it, by default, directed to folders of the installed Python Environment). So, what i did was just activating the installed Python Environment in the Setting and restart ArcGIS application. Everything works fine!

Thank Dan.


0 Kudos