merto-dvp
merto-dvp

Reputation: 41

Anaconda Environment Error - Access denied

I had Anaconda installed before, but it wasn't responding (Python & VS Code acts weird) so i decided to remove and install again.

After that I installed and created an environment again. Command prompt recognizes conda/anaconda commands but when I try to activate environment it just leaves an error message "Access denied". Also VS Code cannot activate any environment. But can run Python scripts without it.

Used commands:

>>conda create -n tensorflow1 pip python=3.5

>>activate tensorflow1 conda activate tensorflow1

Error messages:

>>C:\tensorflow1\models\research\object_detection>activate tensorflow1
>>>Erişim engellendi.

>C:\tensorflow1\models\research\object_detection>python3 Object_detection_video.py
>>'python3' is not recognized as an internal or external command, operable program or batch file.

>C:\tensorflow1\models\research\object_detection>python Object_detection_video.py
>>Traceback (most recent call last):File "C:\tensorflow1\models\research\object_detection\Object_detection_video.py", line 21, in <module>
>>>import cv2
>>>ModuleNotFoundError: No module named 'cv2'

>>C:\tensorflow1\models\research\object_detection>conda activate tensorflow1
>>>Erişim engellendi. -->(Translates to Access denied.)

It seems like Python works normally, but cannot activate any environments. I'm using Win 10 Home 64 Bit.

Tried:

Any ideas? Thanks.

Update:

C:\Users\Administrator>conda env list
># conda environments:#
base                  *  C:\ProgramData\Anaconda3
tensorflow1              C:\Users\Administrator\.conda\envs\tensorflow1


C:\Users\Administrator>activate base
Erişim engellendi.
Erişim engellendi.
The system cannot find the file D:\TEMP\conda-2082\conda.tmp.

Maybe it's about User privileges? I am Administrator. Added Full Access to all users in TEMP folder security options but still same issue.

Update #2:

The system cannot find the file D:\TEMP\conda-2082\conda.tmp.

Setting TEMP folder to Windows installed drive "C:" fixed the problem for me.

Upvotes: 4

Views: 3677

Answers (1)

Snehal Nair
Snehal Nair

Reputation: 191

  1. Create a new environment
$ conda create -n "tensorflow2" “python=3.5” ipython
  1. Check if the newly created environment, 'tensorflow2' exists
$ conda env list
  1. If environment exists activate it
$ conda activate tensorflow2
  1. If environment doesn't exist, run the below command to delete the environment and repeat steps 1 - 3
$ conda env remove -n tensorflow2
  1. To check if the environment is using the right python executable
$ python
>>> import sys
>>> sys.executable
>>> sys.version
>>> quit()

Upvotes: 1

Related Questions