admin管理员组文章数量:1312774
I bought the book "Learn Python Programming, 4th Edition", and started the installation process. Python 3.12.8 downloaded and installed OK on my WINDOWS 10 PC.
Now the tricky bit which I cannot get past: The book says do everything in a powershell, which I'm happy with, and follow the instructions to make a dir "proj_01" and then run the command: py 3.12 -m venv lpp4ed which creates the lpp4ed sub-dir and adds scripts etc.
Then I get to the bit that does not work:
The command .\lpp4ed\Scripts\activate sets off a windows warning message about scripts being disabled and cannot load the "activate.ps1" script
However, the command .\lpp4ed\Scripts\activate.bat does not set off the warning, but I have no idea if it has done anything or not.
Any help much appreciated
Getting nowhere. I need help to sort this out, I want to learn how to do all this stuff properly but haven't got past the first simple hurdle, very frustrating!
It seems to be something to do with Execution Policy, but changing that seems fraught with danger!
I bought the book "Learn Python Programming, 4th Edition", and started the installation process. Python 3.12.8 downloaded and installed OK on my WINDOWS 10 PC.
Now the tricky bit which I cannot get past: The book says do everything in a powershell, which I'm happy with, and follow the instructions to make a dir "proj_01" and then run the command: py 3.12 -m venv lpp4ed which creates the lpp4ed sub-dir and adds scripts etc.
Then I get to the bit that does not work:
The command .\lpp4ed\Scripts\activate sets off a windows warning message about scripts being disabled and cannot load the "activate.ps1" script
However, the command .\lpp4ed\Scripts\activate.bat does not set off the warning, but I have no idea if it has done anything or not.
Any help much appreciated
Getting nowhere. I need help to sort this out, I want to learn how to do all this stuff properly but haven't got past the first simple hurdle, very frustrating!
It seems to be something to do with Execution Policy, but changing that seems fraught with danger!
Share Improve this question asked Feb 3 at 11:01 KevPKevP 235 bronze badges 1- it would help if you post the exact warning message – juanpa.arrivillaga Commented Feb 3 at 22:11
1 Answer
Reset to default 0Try copy-paste and run this in Powershell:
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted
本文标签: Python virtual environmentStack Overflow
版权声明:本文标题:Python virtual environment - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741826783a2399691.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论