首页 > 解决方案 > Python找不到自己写的模块

问题描述

我正在编写一个 python 模块并想安装它。结构如下:

look-up
├── look-up
│   ├── utilities
│   │       ├── __init__.py
│   │       ├── validator.py
│   └──  __init__.py
├── README.md
├── requirements.txt
├── setup.py
└── MANIFEST.in

setup.py 看起来像这样:

from setuptools import setup, find_packages
from codecs import open
from os import path

here = path.abspath(path.dirname(__file__))

with open(path.join(here, 'README.md'), encoding='utf-8') as f:
    long_description = f.read()

setup(
      name = 'look_up',
      version = '0.0.1',
      packages = find_packages(),        
      )

在我运行之后:

python setup.py develop

并尝试导入它我收到错误:

No module named 'look_up'

有人可以帮我做错什么吗?

标签: pythonpython-importpython-module

解决方案


推荐阅读