运行软件包时制作setup.py文件ModuleNotFoundError

时间:2018-10-17 21:34:02

标签: python setup.py

我第一次尝试打包项目,并且遇到运行pip时未安装“ linux.py”模块的问题。这是我在运行程序包时安装后遇到的错误。

ModuleNotFoundError: No module named 'linux'

linux.py包含在venus.py中,例如:

import linux

这是我的setup.py文件

from setuptools import setup, find_packages

setup(
name='venus',
version='0.0.1',
description="A cross platform tool for setting a random wallpaper image from unsplash.com",
license="MIT",
#packages=['venus',],
packages=find_packages(),
install_requires=[
'requests',
],
entry_points={"console_scripts": ["venus = venus.venus:main"]},
)

这是pip install的输出。使用virtualenv

Processing /home/user/Documents/venus
Requirement already satisfied: requests in ./env/lib/python3.7/site-packages (from venus==0.0.1) (2.19.1)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in ./env/lib/python3.7/site-packages (from requests->venus==0.0.1) (3.0.4)
Requirement already satisfied: idna<2.8,>=2.5 in ./env/lib/python3.7/site-packages (from requests->venus==0.0.1) (2.7)
Requirement already satisfied: urllib3<1.24,>=1.21.1 in ./env/lib/python3.7/site-packages (from requests->venus==0.0.1) (1.23)
Requirement already satisfied: certifi>=2017.4.17 in ./env/lib/python3.7/site-packages (from requests->venus==0.0.1) (2018.10.15)
Building wheels for collected packages: venus
Running setup.py bdist_wheel for venus ... done
Stored in directory: /tmp/pip-ephem-wheel-cache-krjpkz8c/wheels/0e/fc/f8/94d809f34270dfc8e6944773a2a7f25f69f02eb580f2674ca6
Successfully built venus
Installing collected packages: venus
Successfully installed venus-0.0.1

这就是我的文件结构

venus
├── __init__.py
├── linux.py
└── venus.py

我已经多次寻找搜索答案,但没有找到解决方案。正如您在setup.py文件中看到的那样,我也尝试使用find_packages()函数,但这并不能解决问题。我在这里想念什么?

我正在使用python 3.7 点版本18.0

0 个答案:

没有答案