4

I have an application that I am trying to build and install as system-wide executable. The odd thing is that the build is fine, but when I call:

python3.5 -m pip install --upgrade some-name.whl

All is successful, the executable is system-wide accessible, but cannot import the module where the entrypoint is.

This is the setup.py:

setup(
    name='ppldetect',
    version=version(),
    packages=find_packages(exclude=['docs', 'tests', 'tests.*', '*.tests', '*.tests.*']),
    author='',
    author_email='',
    description='',
    setup_requires=['sphinx', 'nose', 'wheel'],
    install_requires=['Pillow', 'AWSIoTPythonSDK'],
    entry_points={
        'console_scripts': [
            'ppldetect = publisher.basicPubSub:main',
        ]
    }
)

This is the error I get when I try to execute the command:

Traceback (most recent call last):
  File "/usr/local/bin/ppldetect", line 7, in <module>
    from publisher.basicPubSub import main
 ImportError: No module named 'publisher'

I've upgraded pip to the latest version. Interesting enough, I have been using the very same setup.py as template for quite some time now and never had issues before.

All the other projects I've used it on are building and working fine.

NOTE: I am trying to run this on Raspberry PI, all other projects I've tried under Ubuntu.

EDIT: I build the .whl like this:

python3.5 setup.py bdist_wheel

Ani Menon
  • 27,209
  • 16
  • 105
  • 126
AlexK
  • 1,380
  • 10
  • 17

1 Answers1

-1

Unfortuantely, IDEs are making us lazy and not quite observant.

As I am doing all this in Raspberry with limited resources, I had created an __init__ file maunally and had totally forgotten to add the .py extension (as PyCharm does it itself) and once added all went fine.

phd
  • 82,685
  • 13
  • 120
  • 165
AlexK
  • 1,380
  • 10
  • 17