{"id":2513,"date":"2021-11-26T16:49:53","date_gmt":"2021-11-26T08:49:53","guid":{"rendered":"http:\/\/www.yatenglg.cn\/?p=2513"},"modified":"2022-10-24T11:30:32","modified_gmt":"2022-10-24T03:30:32","slug":"%e4%b8%8a%e4%bc%a0%e8%87%aa%e5%b7%b1%e7%9a%84%e5%8c%85%e5%88%b0pypi","status":"publish","type":"post","link":"http:\/\/www.yatenglg.cn\/blog\/?p=2513","title":{"rendered":"\u4e0a\u4f20\u81ea\u5df1\u7684\u5305\u5230pypi"},"content":{"rendered":"\r\n<h2>\u4e00. \u9996\u5148\uff0c\u9700\u8981\u4e00\u4e2apypi\u8d26\u53f7<\/h2>\r\n\r\n\r\n\r\n<p><a target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/pypi.org\/<\/a><\/p>\r\n\r\n\r\n\r\n<h2>\u4e8c. \u521b\u5efa\u81ea\u5df1\u7684\u5305\u7a0b\u5e8f<\/h2>\r\n\r\n\r\n\r\n<p>\u5982\u56fe\u4e2d\u6240\u793a\uff0cchangeable\u5c31\u662f\u51c6\u5907\u7684\u5305\u6587\u4ef6\u3002\u5176\u4f59\u6587\u4ef6\u5747\u5c5e\u4e8eChangeable\u9879\u76ee\uff0c\u4e0d\u5c5e\u4e8e\u5f85\u4e0a\u4f20\u7684\u5305\u6587\u4ef6\u3002<\/p>\r\n\r\n\r\n\r\n<p>\u9700\u8981\u6ce8\u610f\u7684\u662f\uff1a<strong>changeable \u5fc5\u987b\u5b58\u5728__init__.py\uff0c\u662f\u4e00\u4e2apython\u5305\u3002<\/strong><\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large\"><img class=\"alignnone wp-image-2539 size-full\" src=\"http:\/\/www.yatenglg.cn\/blog\/wp-content\/uploads\/2021\/11\/gnome-shell-screenshot-DBQYD1.png\" alt=\"\" width=\"241\" height=\"121\" \/><\/figure>\r\n\r\n\r\n\r\n<h2>\u4e09. \u7f16\u5199setup.py\u5e76\u8fdb\u884c\u6253\u5305<\/h2>\r\n\r\n\r\n\r\n<div class=\"hcb_wrap\">\r\n<pre class=\"prism undefined-numbers lang-python\" data-file=\"setup.py\" data-lang=\"Python\"><code># -*- coding: utf-8 -*-\r\n# @Author  : LG\r\n\r\n\r\nfrom setuptools import setup, find_packages\r\n\r\nsetup(\r\n    name = \"changeable\",                                # \u5305\u540d\r\n    version = \"0.0.2\",                                  # \u7248\u672c\u53f7\r\n    author = \"yatengLG\",\r\n    author_email = \"yatenglg@qq.com\",\r\n    description=\"Data transforms for object detection.\",\r\n    long_description=\"Data transforms for object detection base on pytorch.\",\r\n    url=\"https:\/\/github.com\/yatengLG\/Changeable\",  # \u9879\u76ee\u76f8\u5173\u6587\u4ef6\u5730\u5740\r\n\r\n    keywords = (\"pip\", \"changeable\"),\r\n    license = \"MIT Licence\",\r\n\r\n    packages = find_packages(),\r\n    include_package_data = True,\r\n    platforms = \"any\",\r\n\r\n    python_requires=\"&gt;=3.6\",                            # python \u7248\u672c\u8981\u6c42\r\n    install_requires = [\"torch\",                        # \u4f9d\u8d56\u5305\r\n                        \"numpy\",\r\n                        \"pillow\",\r\n                        \"opencv-python\"\r\n                        ]\r\n)<\/code><\/pre>\r\n<\/div>\r\n\r\n\r\n\r\n<p>\u8fd0\u884c\u4e0b\u8ff0\u547d\u4ee4<strong>\u6253\u5305<\/strong><\/p>\r\n\r\n\r\n\r\n<div class=\"hcb_wrap\">\r\n<pre class=\"prism undefined-numbers lang-plain\"><code># \u6784\u5efa\u6e90\u7801\u53d1\u5e03\u5305\r\npython setup.py sdist<\/code><\/pre>\r\n<\/div>\r\n\r\n\r\n\r\n<p>\u5728\u9879\u76ee\u6587\u4ef6\u5939\u4e0b\u751f\u6210dist\u6587\u4ef6\u5939\u3002<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large\"><img class=\"alignnone wp-image-2544\" src=\"http:\/\/www.yatenglg.cn\/blog\/wp-content\/uploads\/2021\/11\/gnome-shell-screenshot-P36LD1-150x150.png\" alt=\"\" width=\"150\" height=\"96\" \/><\/figure>\r\n\r\n\r\n\r\n<p>changeable-0.0.2.tar.gz\u4e3a\u6253\u5305\u540e\u7684\u5305\u6587\u4ef6\u3002\u4e0a\u4f20\u5230pypi\u540e\uff0c\u5373\u53ef\u901a\u8fc7pip install changeable\u8fdb\u884c\u5b89\u88c5\u3002<\/p>\r\n\r\n\r\n\r\n<p>\u4e5f\u53ef\u4ee5\u901a\u8fc7 pip install dist\/changeable-0.0.2.tar.gz \u4f7f\u7528\u5305\u6587\u4ef6\u76f4\u63a5\u8fdb\u884c\u5b89\u88c5\u3002<\/p>\r\n\r\n\r\n\r\n<p>\u56db. \u4e0a\u4f20pypi<\/p>\r\n\r\n\r\n\r\n<p>\u4e0a\u4f20\u8fc7\u7a0b\u9700\u8981\u7528\u5230twine<\/p>\r\n\r\n\r\n\r\n<p>\u53ef\u4ee5\u901a\u8fc7&#8220;`<code>pip install twine<\/code>&#8220;`\u8fdb\u884c\u5b89\u88c5<\/p>\r\n\r\n\r\n\r\n<p>\u8fd0\u884c\u4e0b\u8ff0\u547d\u4ee4\u8fdb\u884c\u4e0a\u4f20:<\/p>\r\n\r\n\r\n\r\n<p>twine upload -u pypi\u8d26\u53f7 -p pypi\u5bc6\u7801 dist\/changeable-0.0.2.tar.gz<\/p>\r\n\r\n\r\n\r\n<p>\u4e94. \u6742\u9879<\/p>\r\n\r\n\r\n\r\n<ol>\r\n<li>\u5728\u5f00\u53d1\u5305\u8fc7\u7a0b\u4e2d\uff0c\u9700\u8981\u8fdb\u884c\u9891\u7e41\u6d4b\u8bd5\u3002<\/li>\r\n<\/ol>\r\n\r\n\r\n\r\n<p>\u53ef\u4ee5\u76f4\u63a5\u901a\u8fc7&#8220;`python setup.py install&#8220;`\u5c06\u5f00\u53d1\u4e2d\u7684\u5305\u5b89\u88c5\u5230\u672c\u5730\u3002\u4f46\u5bf9\u5305\u8fdb\u884c\u4fee\u6539\u540e\uff0c\u9700\u8981\u91cd\u65b0\u5b89\u88c5\uff0c\u8f83\u4e3a\u9ebb\u70e6\u3002<\/p>\r\n\r\n\r\n\r\n<p>\u53ef\u4ee5\u901a\u8fc7&#8220;`python setup.py develop&#8220;`\u8fdb\u884c\u5f00\u53d1\u4e2d\u7684\u6d4b\u8bd5\u3002\u8be5\u65b9\u6cd5\u4e0d\u8fdb\u884c\u5305\u5b89\u88c5\uff0c\u800c\u662f\u5bf9\u5305\u8fdb\u884c\u8f6f\u8fde\u63a5\uff0c\u6307\u5411\u5f53\u524d\u6b63\u5728\u5f00\u53d1\u7684\u5305\u3002\u5305\u4e2d\u5185\u5bb9\u66f4\u6539\u540e\uff0c\u53ef\u4ee5\u76f4\u63a5\u751f\u6548\u3002<\/p>\r\n","protected":false},"excerpt":{"rendered":"<p>\u4e00. \u9996\u5148\uff0c\u9700\u8981\u4e00\u4e2apypi\u8d26\u53f7 https:\/\/pypi.org\/ \u4e8c. \u521b\u5efa\u81ea\u5df1\u7684\u5305\u7a0b\u5e8f \u5982\u56fe\u4e2d\u6240\u793a\uff0cch&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[7],"tags":[],"_links":{"self":[{"href":"http:\/\/www.yatenglg.cn\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2513"}],"collection":[{"href":"http:\/\/www.yatenglg.cn\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.yatenglg.cn\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.yatenglg.cn\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.yatenglg.cn\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2513"}],"version-history":[{"count":40,"href":"http:\/\/www.yatenglg.cn\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2513\/revisions"}],"predecessor-version":[{"id":2910,"href":"http:\/\/www.yatenglg.cn\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2513\/revisions\/2910"}],"wp:attachment":[{"href":"http:\/\/www.yatenglg.cn\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2513"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.yatenglg.cn\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2513"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.yatenglg.cn\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2513"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}