0

When I try to run setup.py using the command: python setup.py sdist --dist-dir dist

This creates the compressed file under dist folder but when i try to run to code it shows the error that 'No module named slacker found' Although slacker-0.9.24-py2.7.egg is created in my root folder. The directory structure is :

--quality-sanity-checks
-----setup.py
-----notify
       |---<my python files>




from setuptools import setup
    setup(
        name='quality-sanity',
        version='0.0.1-SNAPSHOT',
        description='Service to alert on quality issues',
        download_url='http://gec-maven-nexus.walmart.com/nexus/content/repositories',
        license='proprietary',
        setup_requires=[
            'requests',
            'slacker'
        ],
        install_requires=[
            'requests',
            'slacker'
        ],
        zip_safe='true'
        #dependency_links=['http://github.com/os/slacker/tarball/master#egg=slacker-0.9.24']
    )
Pulkit Agarwal
  • 43
  • 1
  • 1
  • 7

1 Answers1

0

This is because python setup.py sdist --dist-dir dist will create the file in the zip inside your "dist" folder, and if you'll try to run the python and try to import from the same dir path from slacker import Slacker won't give you any issue, but if you'll try to import the respective from any other dir path you'll face the error ImportError: No module named slacker. It's because the respective import file is present only inside the source folder where you have ran the python setup.py sdist --dist-dir dist command.

And, your doubt that why the respective slacker-0.9.24-py2.7-egg.info folder is created in your root directory you can refer the answer of following question: Why does "python setup.py sdist" create unwanted "PROJECT-egg.info" in project root directory?

Community
  • 1
  • 1
justjais
  • 344
  • 3
  • 13