I started working through ex46 using the Windows procedures. I only have Python 3.6 installed. I got to the part where I type pip list and this was the result:
PS C:\Users\dswal\AppData\Local\Programs\Python\Python36\Doug> pip list
Package Version
---------- -------
pip 18.1
setuptools 40.6.2
You are using pip version 18.1, however version 20.3b1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
This has frozen me since I know Python is now at 3.9 but the book is for 3.6 so I’ve stuck with 3.6. Should I do the upgrade as suggested or is it okay to proceed ahead without doing that? I wasn’t sure what I got qualified as a deprecation warning or not and I know the book says I can ignore deprecation warnings.
I’m guessing the discrepancy is due to changes in virtualenv since the book was written? Not sure. But after that I hit a brick wall in Powershell when I tried to activate it…
PS C:\Users\dswal\AppData\Local\Programs\Python\Python36\doug> .\.venvs\lpthw\Scripts\activate
.\.venvs\lpthw\Scripts\activate : File
C:\Users\dswal\AppData\Local\Programs\Python\Python36\doug\.venvs\lpthw\Scripts\activate.ps1 cannot be loaded because
running scripts is disabled on this system. For more information, see about_Execution_Policies at
https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ .\.venvs\lpthw\Scripts\activate
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
I’m going to look through the forum and see if someone else ran into this before me and got past it. But in case not, I posted the above.
I guess I should also mention that Avast keeps analyzing my Python executables. It did it when I ran pip and did it again when I ran virtualenv. It let both through after analysis but is this something I should take proactive action on and disable something in Avast or set up some sort of exception?
You have to tell your system that it’s okay to execute scripts, which isn’t allowed by default for security reasons. Follow that link in the error message.