Correct module for site customization of path
Tim Johnson
thjmmj15 at gmail.com
Fri Nov 1 20:50:12 EDT 2024
On 11/1/24 08:32, dieter.maurer at online.de wrote:
>> ...
>> After the recent upgrades I had to install youtube_dl with pipx for the
>> new python version.
>> When I ran the script which imported youtube_dl, I got an import error
>> as it appears the path to the module
>> was not in sys.path....
> I see at several options:
>
> * install `youtoube_dl` where Python looks for it
> (you can print `sys.path` to find out all the places
> normally checked for importable modules)
>
> * put a (symbolic) link to `youtoube_dl` at a place
> where Python looks for modules
>
> * use Pythons' `.pth' feature to tell Python additional
> places where to look for modules.
> You can place `.pth` files where Python looks for modules
> to be imported
In /usr/lib/python3.12/sitecustomize.py I put the following:
import sys
sys.path.append("path to youtube_dl")
# In /usr/lib/python3.12/sitecustomize.py
# Thanks seems to work for me
cheers
--
Tim
thjmmj15 at gmail.com
More information about the Python-list
mailing list