1"use strict";(self.webpackChunkmlwizardry=self.webpackChunkmlwizardry||[]).push([[938],{6205:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>i,default:()=>p,frontMatter:()=>s,metadata:()=>u,toc:()=>d});var r=t(4848),l=t(8453),a=t(1470),o=t(9365);const s={sidebar_position:1},i="Python\u74b0\u5883\u306e\u69cb\u7bc9",u={id:"python/install",title:"Python\u74b0\u5883\u306e\u69cb\u7bc9",description:"Python\u3068\u306f",source:"@site/docs/python/install.mdx",sourceDirName:"python",slug:"/python/install",permalink:"/python/install",draft:!1,unlisted:!1,editUrl:"https://github.com/librewave/mlwizardry/tree/main/docs/python/install.mdx",tags:[],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1},sidebar:"tutorialSidebar",previous:{title:"Python",permalink:"/category/python"},next:{title:"Python\u306e\u57fa\u672c",permalink:"/python/basic"}},c={},d=[{value:"Python\u3068\u306f",id:"python\u3068\u306f",level:2},{value:"Python\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb",id:"python\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb",level:2}];function h(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",...(0,l.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h1,{id:"python\u74b0\u5883\u306e\u69cb\u7bc9",children:"Python\u74b0\u5883\u306e\u69cb\u7bc9"}),"\n",(0,r.jsx)(n.h2,{id:"python\u3068\u306f",children:"Python\u3068\u306f"}),"\n",(0,r.jsx)(n.p,{children:"Python\u306f\u3001Guido van Rossum\u6c0f\u306b\u3088\u3063\u30661989\u5e74\u304b\u3089\u958b\u767a\u304c\u30b9\u30bf\u30fc\u30c8\u3057\u305f\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3067\u3059\u3002\u73fe\u5728\u3001Python\u306f\u4e16\u754c\u4e2d\u3067\u5e83\u304f\u4f7f\u7528\u3055\u308c\u3066\u304a\u308a\u3001\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3068\u3057\u3066\u4eba\u6c17\u304c\u9ad8\u307e\u3063\u3066\u3044\u307e\u3059\u3002"}),"\n",(0,r.jsx)(n.p,{children:"Python\u306f\u3001AI\u958b\u767a\u306b\u5fc5\u8981\u306a\u6a5f\u68b0\u5b66\u7fd2\u30e9\u30a4\u30d6\u30e9\u30ea\u3084\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u304c\u8c4a\u5bcc\u306b\u63c3\u3063\u3066\u3044\u308b\u3053\u3068\u3067\u77e5\u3089\u308c\u3066\u3044\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001TensorFlow\u3001Keras\u3001PyTorch\u3001Scikit-learn\u3001NumPy\u3001Pandas\u3001Matplotlib\u306a\u3069\u3067\u3059\u3002\u3053\u306e\u305f\u3081\u3001Python\u306fAI\u958b\u767a\u8005\u306b\u3068\u3063\u3066\u975e\u5e38\u306b\u91cd\u8981\u306a\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002\u307e\u305f\u3001Python\u306f\u30b7\u30f3\u30d7\u30eb\u3067\u8aad\u307f\u3084\u3059\u304f\u66f8\u304d\u3084\u3059\u3044\u305f\u3081\u3001\u521d\u5fc3\u8005\u3067\u3082\u6271\u3044\u3084\u3059\u304f\u3001AI\u958b\u767a\u306e\u5b66\u7fd2\u306b\u9069\u3057\u3066\u3044\u308b\u3068\u3055\u308c\u3066\u3044\u307e\u3059\u3002"}),"\n",(0,r.jsx)(n.h2,{id:"python\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb",children:"Python\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb"}),"\n",(0,r.jsxs)(a.A,{defaultValue:"windows",values:[{label:"Windows",value:"windows"},{label:"macOS",value:"macos"},{label:"Linux",value:"linux"}],children:[(0,r.jsx)(o.A,{value:"windows",children:(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["Python\u516c\u5f0f\u30b5\u30a4\u30c8\u306b\u30a2\u30af\u30bb\u30b9: ",(0,r.jsx)(n.a,{href:"https://www.python.org/",children:"https://www.python.org/"})]}),"\n",(0,r.jsx)(n.li,{children:"\u300cDownloads\u300d\u30e1\u30cb\u30e5\u30fc\u304b\u3089\u300cWindows\u300d\u3092\u9078\u629e\u3057\u307e\u3059\u3002"}),"\n",(0,r.jsx)(n.li,{children:"\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u30da\u30fc\u30b8\u304b\u3089\u3001\u6700\u65b0\u306ePython\u30a4\u30f3\u30b9\u30c8\u30fc\u30e9\u30fc\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u307e\u3059\u3002\u901a\u5e38\u3001\u30da\u30fc\u30b8\u5185\u306b\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u6700\u65b0\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30e9\u30fc\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u3053\u3068\u304c\u63a8\u5968\u3055\u308c\u307e\u3059\u3002"}),"\n",(0,r.jsxs)(n.li,{children:["\u30a4\u30f3\u30b9\u30c8\u30fc\u30e9\u30fc\u3092\u5b9f\u884c\u3057\u3001\u753b\u9762\u306e\u6307\u793a\u306b\u5f93\u3063\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u9032\u3081\u307e\u3059\u3002",(0,r.jsx)(n.strong,{children:"\u300cAdd Python to PATH\u300d\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u306b\u30c1\u30a7\u30c3\u30af\u3092\u5165\u308c\u308b\u3053\u3068\u3092\u5fd8\u308c\u305a\u306b"}),"\u3001\u3053\u308c\u306b\u3088\u308aPython\u304c\u30b7\u30b9\u30c6\u30e0\u306e\u74b0\u5883\u5909\u6570\u306b\u8ffd\u52a0\u3055\u308c\u307e\u3059\u3002"]}),"\n",(0,r.jsxs)(n.li,{children:["\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5b8c\u4e86\u3057\u305f\u3089\u3001\u30b3\u30de\u30f3\u30c9\u30d7\u30ed\u30f3\u30d7\u30c8\u3092\u958b\u304d\u3001",(0,r.jsx)(n.code,{children:"python --version"}),"\u30b3\u30de\u30f3\u30c9\u3092\u5165\u529b\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u6210\u529f\u3057\u305f\u3053\u3068\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002"]}),"\n"]})}),(0,r.jsx)(o.A,{value:"macos",children:(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["Python\u516c\u5f0f\u30b5\u30a4\u30c8\u306b\u30a2\u30af\u30bb\u30b9: ",(0,r.jsx)(n.a,{href:"https://www.python.org/",children:"https://www.python.org/"})]}),"\n",(0,r.jsx)(n.li,{children:"\u300cDownloads\u300d\u30e1\u30cb\u30e5\u30fc\u304b\u3089\u300cmacOS\u300d\u3092\u9078\u629e\u3057\u307e\u3059\u3002"}),"\n",(0,r.jsx)(n.li,{children:"\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u30da\u30fc\u30b8\u304b\u3089\u3001\u6700\u65b0\u306ePython\u30a4\u30f3\u30b9\u30c8\u30fc\u30e9\u30fc\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u307e\u3059\u3002\u901a\u5e38\u3001\u30da\u30fc\u30b8\u5185\u306b\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u6700\u65b0\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30e9\u30fc\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u3053\u3068\u304c\u63a8\u5968\u3055\u308c\u307e\u3059\u3002"}),"\n",(0,r.jsx)(n.li,{children:"\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u305f\u30a4\u30f3\u30b9\u30c8\u30fc\u30e9\u30fc\u3092\u5b9f\u884c\u3057\u3001\u753b\u9762\u306e\u6307\u793a\u306b\u5f93\u3063\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u9032\u3081\u307e\u3059\u3002"}),"\n",(0,r.jsxs)(n.li,{children:["\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5b8c\u4e86\u3057\u305f\u3089\u3001\u30bf\u30fc\u30df\u30ca\u30eb\u3092\u958b\u304d\u3001",(0,r.jsx)(n.code,{children:"python3 --version"}),"\u30b3\u30de\u30f3\u30c9\u3092\u5165\u529b\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u6210\u529f\u3057\u305f\u3053\u3068\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002"]}),"\n"]})}),(0,r.jsxs)(o.A,{value:"linux",children:[(0,r.jsx)(n.p,{children:"Linux\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u306b\u3088\u3063\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u65b9\u6cd5\u304c\u7570\u306a\u308a\u307e\u3059\u304c\u3001\u3053\u3053\u3067\u306fUbuntu\u3092\u4f8b\u306b\u8aac\u660e\u3057\u307e\u3059\u3002"}),(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsx)(n.li,{children:"\u30bf\u30fc\u30df\u30ca\u30eb\u3092\u958b\u304d\u307e\u3059\u3002"}),"\n",(0,r.jsx)(n.li,{children:"\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u3001\u30b7\u30b9\u30c6\u30e0\u3092\u6700\u65b0\u306e\u72b6\u614b\u306b\u66f4\u65b0\u3057\u307e\u3059\u3002"}),"\n"]}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"sudo apt update\nsudo apt upgrade\n"})}),(0,r.jsxs)(n.ol,{start:"3",children:["\n",(0,r.jsx)(n.li,{children:"\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u3001Python\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002"}),"\n"]}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"sudo apt install python3\n"})}),(0,r.jsxs)(n.ol,{start:"4",children:["\n",(0,r.jsxs)(n.li,{children:["\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5b8c\u4e86\u3057\u305f\u3089\u3001",(0,r.jsx)(n.code,{children:"python3 --version"}),"\u30b3\u30de\u30f3\u30c9\u3092\u5165\u529b\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u6210\u529f\u3057\u305f\u3053\u3068\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002"]}),"\n"]})]})]}),"\n",(0,r.jsx)(n.p,{children:"\u4ee5\u4e0a\u3067\u3001Python\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5b8c\u4e86\u3067\u3059\u3002\u3053\u308c\u3067\u3042\u306a\u305f\u306e\u30de\u30b7\u30f3\u306bPython\u74b0\u5883\u304c\u69cb\u7bc9\u3055\u308c\u307e\u3057\u305f\u3002\u6b21\u306e\u30b9\u30c6\u30c3\u30d7\u3068\u3057\u3066\u3001Python\u306e\u57fa\u672c\u7684\u306a\u69cb\u6587\u3092\u5b66\u3093\u3067\u307f\u307e\u3057\u3087\u3046\u3002"})]})}function p(e={}){const{wrapper:n}={...(0,l.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(h,{...e})}):h(e)}},9365:(e,n,t)=>{t.d(n,{A:()=>o});t(6540);var r=t(8215);const l={tabItem:"tabItem_Ymn6"};var a=t(4848);function o(e){let{children:n,hidden:t,className:o}=e;return(0,a.jsx)("div",{role:"tabpanel",className:(0,r.A)(l.tabItem,o),hidden:t,children:n})}},1470:(e,n,t)=>{t.d(n,{A:()=>g});var r=t(6540),l=t(8215),a=t(3104),o=t(6347),s=t(205),i=t(7485),u=t(1682),c=t(679);function d(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad <Tabs>
1 child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the <Tabs> component should be <TabItem>, and every <TabItem> should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:t}=e;return(0,r.useMemo)((()=>{const e=n??function(e){return d(e).map((e=>{let{props:{value:n,label:t,attributes:r,default:l}}=e;return{value:n,label:t,attributes:r,default:l}}))}(t);return function(e){const n=(0,u.X)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in <Tabs>. Every value needs to be unique.`)}(e),e}),[n,t])}function p(e){let{value:n,tabValues:t}=e;return t.some((e=>e.value===n))}function y(e){let{queryString:n=!1,groupId:t}=e;const l=(0,o.W6)(),a=function(e){let{queryString:n=!1,groupId:t}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!t)throw new Error('Docusaurus error: The <Tabs> component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:n,groupId:t});return[(0,i.aZ)(a),(0,r.useCallback)((e=>{if(!a)return;const n=new URLSearchParams(l.location.search);n.set(a,e),l.replace({...l.location,search:n.toString()})}),[a,l])]}function b(e){const{defaultValue:n,queryString:t=!1,groupId:l}=e,a=h(e),[o,i]=(0,r.useState)((()=>function(e){let{defaultValue:n,tabValues:t}=e;if(0===t.length)throw new Error("Docusaurus error: the <Tabs> component requires at least one <TabItem> children component");if(n){if(!p({value:n,tabValues:t}))throw new Error(`Docusaurus error: The <Tabs> has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${t.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const r=t.find((e=>e.default))??t[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:n,tabValues:a}))),[u,d]=y({queryString:t,groupId:l}),[b,f]=function(e){let{groupId:n}=e;const t=function(e){return e?`docusaurus.tab.${e}`:null}(n),[l,a]=(0,c.Dv)(t);return[l,(0,r.useCallback)((e=>{t&&a.set(e)}),[t,a])]}({groupId:l}),m=(()=>{const e=u??b;return p({value:e,tabValues:a})?e:null})();(0,s.A)((()=>{m&&i(m)}),[m]);return{selectedValue:o,selectValue:(0,r.useCallback)((e=>{if(!p({value:e,tabValues:a}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),f(e)}),[d,f,a]),tabValues:a}}var f=t(2303);const m={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var x=t(4848);function v(e){let{className:n,block:t,selectedValue:r,selectValue:o,tabValues:s}=e;const i=[],{blockElementScrollPositionUntilNextRender:u}=(0,a.a_)(),c=e=>{const n=e.currentTarget,t=i.indexOf(n),l=s[t].value;l!==r&&(u(n),o(l))},d=e=>{let n=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const t=i.indexOf(e.currentTarget)+1;n=i[t]??i[0];break}case"ArrowLeft":{const t=i.indexOf(e.currentTarget)-1;n=i[t]??i[i.length-1];break}}n?.focus()};return(0,x.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,l.A)("tabs",{"tabs--block":t},n),children:s.map((e=>{let{value:n,label:t,attributes:a}=e;return(0,x.jsx)("li",{role:"tab",tabIndex:r===n?0:-1,"aria-selected":r===n,ref:e=>i.push(e),onKeyDown:d,onClick:c,...a,className:(0,l.A)("tabs__item",m.tabItem,a?.className,{"tabs__item--active":r===n}),children:t??n},n)}))})}function j(e){let{lazy:n,children:t,selectedValue:l}=e;const a=(Array.isArray(t)?t:[t]).filter(Boolean);if(n){const e=a.find((e=>e.props.value===l));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return(0,x.jsx)("div",{className:"margin-top--md",children:a.map(((e,n)=>(0,r.cloneElement)(e,{key:n,hidden:e.props.value!==l})))})}function w(e){const n=b(e);return(0,x.jsxs)("div",{className:(0,l.A)("tabs-container",m.tabList),
1children:[(0,x.jsx)(v,{...n,...e}),(0,x.jsx)(j,{...n,...e})]})}function g(e){const n=(0,f.A)();return(0,x.jsx)(w,{...e,children:d(e.children)},String(n))}},8453:(e,n,t)=>{t.d(n,{R:()=>o,x:()=>s});var r=t(6540);const l={},a=r.createContext(l);function o(e){const n=r.useContext(a);return r.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function s(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(l):e.components||l:o(e.components),r.createElement(a.Provider,{value:n},e.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.