ModuleNotFoundError: No module named 'xxx'

323 Views Asked by At

I try upload a package to pypi ,but i can't run it when i install it in other where .

Traceback (most recent call last):
  File "/Users/bestony/Downloads/abc-mod/venv/bin/abc", line 7, in <module>
    from xxx.core import main
ModuleNotFoundError: No module named 'abc'

I try to use pip install abc and pip install -e path_to_my_code,and read the code at venv/bin/abc.

here is the code

# this code can run due to use local code
#!/Users/bestony/Downloads/abc-mod2/venv/bin/python3.6
# EASY-INSTALL-ENTRY-SCRIPT: 'abc','console_scripts','abc'
__requires__ = 'abc'
import re
import sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(
        load_entry_point('abc', 'console_scripts', 'abc')()
    )

and

# this code can't run 
#!/Users/bestony/Downloads/abc-mod/venv/bin/python3.6

# -*- coding: utf-8 -*-
import re
import sys

from abc.core import main

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(main())

here is my setup.py code

from setuptools import setup

setup(
    name="abc",
    version="0.0.5",
    py_modules=['abc'],
    install_requires= [
        'click',
        'requests',
    ],
    entry_points="""
        [console_scripts]
        abc=abc.core:main
    """
)

is here any know why?

0

There are 0 best solutions below