Python Forum
how to import a module which is installed to personal folder using pip install --pre? - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: how to import a module which is installed to personal folder using pip install --pre? (/thread-24842.html)



how to import a module which is installed to personal folder using pip install --pre? - geekgeek - Mar-06-2020

I know there are multiple ways to install a python module. My question is related to the following installation:

pip3 install exchangelib --prefix /my/own/path1

the installation is good. But not sure how to make the "import exchangelib" work. Tried with sys.path.append and set the PYTHONPATH environment variable. These two methods are good for the module installed with "pip install exchangelib --target /my/own/path2"

Do we know what the difference among those two installations?

Thanks.

I forgot to mentioned that python3.7.6 is used.


RE: how to import a module which is installed to personal folder using pip install --pre? - Larz60+ - Mar-07-2020

don't try to install to a personal folder, it will cause you problems next time you update python
rather, use virtual environment with pyenv
See https://python-forum.io/Thread-pyenv-Simple-Python-Version-Management


RE: how to import a module which is installed to personal folder using pip install --pre? - geekgeek - Mar-09-2020

Thanks for the info. I will use the venv then.

Just for my knowledge - what is the right way to import a module which was installed by 'pip3 install prefix /my/own/path1' ?