How to import anything under the specified map?

I used the command ‘pip install requests’ in order to place that module on the specified map \C:\Program Files\Python’ (under Wiondows 10). Apparently it is automatically placed op the following map ‘C:\Users…\AppData\Roaming\Python\Python39\site-packages’. I dislike that. I wonder how I can place it on the former map in such a way, that several users (within my pc) can use that module.

And further I wonder me how I can update any module via pip, without , that it willm again placed on the latter map disliked.

Howdy Pejamide,

try “python -m pip install …” - whereby “python” should be the full path to the python executable in whose environment you want to install. So in your case probably “C:\Program Files\Python\python.exe -m pip install requests” or similar (I do not know the actual path, in your system, by heart:)…

Maybe the following link might be of further help too:

venv — Creation of virtual environments — Python 3.9.5 documentation

?

Cheers, Dominik

PS: also note, that “pip” and “pip3” might be different pips…

Of course I have done so. See the following result:
PS C:\program files\python> pip install requests
Defaulting to user installation because normal site-packages is not writeable
Collecting requests
Downloading requests-2.25.1-py2.py3-none-any.whl (61 kB)
|████████████████████████████████| 61 kB 561 kB/s
Collecting urllib3<1.27,>=1.21.1
Downloading urllib3-1.26.4-py2.py3-none-any.whl (153 kB)
|████████████████████████████████| 153 kB 1.3 MB/s
Collecting chardet<5,>=3.0.2
Downloading chardet-4.0.0-py2.py3-none-any.whl (178 kB)
|████████████████████████████████| 178 kB 3.2 MB/s
Collecting idna<3,>=2.5
Downloading idna-2.10-py2.py3-none-any.whl (58 kB)
|████████████████████████████████| 58 kB 1.7 MB/s
Collecting certifi>=2017.4.17
Downloading certifi-2020.12.5-py2.py3-none-any.whl (147 kB)
|████████████████████████████████| 147 kB 3.3 MB/s
Installing collected packages: urllib3, chardet, idna, certifi, requests
WARNING: The script chardetect.exe is installed in ‘C:\Users\Beheerder\AppData\Roaming\Python\Python39\Scripts’ which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed certifi-2020.12.5 chardet-4.0.0 idna-2.10 requests-2.25.1 urllib3-1.26.4
WARNING: You are using pip version 20.2.3; however, version 21.1.1 is available.
You should consider upgrading via the ‘c:\program files\python\python.exe -m pip install --upgrade pip’ command.
PS C:\program files\python>

Further my system PATH does contain:
C:\Program files\python>Scripts and C:\Program files\python

What should I have done wrong?

Executing pip from the path C:\program files\python is NOT the same as executing the python.exe in said path with the option -m and the belonging pip argument, so please try:

C:\program files\python.exe -m pip install requests

and if this does not work

C:\program files\python3.exe -m pip3 install requests

or alike. To make it clear: it might not be enough to just be in said directory, use the full path to the python.exe you want to use and do not use pip standalone!

Cheers, Dominik