One of our students is trying to install the mido package in ArcGIS Pro 3.2 in the Python command panel for use in a Jupyter notebook, but is getting "DirectoryNotACondaEnvironmentError" when using a terminal environment to install the package.
She tried switching to one of the environments that showed when she listed the conda environments,
Has tried: conda create -n <ENVNAME> and gets same error.
Any suggestions?
in a cloned environment you could try a pip install.
I just did a --dry-run so it wouldn't install the package, so remove that bit
(arcgispro-py3) C:\arc_pro\bin\Python\envs\arcgispro-py3>pip install mido --dry-run
Collecting mido
Obtaining dependency information for mido from https://files.pythonhosted.org/packages/39/2c/df005c4b310dde2c834431032139bf2c3924f81798013feb052d1afd543b/mido-1.3.2-py3-none-any.whl.metadata
Downloading mido-1.3.2-py3-none-any.whl.metadata (6.4 kB)
Collecting packaging~=23.1 (from mido)
Obtaining dependency information for packaging~=23.1 from https://files.pythonhosted.org/packages/ec/1a/610693ac4ee14fcdf2d9bf3c493370e4f2ef7ae2e19217d7a237ff42367d/packaging-23.2-py3-none-any.whl.metadata
Downloading packaging-23.2-py3-none-any.whl.metadata (3.2 kB)
Downloading mido-1.3.2-py3-none-any.whl (54 kB)
---------------------------------------- 54.6/54.6 kB 704.3 kB/s eta 0:00:00
Downloading packaging-23.2-py3-none-any.whl (53 kB)
---------------------------------------- 53.0/53.0 kB 1.4 MB/s eta 0:00:00
Would install mido-1.3.2 packaging-23.2
(arcgispro-py3) C:\arc_pro\bin\Python\envs\arcgispro-py3>
Hi Dan,
Thanks for writing back. I have already pip installed in the arcgis clone environment, but when I try to subsequently import the library into arcgis for use, I get a ModuleNotFound error message.
are you activating the environment that contains the package?
Pro runs in the arcgispro-py3 environment by default. You have to activate a cloned environment in Pro in order to use the packages from the clone
Hi Dan,
Yes, the clone environment is active in ArcGIS Pro.
Is the import being done in the python window within Pro? a separate python IDE? a notebook?
That environment has to be activated as well.
If that doesn't work, ...Tech Support .... since I use package imports regularly from with the default or a cloned environment
Hi Dan,
The import that gives the error message was done in the python notebook in ArcGIS Pro. When I open a Jupyter Notebook from the Python command prompt, the import runs without error, but I have not been able to do the same within ArcGIS Pro. I have the environment activated in ArcGIS Pro (the image shown in my last post). Is there somewhere else I am supposed to activate the environment?
Thanks
If that is the environment that it is installed in, and the jupyter notebook uses the same environment
From a Notebook inside of Pro with your clone activated, do the following.
You will have to substitute your install folder, your clone name to check. Then fire up windows file explorer and see if the package is installed there.
Hi Dan,
I checked the folder where you said the package should be installing, and it was not listed there. I looked back at my pip install command and can see that it is installing to a different file pathway. How can I adjust the pip install command so that it is installing in the correct place?
Thanks
Hi Dan,
I got the package to install in the correct place, and everything is working now. Thank you so much for the help!