Select to view content in your preferred language

Can't clone Python env due to missing package

953
7
12-06-2019 07:48 AM
RyanDavis1
Occasional Contributor

Hi -

I'm unable to clone the default arcgispro-py3 env in ArcGISPro 2.4.2.  No matter what I try it give me an error message that openpyxl 2.6.1 doesn't exist.  This makes little sense to me.  Is there anything I can do short of completely reinstalling ArcGIS Pro?

Thanks,

Ryan

0 Kudos
7 Replies
Arne_Gelfert
Regular Contributor

Try this. It will tell you if you have openpyxl  installed. Do this at the Windows command line:

conda list

This lists all the packages that are installed. If you don't see openpyxl, then try:

conda install openpyxl

You might have to accept some other dependencies that need to be installed along with the package.

0 Kudos
RyanDavis1
Occasional Contributor

I probably should have made it clearer in my post, but openpyxl 2.6.1 is already installed.  I'm trying to clone the default environment that comes with ArcGIS Pro.

0 Kudos
DanPatterson_Retired
MVP Emeritus

Do a package check using conda (not the package manager

Try importing it in your script IDE, if it exists

import openpyxl

dir(openpyxl)
 
['DEFUSEDXML',
 'LXML',
 'NUMPY',
 'PANDAS',
 'Workbook',
 '__author__',
... snip

Note that the path you are using must be the one that you installed arcgis Pro in.  If conda doesn't reflect this path then you will have to switch environments.  (I am using Pro 2.5 beta 2, so the openpyxl might be different)

If you need a different version of openpyxl, you will have to install it, but it may be 'pinned' to a version higher than what you want

0 Kudos
RyanDavis1
Occasional Contributor

Well, I was about to send over some screenshots showing that I was in fact in the right environment to clone, but on this attempt the cloning mysteriously worked.  No idea why, but I'm happy it finally stuck.

But, now I get a message saying the clone is required and can't be removed:

ArcGIS Pro says my clone can

Regardless, I don't plan on removing it and am just happy it finally works.

Thanks for your help, Dan Patterson and Arne Gelfert.

0 Kudos
DanPatterson_Retired
MVP Emeritus

You have to activate the other environment before you can delete a clone.  It appears you are on the environment you are trying to delete

RyanDavis1
Occasional Contributor

Ah, that makes sense.  Thanks.

0 Kudos
DanPatterson_Retired
MVP Emeritus
conda install (whatever) --dry-run

Always do a dry-run and examine whatever might be upgraded and/or pinned.

Should things go bad, you can rollback by

conda install --revision (some number and no brackets)

where the revision number was when life was good

0 Kudos