小编ElL*_*233的帖子

导入错误:尝试在没有已知父包的情况下进行相对导入:(

我正在尝试从我的 Items 文件中导入脚本,但我一直收到错误

 from .Items.Quest1_items import *
Run Code Online (Sandbox Code Playgroud)

from .Items.Quest1_items import *
ImportError: attempted relative import with no known parent package

Process finished with exit code 1

Run Code Online (Sandbox Code Playgroud)

这是我的项目树,我从 main.py 文件运行脚本

Quest1/
|
|- main.py
|
|- Items/
| |- __init__.py
| |- Quest1_items.py

Run Code Online (Sandbox Code Playgroud)

python directory import module python-3.x

11
推荐指数
3
解决办法
2万
查看次数

Twine 默认“long_description_content_type”为 text/x-rst

这是我的设置

setup(
    name="`...",
    version="...",
    description=...,
    long_description_content_type="text/markdown",
    long_description=README,
    author="...",

    classifiers=[...],

    packages=["..."],
    include_package_data=True,
)
Run Code Online (Sandbox Code Playgroud)

我使用以下命令来打包我的项目

python setup.py sdist bdist_wheel 
Run Code Online (Sandbox Code Playgroud)

但当我跑步时

twine check dist/*
Run Code Online (Sandbox Code Playgroud)

我收到以下错误

Checking dist\Futshane_TBG-1.0.0-py3-none-any.whl: FAILED
  `long_description` has syntax errors in markup and would not be rendered on PyPI.
    line 9: Error: Unexpected indentation.
  warning: `long_description_content_type` missing. defaulting to `text/x-rst`.
Checking dist\Futshane_TBG-1.0.0.tar.gz: FAILED
  `long_description` has syntax errors in markup and would not be rendered on PyPI.
    line 9: Error: Unexpected indentation.
  warning: `long_description_content_type` missing. defaulting to `text/x-rst`.
Run Code Online (Sandbox Code Playgroud)

当我明显提供了一种类型时,为什么它无法识别所提供的类型?

python python-packaging twine

9
推荐指数
1
解决办法
4692
查看次数