ArcGIS Pro Error of Import Python Modules

462
2
11-15-2021 12:29 AM
SoknaLy
New Contributor II

Hi, 

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
DanPatterson
MVP Esteemed Contributor

do the import one at a time.

import os

then

import arcpy

then

import arcgis

then

import pandas

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


... sort of retired...
SoknaLy
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