Installing virtualenvwrapper-powershell in Windows 8.1, import-module failing

前端 未结 2 1627
囚心锁ツ
囚心锁ツ 2021-01-06 04:46

I\'m trying to follow the guide here, and I\'m stuck at Import-Module virtualenvwrapper, where PowerShell keeps giving me the error:

impo

相关标签:
2条回答
  • 2021-01-06 05:41

    Thank you for coming back with a solution. This helped me today. I would also like to add that I had to do an extra step to make it work on Windows 10.

    I was getting an error trying to run:

    Import-Module virtualenvwrapper

    "Get-Content : Cannot find path 'Function:\TabExpansion' because it does not exist."

    The solution that I found, was to edit VirtualenvWrapperTabExpansion.psm1 on line 15 from this:

    $_oldTabExpansion = Get-Content Function:TabExpansion
    

    to this:

    $_oldTabExpansion = Get-Content Function:TabExpansion2
    
    0 讨论(0)
  • 2021-01-06 05:47

    Well, I've actually figured my way around this issue. I guess the pip install never placed the files in a correct module directory for PowerShell. I created a WindowsPowerShell\Modules folder in my documents folder, which did not exist but was listed in my PowerShell modules path. I then took the VirtualEnvWrapper directory from the virtualenvwrapper-powershell bitbucket and copied it into the Modules folder I just created.

    Then I had to use Set-ExecutionPolicy Unrestricted instead of Set-ExecutionPolicy RemoteSigned as shown in the guide, but I was then able to do the import-module and use everything needed. I'm not sure why I had to all of this manually instead of pip having done it, but I just hope this can somehow help someone else.

    0 讨论(0)
提交回复
热议问题