{"id":9762,"date":"2025-04-18T17:37:18","date_gmt":"2025-04-18T09:37:18","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/9762.html"},"modified":"2025-04-18T17:37:18","modified_gmt":"2025-04-18T09:37:18","slug":"%ef%bc%88%e8%b6%85%e8%af%a6%e7%bb%86%e6%95%99%e7%a8%8b%ef%bc%89%e6%b2%a1%e6%9c%89sudo%e6%9d%83%e9%99%90%ef%bc%8c%e5%9c%a8%e6%9c%8d%e5%8a%a1%e5%99%a8%e5%ae%89%e8%a3%85ollama%ef%bc%8c%e4%b8%8b%e8%bd%bdq","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/9762.html","title":{"rendered":"\uff08\u8d85\u8be6\u7ec6\u6559\u7a0b\uff09\u6ca1\u6709sudo\u6743\u9650\uff0c\u5728\u670d\u52a1\u5668\u5b89\u88c5ollama\uff0c\u4e0b\u8f7dqwen2\u6a21\u578b\uff0cpython\u4ee3\u7801\u6d4b\u8bd5"},"content":{"rendered":"<h2>1\u3001\u521b\u5efa\u4e00\u4e2a\u6587\u4ef6\u5939\u653eollama<\/h2>\n<p>#\u521b\u5efa\u6587\u4ef6\u5939<br \/>\nmkdir ollama<br \/>\n#\u8fdb\u5165\u8be5\u6587\u4ef6\u5939<br \/>\ncd ollama <\/p>\n<h2>2\u3001\u4e0b\u8f7d\u5b89\u88c5\u5305<\/h2>\n<h3>2.1\u547d\u4ee4\u884c\u4e0b\u8f7d\u538b\u7f29\u5305<\/h3>\n<p>#\u4e0b\u8f7d\u5b89\u88c5\u5305<br \/>\nwget -O ollama-linux-amd64.tgz https:\/\/ollama.com\/download\/ollama-linux-amd64.tgz <\/p>\n<p>\u5982\u679c\u4e00\u76f4\u8fde\u63a5\u4e0d\u4e0agithub,\u50cf\u4e0b\u9762\u56fe\u7247\u4e2d\u4e00\u6837&#xff0c;\u90a3\u5c31\u6362\u4e00\u79cd\u65b9\u6cd5&#xff0c;\u7528xftp\u672c\u5730\u4e0a\u4f20\u8fd9\u4e2a\u538b\u7f29\u5305\u3002\u5982\u679c\u8fd9\u6b65\u53ef\u4ee5\u4e0b\u8f7d&#xff0c;\u90a3\u5c31\u76f4\u63a5\u8df3\u5230\u4e0b\u9762\u7b2c3\u6b65\u89e3\u538b\u3002<\/p>\n<h3><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"265\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418093716-68021d4c3b17c.png\" width=\"985\" \/>2.2\u672c\u5730\u4e0a\u4f20\u538b\u7f29\u5305<\/h3>\n<p>\u5148\u53bbollama\u5b98\u7f51\u4e0b\u8f7d<img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"41\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418093716-68021d4c54d9f.png\" width=\"321\" \/>\u538b\u7f29\u5305\u5230\u81ea\u5df1\u7535\u8111\u4e0a&#xff0c;\u7136\u540e\u5728Xftp\u65b0\u5efa\u4f1a\u8bdd&#xff0c;\u628a\u521a\u521a\u4e0b\u8f7d\u7684\u538b\u7f29\u5305\u4f20\u5230ollama\u6587\u4ef6\u5939\u4e0b&#xff08;\u7531\u4e8e\u6211\u5728\u7b2c\u4e00\u6b65\u521b\u5efa\u7684ollama1&#xff0c;\u6240\u4ee5\u6211\u4e0a\u4f20\u5230ollama1\u6587\u4ef6\u5939\u4e0b&#xff09;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"597\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418093716-68021d4c5da96.png\" width=\"1200\" \/><\/p>\n<p>\u4f20\u5b8c\u662f\u8fd9\u6837\u7684<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"132\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418093716-68021d4c9cb01.png\" width=\"685\" \/><\/p>\n<h2>3\u3001\u89e3\u538b\u7f29<\/h2>\n<p>#\u89e3\u538b\u7f29<br \/>\ntar -xvzf ollama-linux-amd64.tgz <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"597\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418093716-68021d4ca81cf.png\" width=\"685\" \/><\/p>\n<p>\u538b\u7f29\u540e\u5728ollama\u6587\u4ef6\u5939\u4e0b\u662f\u8fd9\u6837\u7684<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"195\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418093716-68021d4cbf4ae.png\" width=\"689\" \/>\u8fdb\u5165bin\u6587\u4ef6\u5939&#xff0c;ls\u67e5\u770b&#xff0c;\u4f1a\u6709\u4e00\u4e2aollama\u7684\u6587\u4ef6<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"99\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418093716-68021d4ccc18c.png\" width=\"621\" \/><\/p>\n<h2>4\u3001\u542f\u52a8ollama<\/h2>\n<h3>4.1\u6ca1\u6709\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf\u542f\u52a8ollama<\/h3>\n<p>\u5982\u679c\u5728\u6ca1\u6709\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf\u7684\u60c5\u51b5\u4e0b&#xff0c;\u5fc5\u987b\u5728bin\u6587\u4ef6\u5939\u4e0b\u542f\u52a8<\/p>\n<p>#\u542f\u52a8ollama&#xff0c;\u5fc5\u987b\u7528.\/xxx<br \/>\n.\/ollama serve<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"430\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418093716-68021d4cd65be.png\" width=\"946\" \/><\/p>\n<p>\u8fd9\u6837\u5c31\u542f\u52a8\u6210\u529f\u4e86\u200b\u200b\u200b\u200b\u200b\u200b\u200b<\/p>\n<p>\u518d\u65b0\u5efa\u4e00\u4e2a\u7ec8\u7aef,\u8fdb\u5165bin\u6587\u4ef6\u5939&#xff0c;\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770bollama\u7684\u7248\u672c<\/p>\n<p>#\u67e5\u770bollama\u7248\u672c<br \/>\n.\/ollama -v <\/p>\n<h3>4.2\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf<\/h3>\n<p>\u542f\u52a8ollama,\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf\u540e&#xff0c;\u5c31\u53ef\u4ee5\u5728\u4efb\u610f\u4e00\u4e2a\u6587\u4ef6\u5939\u4e0b\u542f\u52a8ollama\u4e86&#xff0c;\u4ee5\u4e0b\u6709\u4e24\u79cd\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf\u7684\u65b9\u6cd5&#xff0c;\u63a8\u8350\u6c38\u4e45\u8bbe\u7f6e\u7684\u65b9\u6cd5<\/p>\n<p>\u8bbe\u7f6e\u4e34\u65f6\u73af\u5883\u53d8\u91cf&#xff1a;\u76f4\u63a5\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4<\/p>\n<p>&#xff08;\u8fd9\u4e2a\u5730\u5740\u8981\u66ff\u6362\u4e3a\u81ea\u5df1\u7684\u5730\u5740&#xff0c;\u5728bin\u6587\u4ef6\u5939\u4e0b\u8f93\u5165pwd\u53ef\u4ee5\u67e5\u770b\u5730\u5740&#xff0c;\u5982\u4e0b\u8fb9\u7b2c\u4e8c\u5f20\u56fe&#xff09;<\/p>\n<p>#\u8bbe\u7f6e\u4e34\u65f6\u73af\u5883\u53d8\u91cf<br \/>\nexport PATH&#061;$PATH:\/home\/wangjunjun\/ollama\/bin<br \/>\n#\u67e5\u770b\u5f53\u524d\u6587\u4ef6\u5730\u5740<br \/>\npwd <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"81\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418093717-68021d4d06a3b.png\" width=\"502\" \/><\/p>\n<p>\u8bbe\u7f6e\u6c38\u4e45\u73af\u5883\u53d8\u91cf&#xff1a;\u4ee5\u4e0bnano ~\/.bashrc\u547d\u4ee4\u6253\u5f00\u7f16\u8f91\u73af\u5883\u53d8\u91cf\u7684\u7a97\u53e3<\/p>\n<p>#\u7f16\u8f91\u73af\u5883\u53d8\u91cf<br \/>\nnano ~\/.bashrc <\/p>\n<p>\u5728\u6700\u4e0b\u8fb9\u6dfb\u52a0\u73af\u5883\u53d8\u91cf<\/p>\n<p>export OLLAMA_HOME&#061;\u6539\u4e3a\u81ea\u5df1\u7684\u5730\u5740<br \/>\nexport PATH&#061;$PATH:$OLLAMA_HOME<\/p>\n<p>\u7136\u540e\u8fdb\u884c\u4ee5\u4e0b\u64cd\u4f5c\u4fdd\u5b58\u5e76\u9000\u51fa\u00a0 ctrl&#043;O\u00a0 \u00a0 Enter\u00a0 \u00a0ctrl&#043;X<\/p>\n<p>\u6267\u884c\u4ee5\u4e0b\u6307\u4ee4\u4f7f\u73af\u5883\u53d8\u91cf\u751f\u6548<\/p>\n<p>source ~\/.bashrc <\/p>\n<h3>4.3\u8bbe\u7f6e\u5b8c\u73af\u5883\u53d8\u91cf\u542f\u52a8ollama<\/h3>\n<p>\u8bbe\u7f6e\u4e86\u73af\u5883\u53d8\u91cf\u5c31\u53ef\u4ee5\u5728\u4efb\u610f\u6587\u4ef6\u5939\u4e0b\u76f4\u63a5ollama serve \u542f\u52a8\u4e86<\/p>\n<p>ollama serve <\/p>\n<p>\u67e5\u770b\u7248\u672c<\/p>\n<p>ollama -v <\/p>\n<h2>5\u3001\u4e0b\u8f7d\u6a21\u578b<\/h2>\n<p>\u8fdb\u5165ollama\u5b98\u7f51&#xff0c;\u9009\u62e9\u6a21\u578b<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"864\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418093717-68021d4d10b6c.png\" width=\"1200\" \/><\/p>\n<p>\u6bd4\u5982\u6211\u60f3\u4e0b\u8f7dqwen2-7b\u7684\u6a21\u578b&#xff0c;\u6709\u73af\u5883\u53d8\u91cf\u7684\u60c5\u51b5\u4e0b\u76f4\u63a5\u590d\u5236\u7bad\u5934\u6240\u6307\u547d\u4ee4&#xff0c;\u8fd0\u884c&#xff0c;\u6ca1\u6709\u73af\u5883\u53d8\u91cf\u7684\u60c5\u51b5\u4e0b\u7528.\/&#043;\u590d\u5236\u7684\u5185\u5bb9<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"575\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418093717-68021d4d65f63.png\" width=\"886\" \/><\/p>\n<p>#\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf<br \/>\nollama run qwen2<br \/>\n#\u6ca1\u6709\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf<br \/>\n.\/ollama run qwen2 <\/p>\n<p>\u7136\u540e\u5c31\u5f00\u59cb\u4e0b\u8f7d\u6a21\u578b\u4e86&#xff0c;\u4e0b\u8f7d\u597d\u540e\u53ef\u4ee5\u76f4\u63a5\u8ddf\u6a21\u578b\u8fdb\u884c\u5bf9\u8bdd&#xff0c;ctrl&#043;d\u7ed3\u679c\u5bf9\u8bdd\u3002<\/p>\n<p>\u8fd8\u53ef\u4ee5\u7528ollama list\u67e5\u770b\u5df2\u7ecf\u4e0b\u8f7d\u7684\u6a21\u578b\u5217\u8868<\/p>\n<p>#\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf<br \/>\nollama list<br \/>\n#\u6ca1\u6709\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf<br \/>\n.\/ollama list <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"369\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418093717-68021d4d8d421.png\" width=\"693\" \/><\/p>\n<h2>6\u3001python\u4ee3\u7801\u6d4b\u8bd5<\/h2>\n<p>\u628a\u6a21\u578b\u66ff\u6362\u4e3a\u81ea\u5df1\u7684\u53ef\u4ee5\u6210\u529f\u8fd0\u884c<\/p>\n<p>import ollama<\/p>\n<p># \u751f\u6210\u56de\u7b54\u5e76\u9010\u5b57\u7b26\u6253\u5370<br \/>\nstream &#061; ollama.chat(<br \/>\n    model&#061;&#039;qwen2&#039;,<br \/>\n    messages&#061;[{&#039;role&#039;: &#039;user&#039;, &#039;content&#039;: &#039;\u5929\u4e3a\u4ec0\u4e48\u662f\u7eff\u7684&#039;}],<br \/>\n    stream&#061;True,<br \/>\n)<\/p>\n<p>for chunk in stream:<br \/>\n    print(chunk[&#039;message&#039;][&#039;content&#039;], end&#061;&#039;&#039;, flush&#061;True)<\/p>\n<p>def test_ollama_chat():<br \/>\n    # Test case 1: Test with a simple question<br \/>\n    messages1 &#061; [{&#039;role&#039;: &#039;user&#039;, &#039;content&#039;: &#039;\u5929\u4e3a\u4ec0\u4e48\u662f\u7eff\u7684&#039;}]<br \/>\n    stream1 &#061; ollama.chat(model&#061;&#039;llama3.1&#039;, messages&#061;messages1, stream&#061;True)<br \/>\n    response_content &#061; &#034;&#034;<br \/>\n    for chunk in stream1:<br \/>\n        response_content &#043;&#061; chunk[&#039;message&#039;][&#039;content&#039;]<br \/>\n    # \u68c0\u67e5\u56de\u7b54\u662f\u5426\u5408\u7406<br \/>\n    assert &#034;\u7eff\u8272&#034; in response_content or &#034;\u4e3a\u4ec0\u4e48&#034; in response_content<br \/>\n    print(&#034;All test cases pass&#034;)<\/p>\n<p>test_ollama_chat() <\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb4.4k\u6b21\uff0c\u70b9\u8d5e51\u6b21\uff0c\u6536\u85cf36\u6b21\u3002\u672c\u6587\u8be6\u7ec6\u4ecb\u7ecd\u4e86ollama\u7684\u4e0b\u8f7d\u5b89\u88c5\uff0c\u5982\u4f55\u5728\u547d\u4ee4\u884c\u4e0b\u8f7d\uff0c\u5982\u4f55\u5728\u672c\u5730\u4e0b\u8f7d\u4e0a\u4f20\u670d\u52a1\u5668\u3002\u4ee5\u53ca\u73af\u5883\u53d8\u91cf\u7684\u90e8\u7f72\uff0c\u4ee5\u53ca\u5982\u4f55\u62c9\u53d6\u6a21\u578b\uff0cpython\u4ee3\u7801\u6d4b\u8bd5\uff0c\u90fd\u6709\u8be6\u7ec6\u7684\u4ecb\u7ecd\u3002_ollama\u538b\u7f29\u5305<\/p>\n","protected":false},"author":2,"featured_media":9750,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[58,347,43],"topic":[],"class_list":["post-9762","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-linux","tag-llama","tag-43"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\uff08\u8d85\u8be6\u7ec6\u6559\u7a0b\uff09\u6ca1\u6709sudo\u6743\u9650\uff0c\u5728\u670d\u52a1\u5668\u5b89\u88c5ollama\uff0c\u4e0b\u8f7dqwen2\u6a21\u578b\uff0cpython\u4ee3\u7801\u6d4b\u8bd5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/9762.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\uff08\u8d85\u8be6\u7ec6\u6559\u7a0b\uff09\u6ca1\u6709sudo\u6743\u9650\uff0c\u5728\u670d\u52a1\u5668\u5b89\u88c5ollama\uff0c\u4e0b\u8f7dqwen2\u6a21\u578b\uff0cpython\u4ee3\u7801\u6d4b\u8bd5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb4.4k\u6b21\uff0c\u70b9\u8d5e51\u6b21\uff0c\u6536\u85cf36\u6b21\u3002\u672c\u6587\u8be6\u7ec6\u4ecb\u7ecd\u4e86ollama\u7684\u4e0b\u8f7d\u5b89\u88c5\uff0c\u5982\u4f55\u5728\u547d\u4ee4\u884c\u4e0b\u8f7d\uff0c\u5982\u4f55\u5728\u672c\u5730\u4e0b\u8f7d\u4e0a\u4f20\u670d\u52a1\u5668\u3002\u4ee5\u53ca\u73af\u5883\u53d8\u91cf\u7684\u90e8\u7f72\uff0c\u4ee5\u53ca\u5982\u4f55\u62c9\u53d6\u6a21\u578b\uff0cpython\u4ee3\u7801\u6d4b\u8bd5\uff0c\u90fd\u6709\u8be6\u7ec6\u7684\u4ecb\u7ecd\u3002_ollama\u538b\u7f29\u5305\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/9762.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-18T09:37:18+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418093716-68021d4c3b17c.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/9762.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/9762.html\",\"name\":\"\uff08\u8d85\u8be6\u7ec6\u6559\u7a0b\uff09\u6ca1\u6709sudo\u6743\u9650\uff0c\u5728\u670d\u52a1\u5668\u5b89\u88c5ollama\uff0c\u4e0b\u8f7dqwen2\u6a21\u578b\uff0cpython\u4ee3\u7801\u6d4b\u8bd5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-18T09:37:18+00:00\",\"dateModified\":\"2025-04-18T09:37:18+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/9762.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/9762.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/9762.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\uff08\u8d85\u8be6\u7ec6\u6559\u7a0b\uff09\u6ca1\u6709sudo\u6743\u9650\uff0c\u5728\u670d\u52a1\u5668\u5b89\u88c5ollama\uff0c\u4e0b\u8f7dqwen2\u6a21\u578b\uff0cpython\u4ee3\u7801\u6d4b\u8bd5\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\uff08\u8d85\u8be6\u7ec6\u6559\u7a0b\uff09\u6ca1\u6709sudo\u6743\u9650\uff0c\u5728\u670d\u52a1\u5668\u5b89\u88c5ollama\uff0c\u4e0b\u8f7dqwen2\u6a21\u578b\uff0cpython\u4ee3\u7801\u6d4b\u8bd5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/9762.html","og_locale":"zh_CN","og_type":"article","og_title":"\uff08\u8d85\u8be6\u7ec6\u6559\u7a0b\uff09\u6ca1\u6709sudo\u6743\u9650\uff0c\u5728\u670d\u52a1\u5668\u5b89\u88c5ollama\uff0c\u4e0b\u8f7dqwen2\u6a21\u578b\uff0cpython\u4ee3\u7801\u6d4b\u8bd5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb4.4k\u6b21\uff0c\u70b9\u8d5e51\u6b21\uff0c\u6536\u85cf36\u6b21\u3002\u672c\u6587\u8be6\u7ec6\u4ecb\u7ecd\u4e86ollama\u7684\u4e0b\u8f7d\u5b89\u88c5\uff0c\u5982\u4f55\u5728\u547d\u4ee4\u884c\u4e0b\u8f7d\uff0c\u5982\u4f55\u5728\u672c\u5730\u4e0b\u8f7d\u4e0a\u4f20\u670d\u52a1\u5668\u3002\u4ee5\u53ca\u73af\u5883\u53d8\u91cf\u7684\u90e8\u7f72\uff0c\u4ee5\u53ca\u5982\u4f55\u62c9\u53d6\u6a21\u578b\uff0cpython\u4ee3\u7801\u6d4b\u8bd5\uff0c\u90fd\u6709\u8be6\u7ec6\u7684\u4ecb\u7ecd\u3002_ollama\u538b\u7f29\u5305","og_url":"https:\/\/www.wsisp.com\/helps\/9762.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-18T09:37:18+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418093716-68021d4c3b17c.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/9762.html","url":"https:\/\/www.wsisp.com\/helps\/9762.html","name":"\uff08\u8d85\u8be6\u7ec6\u6559\u7a0b\uff09\u6ca1\u6709sudo\u6743\u9650\uff0c\u5728\u670d\u52a1\u5668\u5b89\u88c5ollama\uff0c\u4e0b\u8f7dqwen2\u6a21\u578b\uff0cpython\u4ee3\u7801\u6d4b\u8bd5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-18T09:37:18+00:00","dateModified":"2025-04-18T09:37:18+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/9762.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/9762.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/9762.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\uff08\u8d85\u8be6\u7ec6\u6559\u7a0b\uff09\u6ca1\u6709sudo\u6743\u9650\uff0c\u5728\u670d\u52a1\u5668\u5b89\u88c5ollama\uff0c\u4e0b\u8f7dqwen2\u6a21\u578b\uff0cpython\u4ee3\u7801\u6d4b\u8bd5"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/9762","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=9762"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/9762\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/9750"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=9762"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=9762"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=9762"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=9762"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}