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

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

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.
7,924 questions
0 comments No comments
{count} votes

Accepted answer
  1. Manu Philip 18,561 Reputation points MVP
    2020-06-05T18:39:13.64+00:00

    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

    0 comments No comments

1 additional answer

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

    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

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.