'Access is denied' while i am running a command in powershell

asked 2020-06-05T09:39:28.927+00:00
Pranav Ravuri 21 Reputation points

Hi, I am new to the powershell so this might be an easy question. I am trying to make a python 3.7 virtual environment using virtualenv. to give you a context in already have python 3.8 in my laptop what is also added to the path variable but python 3.7 is not added to the path variable while installation. the command I ran was but I am getting 'Access is denied' error can anyone help.
PS D:\Pranav\Software Output\Python> virtualenv --python="C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Python 3.7" p37\env1
RuntimeError: failed to query C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Python 3.7 with code 13 err: 'Access is denied'

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
4,559 questions
No comments
{count} votes

Accepted answer
  1. answered 2020-06-05T18:39:13.64+00:00
    Manu Philip 14,026 Reputation points Microsoft MVP

    Try the following syntax

    python3 -m venv /path/to/new/virtual/environment

    Here is the documentation: https://docs.python.org/3/library/venv.html

    Please mark as "Accept the answer" if the above steps helps you. Others with similar issues can also follow the solution as per your suggestion

    Regards,

    Manu

    No comments

1 additional answer

Sort by: Most helpful
  1. answered 2020-06-05T11:07:43.567+00:00
    T. Kujala 8,401 Reputation points

    Have you verified that you run the command as administrator?

    You can also check that you have enough rights to the target (D:\Pranav...}

    9155-runas-ps.jpg