0

I have a python package that will depend on a significant number of external, 3rdparty shared libraries. It seems as if the convention is to copy the shared libraries to Library/bin (at least on windows using anaconda). I would prefer to keep the extra shared libraries needed for my package in a separate, package specific folder. Is there an (easy) way to do this with pip or conda or something else?

My first cut at this will be on windows, but linux will be next, so I would like an approach that will work similarly on both platforms.

Also, I am aware of and use virtual environments. But I am looking for a way to isolate the shared libraries needed specifically for one module/package from the other libraries within a virtual environment if possible and not use a separate virtual environment.

Phil
  • 5,822
  • 2
  • 31
  • 60

1 Answers1

0

Create a virtual environment using the venv command: Official Python Docs for venv

This will allow you to create a new python environment which you can configure using the conventional methods you've already found.

But it will also leave your main python environment unpolluted by any changes you make in that virtual environment.

DatHydroGuy
  • 1,056
  • 3
  • 11
  • 18
  • I should have said that I am familiar with using virtual environments and understand that approach to providing isolation between packages. I am looking for an approach that works without resorting to an entirely separate virtual environment. I will update my question. Thanks. – Phil Apr 25 '17 at 16:12
  • 1
    Ah! OK, then you should take a look at the pip '--install-option' and '--target' options. There's a similar question here [Install a Python package into a different directory](http://stackoverflow.com/questions/2915471/install-a-python-package-into-a-different-directory-using-pip) – DatHydroGuy Apr 26 '17 at 07:30
  • Thanks for the link. There seems to be a lot of good discussion there. I believe the ``--target`` option to pip may help me do what I want to do. – Phil Apr 26 '17 at 12:53