Im 간단한 Python 앱을 만들고 있습니다. 내가 제대로 여부를 그 일을하고 있다면 정말 코멘트에 저를 수정하거나하시기 바랍니다 잘 모릅니다이Python setup.py 테스트를하는 동안 ImportError가 발생했습니다.
오류에 대한 답이있는 경우 : ImportError: No module named 'taskhandler'
및 ImportError: No module named 'styles' while doing
을 python3 setup.py test`
파일 구조 :
.
├── MANIFEST.in
├── pydotask.egg-info
│ ├── dependency_links.txt
│ ├── not-zip-safe
│ ├── PKG-INFO
│ ├── SOURCES.txt
│ └── top_level.txt
├── README.md
├── setup.py
├── task_mod
│ ├── __init__.py
│ ├── __pycache__
│ │ ├── __init__.cpython-35.pyc
│ │ ├── pydo.cpython-35.pyc
│ │ └── taskhandler.cpython-35.pyc
│ ├── pydo.py
│ ├── styles
│ │ ├── __init__.py
│ │ ├── __pycache__
│ │ │ ├── __init__.cpython-35.pyc
│ │ │ ├── termcolor.cpython-35.pyc
│ │ │ └── text_style.cpython-35.pyc
│ │ ├── termcolor.py
│ │ └── text_style.py
│ ├── taskhandler.py
│ └── tasks.csv
└── update.txt
5 directories, 22 files
'task_mod/pydo.py'
#!/usr/bin/env python3
''' To Do App in Python '''
import sys, os
import taskhandler as task
from styles import text_style as text
from styles import termcolor
task_mod/taskhandler.py
:
#!/usr/bin/env python3
import sys, os
import csv
from styles import termcolor
from styles import text_style as text
setup.py
from setuptools import setup
def readme():
with open('README.md') as readme:
return readme.read()
setup(
name = 'pydotask',
version = '0.2',
description = 'PyDo is a CLI Application to keep you on track with your tasks and projects',
long_description = readme(),
classifiers = [
'Development Status :: 3 - Alpha',
'Programming Language :: Python :: 3.5',
'Topic :: Office/Business :: Scheduling'
],
keywords = 'utilities office schedule task reminder',
url = '',
author = 'Abhishta Gatya',
author_email = '[email protected]',
packages = ['task_mod'],
scripts = ['task_mod/pydo'],
python_requires = '>=3',
include_package_data = True,
zip_safe = False
)
?
참고 : python3 task_mod/pydo.py
을 실행하면 문제가 없습니다. 하지만 그것을 테스트하려고하면 2 가져 오기 오류가 발생합니다
'pydo.py'와'taskhandler.py'의 시작 부분에'#!/usr/bin/env python3' 줄이 있기 때문에 아닌가요? – Iva
@Iva 그건 통역사 경로 – Steampunkery
일 뿐이므로 그 원인이 무엇입니까? 잠깐만 기다려주세요 –