{"id":8254,"date":"2018-07-23T08:57:13","date_gmt":"2018-07-22T23:57:13","guid":{"rendered":"https:\/\/www.gesource.jp\/weblog\/?p=8254"},"modified":"2018-06-26T08:00:38","modified_gmt":"2018-06-25T23:00:38","slug":"powershell%e3%81%a7anaconda%e3%82%92%e4%bd%bf%e3%81%86%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/www.gesource.jp\/weblog\/?p=8254","title":{"rendered":"PowerShell\u3067Anaconda\u3092\u4f7f\u3046\u65b9\u6cd5"},"content":{"rendered":"<p>Anaconda\u3092PowerShell\u3067\u4f7f\u3048\u308b\u3088\u3046\u306b\u3059\u308b\u305f\u3081\u306e\u8a2d\u5b9a\u65b9\u6cd5\u306e\u5099\u5fd8\u9332\u3002<\/p>\n<h2>PowerShell\u306e\u30d1\u30b9\u3092\u767b\u9332\u3059\u308b<\/h2>\n<p>PowerShell\u304b\u3089\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3002<\/p>\n<pre><code>&gt; $profile\nC:\\Users\\yamamoto\\Documents\\WindowsPowerShell\\Microsoft.PowerShell_profile.ps1\n<\/code><\/pre>\n<p>\u8d77\u52d5\u6642\u306b\u8aad\u307f\u8fbc\u307e\u308c\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u30d1\u30b9\u304c\u8868\u793a\u3055\u308c\u308b\u3002<\/p>\n<p>\u8868\u793a\u3055\u308c\u305f\u30d5\u30a9\u30eb\u30c0\u30fc\u3092\u4f5c\u6210\u3059\u308b\u3002<\/p>\n<pre><code>notepad $profile\n<\/code><\/pre>\n<p>\u30e1\u30e2\u5e33\u304c\u8d77\u52d5\u3057\u305f\u3089\u3001Anaconda\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u30d1\u30b9\u306b\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n<pre><code># Anaconda\n$Env:Path += \";C:\\Users\\yamamoto\\Anaconda3\\Library\\bin\\\"\n$Env:Path += \";C:\\Users\\yamamoto\\Anaconda3\\Scripts\"\n<\/code><\/pre>\n<h2>PowerShell\u306e\u6a29\u9650\u3092\u8a2d\u5b9a\u3059\u308b<\/h2>\n<p>PowerShell\u3092\u8d77\u52d5\u3059\u308b\u3068\u3001\u300c\u3053\u306e\u30b7\u30b9\u30c6\u30e0\u3067\u306f\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u5b9f\u884c\u304c\u7121\u52b9\u306b\u306a\u3063\u3066\u3044\u308b\u305f\u3081\u3001\u2026\u300d\u3068\u3044\u3046\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u308b\u3002<\/p>\n<pre><code>\u8a73\u7d30\u306b\u3064\u3044\u3066\u306f\u3001\u300cabout_Execution_Policies\u300d(https:\/\/go.microsoft.com\/fwlink\/?LinkID=135170) \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002\n<\/code><\/pre>\n<p>\u3053\u306eURL\u3092\u958b\u304f\u3068\u3001\u73fe\u5728\u306e\u5b9f\u884c\u30dd\u30ea\u30b7\u30fc\u306f\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3067\u304d\u306a\u3044\u8a2d\u5b9a\u306b\u306a\u3063\u3066\u3044\u308b\u305f\u3081\u30a8\u30e9\u30fc\u306b\u306a\u3063\u3066\u3044\u308b\u3053\u3068\u304c\u308f\u304b\u308b\u3002<\/p>\n<p>\u73fe\u5728\u306e\u8a2d\u5b9a\u306f\u300cGet-ExecutionPolicy\u300d\u30b3\u30de\u30f3\u30c9\u3067\u78ba\u8a8d\u3067\u304d\u308b\u3002<\/p>\n<pre><code>&gt; Get-ExecutionPolicy\nRestricted\n<\/code><\/pre>\n<p>\u300cRestricted\u300d\u306f\u65e2\u5b9a\u306e\u30dd\u30ea\u30b7\u30fc\u3067\u3001\u30b9\u30af\u30ea\u30d7\u30c8\u306f\u5b9f\u884c\u3067\u304d\u306a\u3044\u3002<\/p>\n<h3>\u5b9f\u884c\u30dd\u30ea\u30b7\u30fc\u3092\u5909\u66f4\u3059\u308b<\/h3>\n<p>\u5b9f\u884c\u30dd\u30ea\u30b7\u30fc\u3092\u300cRemoteSigned\u300d\u306b\u5909\u66f4\u3059\u308b\u3002<\/p>\n<p>\u300cRemoteSigned\u300d\u306f\u3001<br \/>\n\u30ed\u30fc\u30ab\u30eb\u30b3\u30f3\u30d4\u30e5\u30fc\u30bf\u30fc\u4e0a\u3067\u8a18\u8ff0\u3055\u308c\u305f\u30b9\u30af\u30ea\u30d7\u30c8<br \/>\n\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3055\u308c\u305f\u4fe1\u983c\u3055\u308c\u305f\u767a\u884c\u5143\u306b\u3088\u3063\u3066\u30c7\u30b8\u30bf\u30eb\u7f72\u540d\u3055\u308c\u3066\u3044\u308b\u30b9\u30af\u30ea\u30d7\u30c8<br \/>\n\u3092\u5b9f\u884c\u3067\u304d\u308b\u3002<\/p>\n<p>PowerShell\u3092\u7ba1\u7406\u8005\u3068\u3057\u3066\u5b9f\u884c\u3057\u3001\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3002<\/p>\n<pre><code>&gt; Set-ExecutionPolicy RemoteSigned\n\n\u5b9f\u884c\u30dd\u30ea\u30b7\u30fc\u306e\u5909\u66f4\n\u5b9f\u884c\u30dd\u30ea\u30b7\u30fc\u306f\u3001\u4fe1\u983c\u3055\u308c\u3066\u3044\u306a\u3044\u30b9\u30af\u30ea\u30d7\u30c8\u304b\u3089\u306e\u4fdd\u8b77\u306b\u5f79\u7acb\u3061\u307e\u3059\u3002\u5b9f\u884c\u30dd\u30ea\u30b7\u30fc\u3092\u5909\u66f4\u3059\u308b\u3068\u3001about_Execution_Policies\n\u306e\u30d8\u30eb\u30d7 \u30c8\u30d4\u30c3\u30af (https:\/\/go.microsoft.com\/fwlink\/?LinkID=135170)\n\u3067\u8aac\u660e\u3055\u308c\u3066\u3044\u308b\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u4e0a\u306e\u5371\u967a\u306b\u3055\u3089\u3055\u308c\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\u5b9f\u884c\u30dd\u30ea\u30b7\u30fc\u3092\u5909\u66f4\u3057\u307e\u3059\u304b?\n[Y] \u306f\u3044(Y)  [A] \u3059\u3079\u3066\u7d9a\u884c(A)  [N] \u3044\u3044\u3048(N)  [L] \u3059\u3079\u3066\u7121\u8996(L)  [S] \u4e2d\u65ad(S)  [?] \u30d8\u30eb\u30d7 (\u65e2\u5b9a\u5024\u306f \"N\"): y\n<\/code><\/pre>\n<p>\u3053\u308c\u3067\u3001\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u3002<\/p>\n<h2>conda\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u307f\u308b\u3002<\/h2>\n<p>PowerShell\u3092\u8d77\u52d5\u3059\u308b\u3002<br \/>\n\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u306f\u8868\u793a\u3055\u308c\u306a\u304f\u306a\u3063\u3066\u3044\u308b\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3002<\/p>\n<pre><code>&gt; conda -V\nconda 4.5.4\n<\/code><\/pre>\n<p>\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u8868\u793a\u3055\u308c\u308c\u3070\u6210\u529f\u3060\u3002<\/p>\n<h2>activate\u3067\u304d\u306a\u3044\u554f\u984c\u3092\u89e3\u6c7a\u3059\u308b<\/h2>\n<p>PowerShell\u304b\u3089activate\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u3082\u3001\u4eee\u60f3\u74b0\u5883\u3092\u4f7f\u7528\u3067\u304d\u306a\u3044\u3002<\/p>\n<p>\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001PowerShell\u3067activate\u30b3\u30de\u30f3\u30c9\u304c\u4f7f\u3048\u308b\u3088\u3046\u306b\u306a\u308b\u3002<\/p>\n<pre><code>&gt; conda install -n root -c pscondaenvs pscondaenvs\n<\/code><\/pre>\n<p>\u52d5\u4f5c\u3092\u78ba\u8a8d\u3059\u308b\u3002<\/p>\n<pre><code>&gt; activate my_env\n(my_env) PS C:\\Users\\yamamoto&gt; python --version\nPython 3.6.5 :: Anaconda, Inc.\n<\/code><\/pre>\n<p>\u4f7f\u3048\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Anaconda\u3092PowerShell\u3067\u4f7f\u3048\u308b\u3088\u3046\u306b\u3059\u308b\u305f\u3081\u306e\u8a2d\u5b9a\u65b9\u6cd5\u306e\u5099\u5fd8\u9332\u3002 PowerShell\u306e\u30d1\u30b9\u3092\u767b\u9332\u3059\u308b PowerShell\u304b\u3089\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3002 &gt; $profile C:\\Users\\ya &#8230;<\/p>\n<p><a href=\"https:\/\/www.gesource.jp\/weblog\/?p=8254\" class=\"more-link\">Continue reading &lsquo;PowerShell\u3067Anaconda\u3092\u4f7f\u3046\u65b9\u6cd5&rsquo; &raquo;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[7],"tags":[143],"class_list":["post-8254","post","type-post","status-publish","format-standard","hentry","category-python","tag-python"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.gesource.jp\/weblog\/index.php?rest_route=\/wp\/v2\/posts\/8254","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gesource.jp\/weblog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gesource.jp\/weblog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gesource.jp\/weblog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gesource.jp\/weblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8254"}],"version-history":[{"count":0,"href":"https:\/\/www.gesource.jp\/weblog\/index.php?rest_route=\/wp\/v2\/posts\/8254\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.gesource.jp\/weblog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8254"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gesource.jp\/weblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8254"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gesource.jp\/weblog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8254"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}