Due to not effecting the global python installation on your system (which should be clean as possible), it is recommended to install third party Python packages into virtual environments.

A virtual environment in Python is a kind of layer above the global installation which contains the site-packages and some links to the Python binaries. In Windows those links are executables which act as proxy - which by the way can make the subprocess controlling a bit more difficult, but thats another topic.

Latestly since Ubuntu 23.04 it isn’t possible to install packages globally using pip, here you either have to use apt if your package is listed there or a Python virtual environment.

Linux

At first install your desired python version (if not already done), a matching venv and pip:

$ sudo apt-get update
$ sudo apt-get install python3.11 python3.11-venv python3-pip -y

After that create a virtual environment. If it is planned to make it available for all users, /usr/local/bin/.venv-conan could be a good place:

$ sudo python3 -m venv /usr/local/bin/.venv-conan --system-site-packages

The option --system-site-packages allows usage of the site-packages from the global installation. This could be useful if there are other third parties installed which may should be usable inside the new virtual environmen.

Now we are ready to install conan (or your desired package) into the newly created environment:

$ sudo source /usr/local/bin/.venv-conan/bin/activate && pip3 install conan==1.*

In the example above I explicitly told pip to install the newest conan minor of version 1.
If you want the newest one, just use conan instead.

By installing conan a binary is created inside the virtual environment which now can be made globally available by putting a link to it into /usr/local/bin:

$ sudo ln -s /usr/local/bin/.venv-conan/bin/conan /usr/local/bin/conan

At least check it without super user rights and you’re done:

$ conan --version
Conan version 1.62.0

Windows

Even if Windows is not as restrictive as the newer Linux distros are, even here it is good practice to keep the global Python installations clean and work with virtual environments.

Install your preferred Python version (of course the newest one) including the py-launcher (this is to be selected at the installation procedure).

Check if your installation works (remind to re/start your shell after installation), here I’m using Python 3.11:

> py -3.11 --version
Python 3.11.6

Now create the virtual environment in a globally accessible location, for instance %ProgramData% (which by default is C:\ProgramData).

> py -3.11 -m venv %ProgramData%\.venv-conan

After that you can either activate the new environment and continue working in it, or you can use the Python executables inside the Scripts folder of the virtual environmen directly:

> %ProgramData%\.venv-conan\Scripts\pip install conan==1.*

At least create a symbolic link to the conan executable inside the virtual environments Scripts folder and place it into a location which is inside your systems search %PATH%.
Another solution can be adding %ProgramData%\.venv-conan\Scripts to %PATH%, but that can cause accidentially using the other executables placed there (such as python or pip).
Best practice is to have a system wide available folder which contains such links, for instance in %ProgramData%\links and to add this folder to your %PATH%.

> mkdir %ProgramData%\links
> mklink %ProgramData%\links\conan.exe %ProgramData%\.venv-conan\Scripts\conan.exe
> set PATH=%PATH%;%ProgramData%\links
> conan --version
Conan version 1.62.0