Install python package into directory relative to site-packages

David Poxon

I have a Python package that is one of a collection of company Python packages. When I run

python setup.py install

I want the package to be installed to a common company directory, along with other company packages. I want this directory to be relative to the default Python install directory, e.g.,

/usr/lib/python2.7/site-packages/<company_name>/<python_package_name>

That is, I want to insert <company_name> into the installation path at install time.

I've seen ways to prefix this path, but can't seem to work out how to do what I've described.

Mikko Ohtamaa

Unfortunately Python packaging doesn't work like that. You could probably bend it to work like that but that would be quite an effort for a person without experience in Python packaging and even for experienced persons the amount/output tradeoff would not make sense. You do not mention any motive to do this besides your personal preference.

Instead, to have well-managed and human-navigable package installation folder, I recommend you to study the following resources

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Java

What is python's site-packages directory?

From Dev

Install package without internet: error in install.packages: no such file or directory

From Dev

Install package without internet: error in install.packages: no such file or directory

From Dev

Anaconda overriding python as the default site-packages directory windows 7

From Java

Install a Python package into a different directory using pip?

From Dev

selenium getting install under python 2.7 site packages

From Dev

Why is Python 3 looking in my Python 2.7 package directory for packages?

From Dev

A pip install to include template/static files in actually app directory (not just in the site-packages dir)

From Dev

multiple install of python, package install by pip are in wrong directory windows

From Dev

user site-package directory

From Dev

Bash script to install package if already not installed (From a directory with many packages) - Fedora 17

From Dev

Install in user site-package

From Dev

Packages already in ./anaconda/lib/python2.7/site-packages, how can I install it in usr/local/lib/python2.7?

From Dev

Packages already in ./anaconda/lib/python2.7/site-packages, how can I install it in usr/local/lib/python2.7?

From Java

How do I find the location of my Python site-packages directory?

From Dev

Can't load Python modules installed via pip from site-packages directory

From Dev

Use local copy of python package rather than the one installed in site-packages

From Dev

Install python packages on OpenShift

From Dev

Change directory in python, relative path

From Dev

Install package into custom directory Composer

From Dev

Install R package to a specific directory

From Dev

Install R package to a specific directory

From Dev

Is impossible to install openastro.org package due missing python-dateutil, python-rsvg and imagemagick packages

From Dev

Global npm packages are install on different user directory

From Dev

Is there a way to list Chocolatey packages with their install directory?

From Dev

Using dpkg to install packages from a local directory

From Dev

What is a good temporary install directory for Debian packages?

From Dev

Install a particular version of a package and related packages

From Dev

Automatically install packages/dependencies for installation of an arbitrary package?

Related Related

  1. 1

    What is python's site-packages directory?

  2. 2

    Install package without internet: error in install.packages: no such file or directory

  3. 3

    Install package without internet: error in install.packages: no such file or directory

  4. 4

    Anaconda overriding python as the default site-packages directory windows 7

  5. 5

    Install a Python package into a different directory using pip?

  6. 6

    selenium getting install under python 2.7 site packages

  7. 7

    Why is Python 3 looking in my Python 2.7 package directory for packages?

  8. 8

    A pip install to include template/static files in actually app directory (not just in the site-packages dir)

  9. 9

    multiple install of python, package install by pip are in wrong directory windows

  10. 10

    user site-package directory

  11. 11

    Bash script to install package if already not installed (From a directory with many packages) - Fedora 17

  12. 12

    Install in user site-package

  13. 13

    Packages already in ./anaconda/lib/python2.7/site-packages, how can I install it in usr/local/lib/python2.7?

  14. 14

    Packages already in ./anaconda/lib/python2.7/site-packages, how can I install it in usr/local/lib/python2.7?

  15. 15

    How do I find the location of my Python site-packages directory?

  16. 16

    Can't load Python modules installed via pip from site-packages directory

  17. 17

    Use local copy of python package rather than the one installed in site-packages

  18. 18

    Install python packages on OpenShift

  19. 19

    Change directory in python, relative path

  20. 20

    Install package into custom directory Composer

  21. 21

    Install R package to a specific directory

  22. 22

    Install R package to a specific directory

  23. 23

    Is impossible to install openastro.org package due missing python-dateutil, python-rsvg and imagemagick packages

  24. 24

    Global npm packages are install on different user directory

  25. 25

    Is there a way to list Chocolatey packages with their install directory?

  26. 26

    Using dpkg to install packages from a local directory

  27. 27

    What is a good temporary install directory for Debian packages?

  28. 28

    Install a particular version of a package and related packages

  29. 29

    Automatically install packages/dependencies for installation of an arbitrary package?

HotTag

Archive