3

Is there a way how to import Python library like pandas into script without using pip install? I already tried downloading .whl file or raw source code and try to use

sys.path.append(path to library)
import pandas

what I found should be solution but it's not working. The thing is I can't use any external program or pip to install libraries. Is there a way how to do it by linking it explicitly?

Thanks

TeaPack
  • 41
  • 4

1 Answers1

0

Python import looks for packages in sys.path, so in general using the sys.path "hack" should work. Alternatively you could add your package path to PYTHONPATH, which then will be added to sys.path too.

However, with Pandas this doesn't work. Pandas uses C extensions (mostly written using Cython) to speed up certain operations. To install pandas from source, you need to compile these C extensions, which means you need a C compiler.

If you're not even allowed to use pip, this probably applies to a C compiler above all.

Peter
  • 10,959
  • 2
  • 30
  • 47