As I don't have the permission to install Python packages, and I need to use an external library, I am trying to copy all the source files from an installed version of that package in a folder and then use those files instead of installing the package. Also I don't want to use virtual environment for this task.
So this is what I have done:
I have installed the library, lets call it
external_lib
on a machine that I have permission to install it.I have copied all the files of that library to a folder; lets call it
ext_lib_folder
, that is at the same level of my Python code (that is going to use that library).I have added this to my python code:
import sys, os file_path = 'ext_lib_folder/' sys.path.append(os.path.dirname(file_path)) import external_lib
But when I try to run the code I get error as:
ModuleNotFoundError: No module named 'ext_lib._abcfunpy'; 'ext_lib' is not a package
what is the reason for the error? How can I do what I want to do correctly?