"get_python_lib() :for pip install, data_files with get_python_lib() are copied with duplicate path name on ubuntu"

Saba Kauser skauser at rocketsoftware.com
Tue Apr 9 01:29:16 EDT 2019

Hi there,

I have the following in setup.py :
from distutils.sysconfig import get_python_lib

data_files = [ (get_python_lib(), ['./README.md']),
(get_python_lib(), ['./LICENSE']),
 (get_python_lib(), ['./CHANGES']),
(get_python_lib(), ['./config.py.sample'])]

setup( name = PACKAGE,
version = VERSION,
license = LICENSE,
description = 'Python DBI driver for DB2 (LUW, zOS, i5) and IDS',
author = 'IBM Application Development Team',
data_files = data_files,
include_package_data = True,
cmdclass = cmd_class,
Can be seen at : https://github.com/ibmdb/python-ibmdb/blob/master/IBM_DB/ibm_db/setup.py#L286

Distributor ID: Ubuntu
Description:    Ubuntu 16.04.3 LTS
Release:        16.04
Codename:       xenial

Pip install is copying files under a duplicate append of current site-package path. E.g:

On other platforms, the files are correctly copied under /work/skauser/python_installations/python27/lib/python2.7/site-packages.
>From python command line on ubuntu, get_python_lib() returns the correct path:
Type "help", "copyright", "credits" or "license" for more information.
>>> from distutils.sysconfig import get_python_lib
>>> get_python_lib()

I need to know why is the incorrect behavior while using pip.

Building the source as:
Python setup.py build
Python setup.py install
Copies the files correctly.

Any help is appreciated!
Saba Kauser
Db2 Connect development and support.

Rocket Software Development India Pvt Ltd
Karle Town Centre - SEZ,
HUB 1 building, 4th Floor (North West Wing),
100 ft. Kempapura road, adjacent to Nagawara lake,
Nagawara, Bangalore - 560 045
E: skauser at rocketsoftware.com<mailto:skauser at rocketsoftware.com>

Rocket Software, Inc. and subsidiaries ? 77 Fourth Avenue, Waltham MA 02451 ? Main Office Toll Free Number: +1 855.577.4323
Contact Customer Support: https://my.rocketsoftware.com/RocketCommunity/RCEmailSupport
Unsubscribe from Marketing Messages/Manage Your Subscription Preferences - http://www.rocketsoftware.com/manage-your-email-preferences
Privacy Policy - http://www.rocketsoftware.com/company/legal/privacy-policy

This communication and any attachments may contain confidential information of Rocket Software, Inc. All unauthorized use, disclosure or distribution is prohibited. If you are not the intended recipient, please notify Rocket Software immediately and destroy all copies of this communication. Thank you.

More information about the Python-list mailing list