找不到本地Python包

时间:2018-01-01 11:26:30

标签: python packages

我在本地计算机上创建了一个名为aTask的程序包,并使用pip install -e ./tasks成功安装了该程序包(因为没有发生错误)。要仔细检查,pip list | grep aTask我得到了aTask (0.2.0, /Users/WorkPlace/projects/tasks)

但是当我试图导入我的翻译时,我有一个错误

In [1]: import aTask

ImportError  Traceback (most recent call last) 
<ipython-input-1-d76cc8326300> in <module>() 
----> 1 import aTask

ImportError: No module named aTask

请你帮我解决一下我的案子?下面我列出更多细节

setup.py

组成
from setuptools import setup, find_packages

package_name = 'aTask'
version = '0.2.0'
install_requires = ['pandas==0.21.1', 'numpy==1.13.3', 'scikit-learn==0.19.1', 'scipy==1.0.0']
CLASSIFIERS = [
    'Operating System :: OS Independent',
    'Programming Language :: Python :: 2.7'
]
description = 'an example to install a package'

setup(name=package_name,
      description=description,
      author='XXXX',
      version=version,
      packages=find_packages(exclude=['test', 'test.*']),
      platforms=['Any'],
      install_requires=install_requires,
      classifiers=CLASSIFIERS)

我的文件夹结构为

> tree .
.
├── DataPopulation
│   └── main.py
├── README.md
├── Strategies
│   ├── Exceptions
│   │   ├── __init__.py
│   │   └── __init__.pyc
│   ├── IStrategy.py
│   ├── IStrategy.pyc
│   ├── Algorithms
│   │   ├── SVM.py
│   │   ├── SVM.pyc
│   │   ├── __init__.py
│   │   ├── __init__.pyc
│   │   ├── miscellaneous.py
│   │   └── miscellaneous.pyc
│   ├── __init__.py
│   └── __init__.pyc
├── StrategyBasicContext.py
├── StrategyBasicContext.pyc
├── Ultils
│   ├── DataIO
│   │   └── __init__.py
│   ├── __init__.py
│   └── __init__.pyc
├── __init__.py
├── __init__.pyc
├── requirements.txt
└── setup.py

0 个答案:

没有答案