âââ README.md
âââ core
â âââ Dockerfile
â âââ entrypoint.sh
â âââ requirements.txt
â âââ sentinel.py
â âââ site.conf
âââ python_package
âââ sentinel
â âââ __init__.py
â âââ sentinel.py
âââ setup.py
它有两个目录。主要是
core
它保存服务本身的代码。我想创建一个帮助包来与这个服务交互,所以我创建了
python_package
加上
sentinel.py
助手类(
Sentinel
).
__init__.py
内容
setup.py
from setuptools import setup, find_packages
setup(name='sentinel',
version='0.1',
description='Client to interact with the Sentinel service',
url='https://foo/bar/sentinel.git',
author='yzT',
author_email='yzT@example.com',
packages=find_packages(),
install_requires='requests')
当我激活virtualenv并安装
pip install .
,该软件包随
requests
from sentinel import Sentinel
据报道:
ImportError: cannot import name 'Sentinel' from 'sentinel' (/Users/yzT/sentinel/python_package/sentinel/__init__.py)
我不知道为什么。