Python Forum
Help with Windows and Python VENV
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with Windows and Python VENV
#1
A friend asked me to check out his AutoCAD drawing. For that I had to start Windows.

While I was in Windows, I thought about a recent thread, a guy complaining that Python didn't do just what he wanted in Windows.

I thought I would install Python. Up came a nice pymanager app, which installed itself then did something.

Then I made a VENV in my user folder called python_general. All good.

Then I got a Powershell going, looks just like bash.

I wanted to start Python in my VENV , but it seems I don't have permission.

Quote:PS C:\Users\peter> python_general\Scripts\activate
python_general\Scripts\activate : File C:\Users\peter\python_general\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
+ python_general\Scripts\activate
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
PS C:\Users\peter>

Could a Windows user please help this poor baffled Linuxer?
Reply
#2
Just to make run so you see how it's done in PowerShell.
This is with Python build in venv.
# Make 
PS E:\div_code> python -m venv python_general
# Cd in
PS E:\div_code> cd .\python_general\
# Activate
PS E:\div_code\python_general> .\Scripts\activate
# Work see (python_general) 
(python_general) PS E:\div_code\python_general>
Your error is a PowerShell’s script-execution policy blocking the venv activation script, Activate.ps1.
Run this once in Powershell.
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned
Pedroski55 likes this post
Reply
#3
Thanks!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Venv - Python Virtual Environment on Raspberry Pi DanneA 4 1,869 Jul-02-2025, 05:41 PM
Last Post: Larz60+
  How does venv update $PATH without activating on Windows? bottomfeeder 3 2,316 Mar-13-2025, 01:46 PM
Last Post: DeaD_EyE
  JenkinsFile to create a Python venv NikitaMathur 2 3,326 Sep-23-2024, 11:33 AM
Last Post: NikitaMathur
  Troubleshooting Jupyter Notebook installation with Python using pip and a venv Drone4four 1 5,682 Jun-04-2024, 10:55 PM
Last Post: Drone4four
  my venv is not loading njoki 1 3,852 Mar-20-2024, 10:41 AM
Last Post: snippsat
  Understanding venv; How do I ensure my python script uses the environment every time? Calab 1 9,475 May-10-2023, 02:13 PM
Last Post: Calab
  Python venv and PIP version issue JanOlvegg 2 6,649 Feb-22-2023, 02:22 AM
Last Post: JanOlvegg
  pip and venv virtual environments soupworks 2 3,718 Dec-30-2020, 11:38 PM
Last Post: soupworks
  Not able to set up a virtual environment with venv mohanp06 7 25,497 Oct-27-2020, 12:18 PM
Last Post: snippsat
  Creating virtual environment with venv arilev 1 3,650 Dec-16-2019, 05:14 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020