ref: https://github.com/louking/loutilities/tree/0.14.7
Я получаю импортер после установки pip-пакета.Когда я использую easy_install из яйца, все хорошо.Буду признателен за любую помощь в отладке.
Использовал следующие команды для установки этого пакета в pypi и установки pip с помощью "pip 18.1 из c: \ users \ lking \ anaconda2 \ lib \ site-packages \ pip(python 2.7) "
python setup.py install
python setup.py sdist bdist_wheel
twine upload dist/loutilities-0.14.7.*
:
# later
pip install loutilities
Когда я запускаю проект, вижу следующее
NoAppException: While importing "run", an ImportError was raised:
Traceback (most recent call last):
File "C:\Users\lking\Documents\Lou's Software\projects\contracts\contracts\venv\lib\site-packages\flask\cli.py", line 235, in locate_app
__import__(module_name)
File "C:\Users\lking\Documents\Lou's Software\projects\contracts\contracts\run.py", line 31, in <module>
app = create_app(Development(configpath), configpath)
File "C:\Users\lking\Documents\Lou's Software\projects\contracts\contracts\contracts\__init__.py", line 82, in create_app
from contracts.views.frontend import bp as frontend
File "C:\Users\lking\Documents\Lou's Software\projects\contracts\contracts\contracts\views\frontend\__init__.py", line 18, in <module>
import frontend
File "C:\Users\lking\Documents\Lou's Software\projects\contracts\contracts\contracts\views\frontend\frontend.py", line 21, in <module>
from loutilities.flask_helpers.blueprints import add_url_rules
ImportError: No module named flask_helpers.blueprints
find_packages, похоже, находит соответствующие пакеты:
from setuptools import find_packages
find_packages()
Out[4]: ['loutilities', 'tests', 'loutilities.flask_helpers']
setup.py:
#!/usr/bin/python
# [irrelevant comments deleted]
import glob
import pdb
# home grown
from loutilities import version
from setuptools import setup, find_packages
def globit(dir, filelist):
outfiles = []
for file in filelist:
filepath = '{0}/{1}'.format(dir,file)
gfilepath = glob.glob(filepath)
for i in range(len(gfilepath)):
f = gfilepath[i][len(dir)+1:]
gfilepath[i] = '{0}/{1}'.format(dir,f) # if on windows, need to replace backslash with frontslash
outfiles += [gfilepath[i]]
return (dir, outfiles)
setup(
name = "loutilities",
version = version.__version__,
packages = find_packages(),
# include_package_data = True,
scripts = [
'loutilities/agegrade.py',
'loutilities/apikey.py',
'loutilities/applytemplate.py',
'loutilities/filtercsv.py',
'loutilities/makerst.py',
],
# Project uses reStructuredText, so ensure that the docutils get
# installed or upgraded on the target machine
install_requires = [
'unicodecsv>=0.13.0',
],
# If any package contains any of these file types, include them:
data_files = ([
globit('loutilities', ['*.conf','*.pyc','*.pyd','*.dll','*.h','*.xlsx']),
globit('doc/source', ['*.txt', '*.rst', '*.html', '*.css', '*.js', '*.png', '*.py', ]),
globit('doc/build/html', ['*.txt', '*.rst', '*.html', '*.css', '*.js', '*.png', ]),
globit('doc/build/html/_sources', ['*.txt', '*.rst', '*.html', '*.css', '*.js', '*.png', ]),
globit('doc/build/html/_static', ['*.txt', '*.rst', '*.html', '*.css', '*.js', '*.png', ]),
globit('doc/build/html/_images', ['*.png', ]),
]),
entry_points = {
'console_scripts': [
'agegrade = loutilities.agegrade:main',
'apikey = loutilities.apikey:main',
'applytemplate = loutilities.applytemplate:main',
'filtercsv = loutilities.filtercsv:main',
'makerst = loutilities.makerst:main',
],
},
zip_safe = False,
# metadata for upload to PyPI
description = 'some hopefully useful utilities',
long_description=open("README.md").read(),
license = 'Apache License, Version 2.0',
author = 'Lou King',
author_email = 'lking@pobox.com',
url = 'http://github.com/louking/loutilities',
# could also include long_description, download_url, classifiers, etc.
)