简体   繁体   English

使用setuptools创建软件包无法正确安装

[英]creating package with setuptools not installing properly

I'm using setuptools to try and create a module for python. 我正在使用setuptools尝试为python创建一个模块。

I have tried installing locally and from git with pip (version 3.5). 我已经尝试在本地安装git和pip(3.5版)。 pip says that the package is installed and it is listed in the installed packages with "pip list" and "pip freeze". pip表示已安装该软件包,并在已安装的软件包中列出了“ pip list”和“ pip Frozen”。 When I try to import the module in my script I get an import error "ImportError: No module named 'jackedCodeTimerPY' ". 当我尝试在脚本中导入模块时,出现导入错误“ ImportError:没有名为'jackedCodeTimerPY'的模块”。 I've been banging my head on the wall for a while now and I think that is a really simple problem and I'm just missing something. 我已经在墙上敲了一下头了一段时间,我认为这是一个非常简单的问题,我只是想念一些东西。

You can find my repo at https://github.com/BebeSparkelSparkel/jackedCodeTimerPY 您可以在https://github.com/BebeSparkelSparkel/jackedCodeTimerPY找到我的仓库

My setup.py looks like this: 我的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'],
     )

My directory looks like this: 我的目录如下所示:

LICENSE.md      jackedCodeTimerPY.py
README.md     jackedCodeTimerPY.pyc
__pycache__     setup.py
build       small.jpg
dist        t2.py
example.py      tests.py
jackedCodeTimerPY.egg-info

Seems to work for me: 似乎为我工作:

pip3 install git+git://github.com/BebeSparkelSparkel/jackedCodeTimerPY.git@master

Cloning git://github.com/BebeSparkelSparkel/jackedCodeTimerPY.git (to master) to /tmp/pip-lq07iup9-build
Collecting tabulate==0.7.5 (from jackedCodeTimerPY==0.0.0)
  Downloading tabulate-0.7.5.tar.gz
Installing collected packages: tabulate, jackedCodeTimerPY
  Running setup.py install for tabulate ... done
  Running setup.py install for jackedCodeTimerPY ... done
Successfully installed jackedCodeTimerPY-0.0.0 tabulate-0.7.5

python3 -c 'from jackedCodeTimerPY import JackedTiming; print(JackedTiming)'

<class 'jackedCodeTimerPY.JackedTiming'>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM