Add custom Python module

937
4
Jump to solution
02-05-2022 09:31 PM
Manu
by
Occasional Contributor

I need to import a custom Python module (pyinaturalist) in ArcGIS Pro.

I created a copy of the base Python environment in the Conda Manager within ArcGIS Pro, but I did not find the module I need in the list of available modules.

I tried the suggestions on this site; however,

myPythonModules = r"C:\Users\Manuel\Python\lib\site-packages\pyinaturalist"
sys.path.append(myPythonModules)
import pyinaturalist

just produced to this error:

---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
In [3]:
Line 3: import pyinaturalist

ModuleNotFoundError: No module named 'pyinaturalist'
--------------------------------------------------------------------------

the other suggestion, to add the line

import sys; sys.path.append(r"C:\Users\Manuel\Python\lib\site-packages\pyinaturalist")

to Program Files > ArcGIS > Pro > bin > Python > envs > arcgispro-py3 > Lib > site-packages > ArcGISPro.pth

was also not working.

So how can I import custom modules and use them in ArcGIS Pro?

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
DanPatterson
MVP Esteemed Contributor

pip install pyinaturalist

is how they said to install it.  pip comes with your conda distribution


... sort of retired...

View solution in original post

0 Kudos
4 Replies
DanPatterson
MVP Esteemed Contributor

pip install pyinaturalist

is how they said to install it.  pip comes with your conda distribution


... sort of retired...
0 Kudos
Manu
by
Occasional Contributor

Thanks, I didn't know I could just run pip install from the Python Command Prompt since the explanations suggested all these other things. (Also, I rarely use Windows and would usually activate a virtual environment from a regular Terminal and then use pip install (I haven't found a way to activate the environment from the Windows Command Prompt and hence gave up on that route))

0 Kudos
KarstenRank
Occasional Contributor III

Hi,

and how can I getting import working without pip install?

0 Kudos
DanPatterson
MVP Esteemed Contributor

you don't, the package is created during the install process.  If you have access to another machine you could give copying the distribution folder in site_packages folder to your machine.  They don't distribute wheels either.


... sort of retired...
0 Kudos