0

I am trying to setup a Python virtual environment by using Python's virtualenv package. Because I do not have any Admin. rights I have installed the package using this command:

pip install --user virtualenv

but when I try to set a V.E. by using this command:

virtualenv -p \Python36\python.exe .lpenv

it says that virtualenv is not recognized as a command or a an executable or a batch file. So I thought it must be something related to Windows path, that is, for this package is:

c:\users\me\appdata\roaming\python\python36\site-packages

So I found this about how to create a local path without logging in as an admin account.

I used this command to create a local path:

C:\users\me>%PATH%;c:\users\me\appdata\roaming\python\python36

It does not work. The output is visible in this image:

Error output after trying to add a path to windows path

What is this C:\Program error? Is there anyway to solve my problem without admin rights?

11
  • SET PATH = %PATH%;c:\users\me\appdata\roaming\python\python36
    – Akina
    Commented Jul 10, 2019 at 6:57
  • @Akina It returned this error: Set-Variable : A positional parameter cannot be found that accepts argument '%PATH%'.
    – Vynylyn
    Commented Jul 10, 2019 at 7:06
  • Maybe excess spaces? Try SET PATH=%PATH%;c:\users\me\appdata\roaming\python\python36.
    – Akina
    Commented Jul 10, 2019 at 7:17
  • @Akina Thanks for your time, it returned the error: The term 'c:\users\me\appdata\roaming\python\python36' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. I tried it with other path names like: c:\users and c:\users\me and c:\users\me\appdata not worked.
    – Vynylyn
    Commented Jul 10, 2019 at 7:36
  • @Akina The path that you mentioned above is correct. I have made sure of that.
    – Vynylyn
    Commented Jul 10, 2019 at 7:37

1 Answer 1

0

Update %PATH% in current session

  • in CMD window:

    SET PATH=%PATH%;c:\users\me\appdata\roaming\python\python36
    
  • in PS window

    $ENV:PATH="$ENV:PATH;c:\users\me\appdata\roaming\python\python36"
    

Update %PATH% permanently

Update it in current session. Test carefully that the edition is correct. Then

  • in CMD window to set new value for current user:

    setx PATH "%PATH%"
    
  • in CMD window to set new value for current station (for all users):

    setx PATH "%PATH%" -m
    
  • in PS window to set new value for current user:

    setx PATH "$ENV:PATH"
    
  • in PS window to set new value for current station (for all users):

    setx PATH "$ENV:PATH" -m
    

If you set your OS as "Use PowerShell in CMD window" then use PS commands variant in any window.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .