質問編集履歴

2

追記

2018/10/07 13:02

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -157,3 +157,255 @@
157
157
  Werkzeug==0.14.1
158
158
 
159
159
  wrapt==1.10.11
160
+
161
+
162
+
163
+ ---
164
+
165
+ #追記①
166
+
167
+
168
+
169
+ VSCode のターミナル(Bash)で実行
170
+
171
+ ```Bash
172
+
173
+ $ powershell
174
+
175
+ Windows PowerShell
176
+
177
+ Copyright (C) Microsoft Corporation. All rights reserved.
178
+
179
+
180
+
181
+ [PS](*'-')<D:\DevNotes\ProjectFolder> .env/Scripts/Activate
182
+
183
+ (.env) [PS](*'-')<D:\DevNotes\ProjectFolder> pip list
184
+
185
+ Package Version
186
+
187
+ ----------------- -------
188
+
189
+ astroid 2.0.4
190
+
191
+ Click 7.0
192
+
193
+ colorama 0.3.9
194
+
195
+ Flask 1.0.2
196
+
197
+ isort 4.3.4
198
+
199
+ itsdangerous 0.24
200
+
201
+ Jinja2 2.10
202
+
203
+ lazy-object-proxy 1.3.1
204
+
205
+ MarkupSafe 1.0
206
+
207
+ mccabe 0.6.1
208
+
209
+ pip 18.1
210
+
211
+ pylint 2.1.1
212
+
213
+ python-dotenv 0.9.1
214
+
215
+ rope 0.11.0
216
+
217
+ setuptools 40.4.3
218
+
219
+ six 1.11.0
220
+
221
+ typed-ast 1.1.0
222
+
223
+ Werkzeug 0.14.1
224
+
225
+ wheel 0.32.1
226
+
227
+ wrapt 1.10.11
228
+
229
+ (.env) [PS](*'-')<D:\DevNotes\ProjectFolder> pip show python-dotenv
230
+
231
+ Name: python-dotenv
232
+
233
+ Version: 0.9.1
234
+
235
+ Summary: Add .env support to your django/flask apps in development and deployments
236
+
237
+ Home-page: http://github.com/theskumar/python-dotenv
238
+
239
+ Author: Saurabh Kumar
240
+
241
+ Author-email: me+github@saurabh-kumar.com
242
+
243
+ License: UNKNOWN
244
+
245
+ Location: d:\devnotes\ProjectFolder.env\lib\site-packages
246
+
247
+ Requires:
248
+
249
+ Required-by:
250
+
251
+ (.env) [PS](*'-')<D:\DevNotes\ProjectFolder>
252
+
253
+
254
+
255
+ ## インタープリタをPython3.6.6(virtualenv)
256
+
257
+ ## デバッグをPython:Flask で実行
258
+
259
+
260
+
261
+ Traceback (most recent call last):
262
+
263
+ File "c:\program files (x86)\microsoft visual studio\shared\python36_64\Lib\runpy.py", line 193, in _run_module_as_main
264
+
265
+ "__main__", mod_spec)
266
+
267
+ File "c:\program files (x86)\microsoft visual studio\shared\python36_64\Lib\runpy.py", line 85, in _run_code
268
+
269
+ exec(code, run_globals)
270
+
271
+ File "c:\Users\defau.vscode\extensions\ms-python.python-2018.8.0\pythonFiles\experimental\ptvsd\ptvsd\__main__.py", line 211, in <module>
272
+
273
+ singlesession=args.single_session)
274
+
275
+ File "c:\Users\defau.vscode\extensions\ms-python.python-2018.8.0\pythonFiles\experimental\ptvsd\ptvsd\__main__.py", line 205, in main
276
+
277
+ debug_main(addr, name, kind, *extra, **kwargs)
278
+
279
+ File "c:\Users\defau.vscode\extensions\ms-python.python-2018.8.0\pythonFiles\experimental\ptvsd\ptvsd\_local.py", line 28, in debug_main
280
+
281
+ run_module(address, name, *extra, **kwargs)
282
+
283
+ File "c:\Users\defau.vscode\extensions\ms-python.python-2018.8.0\pythonFiles\experimental\ptvsd\ptvsd\_local.py", line 53, in run_module
284
+
285
+ run(argv, addr, **kwargs)
286
+
287
+ File "c:\Users\defau.vscode\extensions\ms-python.python-2018.8.0\pythonFiles\experimental\ptvsd\ptvsd\_local.py", line 125, in _run
288
+
289
+ _pydevd.main()
290
+
291
+ File "c:\Users\defau.vscode\extensions\ms-python.python-2018.8.0\pythonFiles\experimental\ptvsd\ptvsd\_vendored\pydevd\pydevd.py", line 1752, in main
292
+
293
+ globals = debugger.run(setup['file'], None, None, is_module)
294
+
295
+ File "c:\Users\defau.vscode\extensions\ms-python.python-2018.8.0\pythonFiles\experimental\ptvsd\ptvsd\_vendored\pydevd\pydevd.py", line 1099, in run
296
+
297
+ return self._exec(is_module, entry_point_fn, module_name, file, globals, locals)
298
+
299
+ File "c:\Users\defau.vscode\extensions\ms-python.python-2018.8.0\pythonFiles\experimental\ptvsd\ptvsd\_vendored\pydevd\pydevd.py", line 1123, in _exec
300
+
301
+ runpy._run_module_as_main(module_name, alter_argv=False)
302
+
303
+ File "c:\program files (x86)\microsoft visual studio\shared\python36_64\Lib\runpy.py", line 193, in _run_module_as_main
304
+
305
+ "__main__", mod_spec)
306
+
307
+ File "c:\program files (x86)\microsoft visual studio\shared\python36_64\Lib\runpy.py", line 85, in _run_code
308
+
309
+ exec(code, run_globals)
310
+
311
+ File "D:\DevNotes\ProjectFolder.env\lib\site-packages\flask\__main__.py", line 14, in <module>
312
+
313
+ main(as_module=True)
314
+
315
+ File "D:\DevNotes\ProjectFolder.env\lib\site-packages\flask\cli.py", line 894, in main
316
+
317
+ cli.main(args=args, prog_name=name)
318
+
319
+ File "D:\DevNotes\ProjectFolder.env\lib\site-packages\flask\cli.py", line 548, in main
320
+
321
+ load_dotenv()
322
+
323
+ File "D:\DevNotes\ProjectFolder.env\lib\site-packages\flask\cli.py", line 608, in load_dotenv
324
+
325
+ dotenv.load_dotenv(path)
326
+
327
+ File "D:\DevNotes\ProjectFolder.env\lib\site-packages\dotenv\main.py", line 255, in load_dotenv
328
+
329
+ return DotEnv(f, verbose=verbose).set_as_environment_variables(override=override)
330
+
331
+ File "D:\DevNotes\ProjectFolder.env\lib\site-packages\dotenv\main.py", line 95, in set_as_environment_variables
332
+
333
+ for k, v in self.dict().items():
334
+
335
+ File "D:\DevNotes\ProjectFolder.env\lib\site-packages\dotenv\main.py", line 74, in dict
336
+
337
+ values = OrderedDict(self.parse())
338
+
339
+ File "D:\DevNotes\ProjectFolder.env\lib\site-packages\dotenv\main.py", line 79, in parse
340
+
341
+ f = self._get_stream()
342
+
343
+ File "D:\DevNotes\ProjectFolder.env\lib\site-packages\dotenv\main.py", line 62, in _get_stream
344
+
345
+ return io.open(self.dotenv_path)
346
+
347
+ PermissionError: [Errno 13] Permission denied: 'D:\DevNotes\ProjectFolder\.env'
348
+
349
+
350
+
351
+ ```
352
+
353
+
354
+
355
+ 次は仮想環境ではない、ローカルのpipです。
356
+
357
+ ```bash
358
+
359
+ $ pip freeze
360
+
361
+ astroid==2.0.4
362
+
363
+ Click==7.0
364
+
365
+ colorama==0.3.9
366
+
367
+ cycler==0.10.0
368
+
369
+ future==0.16.0
370
+
371
+ isort==4.3.4
372
+
373
+ itsdangerous==0.24
374
+
375
+ Jinja2==2.10
376
+
377
+ kiwisolver==1.0.1
378
+
379
+ lazy-object-proxy==1.3.1
380
+
381
+ MarkupSafe==1.0
382
+
383
+ matplotlib==3.0.0
384
+
385
+ mccabe==0.6.1
386
+
387
+ numpy==1.15.2
388
+
389
+ pefile==2018.8.8
390
+
391
+ pylint==2.1.1
392
+
393
+ pyparsing==2.2.1
394
+
395
+ pypiwin32==223
396
+
397
+ python-dateutil==2.7.3
398
+
399
+ pywin32==223
400
+
401
+ six==1.11.0
402
+
403
+ typed-ast==1.1.0
404
+
405
+ virtualenv==16.0.0
406
+
407
+ Werkzeug==0.14.1
408
+
409
+ wrapt==1.10.11
410
+
411
+ ```

1

試してみたことを追加

2018/10/07 13:02

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -94,11 +94,15 @@
94
94
 
95
95
  .envディレクトリの権限がUserがフルコントロールであること。(右クリック→プロパティ→セキュリティ)
96
96
 
97
+ 表示されているすべてのユーザーを一時的にフルコントロールにしてみましたがダメでした。
97
98
 
98
99
 
100
+
99
- VisualStudioCodeからではなく、PowerShellを管理者実行しても権限エラーが出ること
101
+ VisualStudioCodeからではなく、PowerShellを管理者実行しても権限エラーが出
100
102
 
101
103
 
104
+
105
+ 試しにプロジェクトの読取専用(一部)を外してみましたが、変わりませんでした。
102
106
 
103
107
 
104
108