【发布时间】:2017-11-25 04:49:27
【问题描述】:
我有一个从
构建的 python 包python setup.py sdist
包名是:yify
我是用这个安装的
pip3 install .
之后,当我打开 python3 解释器和 import Yify 时,它会成功导入,但它似乎不包含 dist_packages/Yify 目录中的主要 python 文件。
这是文件夹结构:-
├── dist
│ └── Yify-1.0.tar.gz
├── get-pip.py
├── LICENSE
├── README.rst
├── requirements.txt
├── setup.cfg
├── setup.py
├── Yify
│ ├── __init__.py
│ ├── venv
| ├── Yify.py
Yify.py 包含 yify 类。
当我这样做时
import Yify
Yify.yify()
它给了我“yify”未找到错误! .
如何解决?
这里是 setup.py 的内容:-
import platform
from setuptools import setup
install_requires = ['bs4' , 'urllib3' ]
setup(
name='Yify',
packages = ['Yify'] ,
version = 'v1.0',
description = '''
This Module is used to get the Top seeded torrents at any given time and get the entire movie details and ratings .
Its also useful to search for any movie using different parameters and obtain their magnet link or torrent file of any prefered quality.
''' ,
author = 'Natesh M Bhat' ,
url = 'https://github.com/nateshmbhat/Yify-Python',
author_email = 'nateshmbhatofficial@gmail.com' ,
# download_url = 'https://github.com/nateshmbhat/pyttsx3/archive/v2.6.tar.gz',
keywords=['yify','torrent-python' , 'movie-torrent' , 'torrent' , 'pyyify' , 'Yify' , 'yify torrent' , 'yify download' , 'download yify' , 'yifyer' , 'yifypy' , 'torrent download' , 'movie torrent' , 'movie downloader', 'movie finder'],
classifiers = [] ,
install_requires=install_requires
)
当我直接进入 python3.6 distpackages/Yify 文件夹并从那里执行 python3 时。一切正常。
还有 dir(Yify) 只返回以下字段
dir(Yify)
['__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__']
【问题讨论】:
-
你不应该打电话给
setup.py请问你为什么不直接打电话pip install yify -
它不在pypi存储库中,它是我本地的python库。要先上传到 Pip,我在上传之前对其进行了测试。
-
尝试使用 pip install -e "您在本地下载的路径"
-
尝试使用 pip install -e "您在本地下载的路径"
-
你试过了。同样的事情。
标签: python deployment pip setuptools pypi