Greetings All,
I just updated to ArcGIS Pro 2.9, and the following happens in the Python Command Prompt (also see copy/paste from the Python Command Prompt Terminal):
- I start out in default environment. If I launch python, it starts as expected, no problem so far.
- I activate another environment with packages I normally use. Activation appears to happen without issue, but when I launch python, I get the warning This Python interpreter is in a conda environment, but the environment has
not been activated. Libraries may fail to load. To activate this environment
please see https://conda.io/activation - With this instance of python running, if I try importing a package that's in my custom environment (in the example below the package is dbfread), it says the package does not exist.
- However, a workaround is to run cd Scripts in the cmd prompt to go one folder deeper from ~\Python\envs\arcgispro-py3 to ~\Python\envs\arcgispro-py3\Scripts. If I do this and launch python, the warning disappears and I can import packages unique to the environment.
All in all, this is a minor inconvenience, i.e., all I have to do is enter cd Scripts before changing environments, but I want to raise it as a quality issue as it should not be necessary.
Lastly, in case you're asking why I don't just use the GUI environment manager, I find the command interface to be less buggy and more transparent (e.g., I can see how things are progressing rather than worrying that something has frozen).
Everything I described is in command line excerpt below. Also, this problem existed with the last version of Pro as well.
(arcgispro-py3) C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3>python
Python 3.7.11 [MSC v.1927 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> quit()
(arcgispro-py3) C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3>activate arcgispro-nov042021
(arcgispro-nov042021) C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3>python
Python 3.7.11 [MSC v.1927 64 bit (AMD64)] :: Anaconda, Inc. on win32
Warning:
This Python interpreter is in a conda environment, but the environment has
not been activated. Libraries may fail to load. To activate this environment
please see https://conda.io/activation
Type "help", "copyright", "credits" or "license" for more information.
>>> import dbfread
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'dbfread'
>>> quit()
(arcgispro-nov042021) C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3>cd scripts
(arcgispro-nov042021) C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Scripts>activate arcgispro-nov042021
(arcgispro-nov042021) C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Scripts>python
Python 3.7.10 [MSC v.1927 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import dbfread
>>> quit()
(arcgispro-nov042021) C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Scripts>