Jun-18-2023, 05:19 PM
(This post was last modified: Jun-18-2023, 05:20 PM by ao_tex_mal.)
Hi All,
Quick question - not related explicitly to python code - more related to installing packages.
When I try to install packages with pip install - by default it gets installed to Python 3.10 site-packages location as below, notice the
So first question is - why is that happening and how do I change that behavior? I want pip to install packages to 311 directory by default without having to specify the target every time. I thought the PATH variable being defined and set int he right order should achieve that.
Second question is that if I do force the package to be installed in 3.11 by using
I checked the 3.11 site-packages directory to make sure it is installed and it is. Not sure why the code still won't run on 3.11
All help appreciated.
Thanks in advance.
Quick question - not related explicitly to python code - more related to installing packages.
When I try to install packages with pip install - by default it gets installed to Python 3.10 site-packages location as below, notice the
python310
directory.PS C:\Users\abhik\Nextcloud\Python\Desktop> pip install lxml Requirement already satisfied: lxml in c:\users\abhik\appdata\local\programs\python\python310\lib\site-packages (4.9.2)However my default python version is python 311 and the environment variables have 3.11 paths first in order.
PS C:\Users\abhik\Nextcloud\Python\Desktop> py -V Python 3.11.4
So first question is - why is that happening and how do I change that behavior? I want pip to install packages to 311 directory by default without having to specify the target every time. I thought the PATH variable being defined and set int he right order should achieve that.
Second question is that if I do force the package to be installed in 3.11 by using
py -m pip install
it does work but even after that when I execute the code with 3.11 as the interpreter it produces an error saying the package is not installed. Code works as intended on 3.10.PS C:\Users\abhik\Nextcloud\Python\Desktop> py -m pip install lxml Requirement already satisfied: lxml in c:\users\abhik\appdata\local\programs\python\python311\lib\site-packages (4.9.2)I am using VS Code with Jupyter extensions, here is a sample of the error (not full code).
I checked the 3.11 site-packages directory to make sure it is installed and it is. Not sure why the code still won't run on 3.11
All help appreciated.
Thanks in advance.