Python Forum
how to import a module which is installed to personal folder using pip install --pre?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to import a module which is installed to personal folder using pip install --pre?
#1
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.
Reply
#2
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-Sim...Management
Reply
#3
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' ?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Compare folder A and subfolder B and display files that are in folder A but not in su Melcu54 3 525 Jan-05-2024, 05:16 PM
Last Post: Pedroski55
  is import cointegration_analysis a recognized module mitcht33 1 424 Nov-06-2023, 09:29 PM
Last Post: deanhystad
  problem in import module from other folder akbarza 5 1,389 Sep-01-2023, 07:48 AM
Last Post: Gribouillis
  can not import anaconda pandas module. PySpark pandas module is imported!! aupres 0 715 Aug-06-2023, 01:09 AM
Last Post: aupres
  import module error tantony 5 3,439 Dec-15-2022, 01:55 PM
Last Post: Lauraburmrs
  Import a module one step back of the path prathampatel9 1 1,070 Sep-21-2022, 01:34 PM
Last Post: snippsat
  ModuleNotFound but pip shows module installed biscotty666 2 1,545 Jul-14-2022, 05:17 PM
Last Post: Axel_Erfurt
  Install any library via pip get an error cannot import name 'SCHEME_KEYS' from 'pip. Anldra12 2 10,612 Jan-04-2022, 01:05 PM
Last Post: Anldra12
  Compare filename with folder name and copy matching files into a particular folder shantanu97 2 4,470 Dec-18-2021, 09:32 PM
Last Post: Larz60+
  How to import file and function in another folder SriRajesh 1 3,147 Dec-18-2021, 08:35 AM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020