【发布时间】:2016-10-18 15:28:46
【问题描述】:
我正在使用 setuptools 尝试为 python 创建一个模块。
我尝试过在本地安装和从 git 安装 pip(版本 3.5)。 pip 表示该软件包已安装,并与“pip list”和“pip freeze”一起列在已安装的软件包中。当我尝试在脚本中导入模块时,出现导入错误“ImportError: No module named 'jackedCodeTimerPY'”。我已经把头撞在墙上一段时间了,我认为这是一个非常简单的问题,我只是错过了一些东西。
你可以在https://github.com/BebeSparkelSparkel/jackedCodeTimerPY找到我的repo
我的 setup.py 看起来像这样:
from setuptools import setup
setup(name='jackedCodeTimerPY',
version='0.0.0',
license='MIT',
description='Simple but powerful code timer that can measure execution time of one line, functions, imports and gives statistics (min/max/mean/total time, number of executions).',
author='William Rusnack',
author_email='williamrusnack@gmail.com',
url='https://github.com/BebeSparkelSparkel/jackedCodeTimerPY',
classifiers=['Development Status :: 2 - Pre-Alpha', 'Programming Language :: Python :: 3'],
py_modules=["jackedCodeTimerPY"],
install_requires=['tabulate==0.7.5'],
)
我的目录如下所示:
LICENSE.md jackedCodeTimerPY.py
README.md jackedCodeTimerPY.pyc
__pycache__ setup.py
build small.jpg
dist t2.py
example.py tests.py
jackedCodeTimerPY.egg-info
【问题讨论】:
标签: python setuptools setup.py