添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

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'

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,

Start Windows PowerShell with the "Run as administrator" option.

At the command prompt, type:

Set-ExecutionPolicy AllSigned

Accept when prompted.

Try to execute again

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,

When I tried to make a python 3.8 virtual environment (which is my default python version) it gave a similar error (I don't remember the error but it is related to permissions only).
i ran

Set-ExecutionPolicy Unrestricted -Force

to rectify the error and it worked, but now when I wanted to specify a particular python version using a path it is giving me an error

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'

Hope this gives some context

Just a syntax error. The suggestion is from documentation. Glad to know that your issue has been resolved.

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,

Actually we have been replying to TKujala's answer. So for me to "Accept the answer" can you please send the answer again by writing it in "Write an Answer" box.

While sending the answer again sir, can you please sent the link of the documentation so that I could use that in future.

Thankyou