question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to install as a setup.py dependency

See original GitHub issue

In my project when I am trying to install pyxDamerauLevenshtein as a run time dependency in my setuptools’ setup.py file I am getting following error:

Processing dependencies for atarashi==0.0.9

Searching for pyxDamerauLevenshtein>=1.5

Reading https://pypi.org/simple/pyxDamerauLevenshtein/

Downloading https://files.pythonhosted.org/packages/09/d8/77d02800d687ff8e12c8ec7b4ed917249fca27a1bccc6d24f0ac507a794c/pyxDamerauLevenshtein-1.5.tar.gz#sha256=00b836cdb7cff24abe20c2fdc6cdda4ac24413a82cf318c983980ce4aaec7e16

Best match: pyxDamerauLevenshtein 1.5

Processing pyxDamerauLevenshtein-1.5.tar.gz

Writing /tmp/easy_install-r1p8hre8/pyxDamerauLevenshtein-1.5/setup.cfg

Running pyxDamerauLevenshtein-1.5/setup.py -q bdist_egg --dist-dir /tmp/easy_install-r1p8hre8/pyxDamerauLevenshtein-1.5/egg-dist-tmp-twm03pcs

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/setuptools/sandbox.py", line 154, in save_modules
    yield saved
  File "/usr/local/lib/python3.7/site-packages/setuptools/sandbox.py", line 195, in setup_context
    yield
  File "/usr/local/lib/python3.7/site-packages/setuptools/sandbox.py", line 250, in run_setup
    _execfile(setup_script, ns)
  File "/usr/local/lib/python3.7/site-packages/setuptools/sandbox.py", line 45, in _execfile
    exec(code, globals, locals)
  File "/tmp/easy_install-r1p8hre8/pyxDamerauLevenshtein-1.5/setup.py", line 97, in <module>
    "atarashi/build_deps.py",
  File "/usr/local/lib/python3.7/site-packages/setuptools/__init__.py", line 140, in setup
    return distutils.core.setup(**attrs)
  File "/usr/local/lib/python3.7/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/local/lib/python3.7/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/usr/local/lib/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/usr/local/lib/python3.7/site-packages/setuptools/command/bdist_egg.py", line 163, in run
    self.run_command("egg_info")
  File "/usr/local/lib/python3.7/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/local/lib/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/usr/local/lib/python3.7/site-packages/setuptools/command/egg_info.py", line 296, in run
    self.find_sources()
  File "/usr/local/lib/python3.7/site-packages/setuptools/command/egg_info.py", line 303, in find_sources
    mm.run()
  File "/usr/local/lib/python3.7/site-packages/setuptools/command/egg_info.py", line 534, in run
    self.add_defaults()
  File "/usr/local/lib/python3.7/site-packages/setuptools/command/egg_info.py", line 570, in add_defaults
    sdist.add_defaults(self)
  File "/usr/local/lib/python3.7/distutils/command/sdist.py", line 228, in add_defaults
    self._add_defaults_ext()
  File "/usr/local/lib/python3.7/distutils/command/sdist.py", line 311, in _add_defaults_ext
    build_ext = self.get_finalized_command('build_ext')
  File "/usr/local/lib/python3.7/distutils/cmd.py", line 299, in get_finalized_command
    cmd_obj.ensure_finalized()
  File "/usr/local/lib/python3.7/distutils/cmd.py", line 107, in ensure_finalized
    self.finalize_options()
  File "/tmp/easy_install-r1p8hre8/pyxDamerauLevenshtein-1.5/setup.py", line 33, in finalize_options
    # Used for the long_description.  It's nice, because now 1) we have a top level
AttributeError: 'dict' object has no attribute '__NUMPY_SETUP__'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "setup.py", line 174, in <module>
    'build_py': BuildAtarashi,
  File "/usr/local/lib/python3.7/site-packages/setuptools/__init__.py", line 140, in setup
    return distutils.core.setup(**attrs)
  File "/usr/local/lib/python3.7/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/local/lib/python3.7/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/usr/local/lib/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/usr/local/lib/python3.7/site-packages/setuptools/command/install.py", line 67, in run
    self.do_egg_install()
  File "/usr/local/lib/python3.7/site-packages/setuptools/command/install.py", line 117, in do_egg_install
    cmd.run()
  File "/usr/local/lib/python3.7/site-packages/setuptools/command/easy_install.py", line 415, in run
    self.easy_install(spec, not self.no_deps)
  File "/usr/local/lib/python3.7/site-packages/setuptools/command/easy_install.py", line 657, in easy_install
    return self.install_item(None, spec, tmpdir, deps, True)
  File "/usr/local/lib/python3.7/site-packages/setuptools/command/easy_install.py", line 704, in install_item
    self.process_distribution(spec, dist, deps)
  File "/usr/local/lib/python3.7/site-packages/setuptools/command/easy_install.py", line 749, in process_distribution
    [requirement], self.local_index, self.easy_install
  File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 777, in resolve
    replace_conflicting=replace_conflicting
  File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 1060, in best_match
    return self.obtain(req, installer)
  File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 1072, in obtain
    return installer(requirement)
  File "/usr/local/lib/python3.7/site-packages/setuptools/command/easy_install.py", line 676, in easy_install
    return self.install_item(spec, dist.location, tmpdir, deps)
  File "/usr/local/lib/python3.7/site-packages/setuptools/command/easy_install.py", line 702, in install_item
    dists = self.install_eggs(spec, download, tmpdir)
  File "/usr/local/lib/python3.7/site-packages/setuptools/command/easy_install.py", line 887, in install_eggs
    return self.build_and_install(setup_script, setup_base)
  File "/usr/local/lib/python3.7/site-packages/setuptools/command/easy_install.py", line 1155, in build_and_install
    self.run_setup(setup_script, setup_base, args)
  File "/usr/local/lib/python3.7/site-packages/setuptools/command/easy_install.py", line 1141, in run_setup
    run_setup(setup_script, args)
  File "/usr/local/lib/python3.7/site-packages/setuptools/sandbox.py", line 253, in run_setup
    raise
  File "/usr/local/lib/python3.7/contextlib.py", line 130, in __exit__
    self.gen.throw(type, value, traceback)
  File "/usr/local/lib/python3.7/site-packages/setuptools/sandbox.py", line 195, in setup_context
    yield
  File "/usr/local/lib/python3.7/contextlib.py", line 130, in __exit__
    self.gen.throw(type, value, traceback)
  File "/usr/local/lib/python3.7/site-packages/setuptools/sandbox.py", line 166, in save_modules
    saved_exc.resume()
  File "/usr/local/lib/python3.7/site-packages/setuptools/sandbox.py", line 141, in resume
    six.reraise(type, exc, self._tb)
  File "/usr/local/lib/python3.7/site-packages/setuptools/_vendor/six.py", line 685, in reraise
    raise value.with_traceback(tb)
  File "/usr/local/lib/python3.7/site-packages/setuptools/sandbox.py", line 154, in save_modules
    yield saved
  File "/usr/local/lib/python3.7/site-packages/setuptools/sandbox.py", line 195, in setup_context
    yield
  File "/usr/local/lib/python3.7/site-packages/setuptools/sandbox.py", line 250, in run_setup
    _execfile(setup_script, ns)
  File "/usr/local/lib/python3.7/site-packages/setuptools/sandbox.py", line 45, in _execfile
    exec(code, globals, locals)
  File "/tmp/easy_install-r1p8hre8/pyxDamerauLevenshtein-1.5/setup.py", line 97, in <module>
    "atarashi/build_deps.py",
  File "/usr/local/lib/python3.7/site-packages/setuptools/__init__.py", line 140, in setup
    return distutils.core.setup(**attrs)
  File "/usr/local/lib/python3.7/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/local/lib/python3.7/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/usr/local/lib/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/usr/local/lib/python3.7/site-packages/setuptools/command/bdist_egg.py", line 163, in run
    self.run_command("egg_info")
  File "/usr/local/lib/python3.7/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/local/lib/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/usr/local/lib/python3.7/site-packages/setuptools/command/egg_info.py", line 296, in run
    self.find_sources()
  File "/usr/local/lib/python3.7/site-packages/setuptools/command/egg_info.py", line 303, in find_sources
    mm.run()
  File "/usr/local/lib/python3.7/site-packages/setuptools/command/egg_info.py", line 534, in run
    self.add_defaults()
  File "/usr/local/lib/python3.7/site-packages/setuptools/command/egg_info.py", line 570, in add_defaults
    sdist.add_defaults(self)
  File "/usr/local/lib/python3.7/distutils/command/sdist.py", line 228, in add_defaults
    self._add_defaults_ext()
  File "/usr/local/lib/python3.7/distutils/command/sdist.py", line 311, in _add_defaults_ext

    build_ext = self.get_finalized_command('build_ext')
  File "/usr/local/lib/python3.7/distutils/cmd.py", line 299, in get_finalized_command
    cmd_obj.ensure_finalized()
  File "/usr/local/lib/python3.7/distutils/cmd.py", line 107, in ensure_finalized
    self.finalize_options()
  File "/tmp/easy_install-r1p8hre8/pyxDamerauLevenshtein-1.5/setup.py", line 33, in finalize_options
    # Used for the long_description.  It's nice, because now 1) we have a top level
AttributeError: 'dict' object has no attribute '__NUMPY_SETUP__'

But if I install it as a separate call to pip, it installs successfully:

# pip3 install pyxdameraulevenshtein>=1.5
pyxdameraulevenshtein 1.5 requires numpy, which is not installed.

# python3 setup.py install
...
Searching for pyxDamerauLevenshtein==1.5
Best match: pyxDamerauLevenshtein 1.5
Adding pyxDamerauLevenshtein 1.5 to easy-install.pth file
...

setup.py I am using: setup.py

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:25

github_iconTop GitHub Comments

2reactions
cwharlandcommented, Jan 8, 2019

Thanks as well for being so responsive and taking the time to investigate a solution that makes production use of your great package a pleasure!

1reaction
GMishxcommented, Oct 10, 2018

I am working on atarashi project. Replace the setup.py with this: https://gist.github.com/GMishx/739f15f743c33222438fbbdfe9813caf (as old one is not working fine)

Read more comments on GitHub >

github_iconTop Results From Across the Web

python is not installing dependencies listed in install_requires ...
Try providing your dependency both in install_requires and setup_requires . Following is from setuptool 's documentation at ...
Read more >
Unable to install dependencies, python setup.py egg_info did ...
Note for Windows users - If you get an error when installing dependencies that looks similar to the one described #13, your dependency...
Read more >
How to Package Python dependencies with PIP setuptools
Just like pip is the standard package manager for Python, setup.py is the heart and center of Python projects installed with pip.
Read more >
How to install Python dependencies in an application
Find Divio's how-to guide to installing Python dependencies in an app. ... This can cause your application to fail with an deployment error...
Read more >
Dependencies Management in Setuptools
This is where a package declares its core dependencies, without which it won't be able to run. setuptools supports automatically downloading and installing...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found