0

I am trying to figure how to install a Python package (ldap3) using a .egg file (fyi, the version of python-ldap3 we need does not have a .whl file) on a system that does not have easy_install available.

I found from an earlier thread (How can I install a .egg Python package on Windows (attempt using easy_install not working)) that I might be able to:

  • Untar the python-ldap3 tar.gz
  • Change dir to the untarred dir
  • run "python setup.py install"

So I tried the above, and it does seem to deploy/install the python-ldap3, but the installation hangs because it looks like it is trying to download something:

# python setup.py install
running install
running bdist_egg
running egg_info
writing requirements to ldap3.egg-info/requires.txt
writing ldap3.egg-info/PKG-INFO
writing top-level names to ldap3.egg-info/top_level.txt
writing dependency_links to ldap3.egg-info/dependency_links.txt
reading manifest file 'ldap3.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'ldap3.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build
creating build/lib
creating build/lib/ldap3
copying ./ldap3/__init__.py -> build/lib/ldap3
copying ./ldap3/version.py -> build/lib/ldap3
creating build/lib/ldap3/abstract
copying ./ldap3/abstract/cursor.py -> build/lib/ldap3/abstract
.
.
.
Installed /usr/lib/python2.6/site-packages/ldap3-2.5.1-py2.6.egg
Processing dependencies for ldap3==2.5.1
Searching for pyasn1>=0.1.8
Reading https://pypi.python.org/simple/pyasn1/

The "python setup.py install" hangs at that last line above ("Reading...."), but if I kill the process then check the python-ldap3 version, it looks like it installed all right:

# pip freeze | grep ldap3
ldap3==2.5.1

Also, FYI, our Python version is 2.6, and the pyasn1 is:

#pip freeze | grep pyasn1
pyasn1==0.4.3

I am not that familiar with Python and Python packaging, so I was wondering:

  1. Is it all right to do the ldap3 2.5.1 installation per above (using the 'python setup.py install', and then just killing the script)?
  2. If not, what would be a safer/better way to get the ldap3 2.5.1 installed?

Thanks in advance!

Jim

EDIT: I forgot to mention that I think that the reason the script hung at the point it did was that we have to do this installation on an "isolated network", with no access to the external Internet, so we actually prefer/need to do the ldap3 installation without any external access.

EDIT 2: I guess that one other thing that is puzzling is why is the "python setup.py install" trying to get "pyasn1>=0.1.8" when "0.4.3" is already installed, since, from the release history, https://pypi.org/project/pyasn1/#history, "0.1.8" is OLDER than "0.4.3"?

EDIT 3: TO be clear, FYI, the package I am working with it the "ldap3" package, from https://github.com/cannatag/ldap3.

user555303
  • 1,146
  • 3
  • 20
  • 44
  • [Here](https://www.lfd.uci.edu/~gohlke/pythonlibs/) you can find wheel packages of various versions of `python-ldap`, check them out. – yorodm Oct 08 '18 at 16:12
  • @yorodm - I just clarified that the package I am talking about is the ldap3 one, https://github.com/cannatag/ldap3. – user555303 Oct 08 '18 at 17:23
  • Your answer is [in this file](https://github.com/cannatag/ldap3/blob/master/requirements.txt). As you can see it requires **that** version in particular, you can try to change the version number and try to build the package (or create a PR since it is already in Github?) – yorodm Oct 08 '18 at 19:18
  • @yorodm - I am aware of that file, and FYI, I did try to change that (as a test) and it was "effective" in that the installer then said it was looking for 0.4.3, BUT the installer STILL complained that the pyasn1 was not installed, even though pyasn1 0.4.3 was definitely installed - a strange problem :(... – user555303 Oct 10 '18 at 12:53

0 Answers0