Please refer to the URL below for the Virtual Environments used here.
Create a venv environment under c:\sample\venv-test1.
py -m venv c:\sample\venv-test1
Move the current directory to venv environment.
C:\sample> cd c:\sample\venv-test1
C:\sample\venv-test1> .\Scripts\activate.bat
(venv-test1) C:\sample\venv-test1>
Just to be sure, check the priorities of pip.exe and python.exe (if you are unsure).
(venv-test1) C:\sample\venv-test1>where pip
c:\sample\venv-test1\Scripts\pip.exe
C:\Users\oralton\AppData\Local\Programs\Python\Python311\Scripts\pip.exe
(venv-test1) C:\sample\venv-test1>where python
c:\sample\venv-test1\Scripts\python.exe
C:\Users\oralton\AppData\Local\Programs\Python\Python311\python.exe
C:\Users\oralton\AppData\Local\Microsoft\WindowsApps\python.exe
(venv-test1) C:\sample\venv-test1>py -0p --list-paths
* c:\sample\venv-test1\Scripts\python.exe
-V:3.11 C:\Users\oralton\AppData\Local\Programs\Python\Python311\python.exe
Install the module.
Here we will take pandas installation as an example.
(venv-test1) C:\sample\venv-test1>python -m pip install pandas
Collecting pandas
......
Installing collected packages: pytz, tzdata, six, numpy, python-dateutil, pandas
Successfully installed numpy-1.26.1 pandas-2.1.2 python-dateutil-2.8.2 pytz-2023.3.post1 six-1.16.0 tzdata-2023.3
The list of modules now looks like this.
(venv-test1) C:\sample\venv-test1>python -m pip list
Package Version
--------------- ------------
numpy 1.26.1
pandas 2.1.2
pip 23.3.1
python-dateutil 2.8.2
pytz 2023.3.post1
setuptools 65.5.0
six 1.16.0
tzdata 2023.3
Create a file called "test1_pandas.py" under the "C:\sample\venv-test1>" folder.
Write the following 5 lines in this file.
import pandas
dat = {'x': [100, 200, 300, 400],
'y': [10, 20, 30, 40]}
df = pandas.DataFrame(dat)
print(df)
I'll try running it as is.
(venv-test1) C:\sample\venv-test1>python test1_pandas.py
x y
0 100 10
1 200 20
2 300 30
3 400 40
Drag and drop the "test1_pandas.py" file you created to ClickPyLogger.
Then, drag and drop "c:\sample\venv-test1\Scripts\python.exe" to ClickPyLogger.
Press the run button (triangle button) to run.