teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

5

▼ターミナル実行結果に(6)を追加しました。こちらでよろしかったでしょうか?

2018/08/31 05:55

投稿

gumkuchakucha
gumkuchakucha

スコア6

title CHANGED
File without changes
body CHANGED
@@ -11,8 +11,11 @@
11
11
 
12
12
  ▼ターミナル実行結果
13
13
  **(1)which python** → /anaconda3/bin/python
14
+
14
15
  **(2)python -V** → Python 3.6.5 :: Anaconda, Inc.
16
+
15
17
  **(3)python -c 'import sys; print(sys.prefix)'** → /anaconda3
18
+
16
19
  **(4)python -m pip show openpyxl** →
17
20
  Name: openpyxl
18
21
  Version: 2.5.3
@@ -27,6 +30,17 @@
27
30
  You are using pip version 10.0.1, however version 18.0 is available.
28
31
  You should consider upgrading via the 'pip install --upgrade pip' command.
29
32
 
33
+ **(5)python** → 
34
+ Python 3.6.5 |Anaconda, Inc.| (default, Apr 26 2018, 08:42:37)
35
+ [GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
36
+ Type "help", "copyright", "credits" or "license" for more information.
37
+
38
+ **(6)>>>import openpyxl
39
+ >>>print(type(sheet))→**
40
+ Traceback (most recent call last):
41
+ File "<stdin>", line 1, in <module>
42
+ NameError: name 'sheet' is not defined
43
+
30
44
  ### 該当のソースコード
31
45
 
32
46
  ```ここに言語名を入力

4

「試したこと」に、どのように実行したのか詳細を追記致しました。ご確認お願い致します。

2018/08/31 05:55

投稿

gumkuchakucha
gumkuchakucha

スコア6

title CHANGED
File without changes
body CHANGED
@@ -34,9 +34,10 @@
34
34
  ```
35
35
 
36
36
  ### 試したこと
37
+ Launchpadから「IDLE」を実行し、Shell上で「import openpyxl」と入力し、F5キーで
38
+ 実行致しました。
37
39
 
38
- Pythonファイル上でopenpyxlをインポートしたのですが、
39
- 「ModuleNotFoundError: No module named 'openpyxl'」と表示されました。
40
+ その結果、Shellには「ModuleNotFoundError: No module named 'openpyxl'」と表示されました。
40
41
 
41
42
  ネットで調べたところ、anacondaというパッケージが詰まったアプリを落としてくればいいということがわかり、
42
43
  下記サイトの手順通りに進めてみたのですが、何度Pythonを起動させて、openpyxlをインポートしようとしても

3

ターミナル実行結果に誤りがあったので修正致しました

2018/08/31 05:04

投稿

gumkuchakucha
gumkuchakucha

スコア6

title CHANGED
File without changes
body CHANGED
@@ -10,7 +10,7 @@
10
10
  ```
11
11
 
12
12
  ▼ターミナル実行結果
13
- **(1)which python** → which python
13
+ **(1)which python** → /anaconda3/bin/python
14
14
  **(2)python -V** → Python 3.6.5 :: Anaconda, Inc.
15
15
  **(3)python -c 'import sys; print(sys.prefix)'** → /anaconda3
16
16
  **(4)python -m pip show openpyxl** →

2

ターミナル実行結果に追記致しました

2018/08/31 04:58

投稿

gumkuchakucha
gumkuchakucha

スコア6

title CHANGED
File without changes
body CHANGED
@@ -9,12 +9,24 @@
9
9
  ModuleNotFoundError: No module named 'openpyxl
10
10
  ```
11
11
 
12
- ターミナル実行結果
12
+ ターミナル実行結果
13
- (1)which python → which python
13
+ **(1)which python** → which python
14
- (2)python -V → Python 3.6.5 :: Anaconda, Inc.
14
+ **(2)python -V** → Python 3.6.5 :: Anaconda, Inc.
15
- (3)python -c 'import sys; print(sys.prefix)' → /anaconda3
15
+ **(3)python -c 'import sys; print(sys.prefix)'** → /anaconda3
16
+ **(4)python -m pip show openpyxl** →
17
+ Name: openpyxl
18
+ Version: 2.5.3
19
+ Summary: A Python library to read/write Excel 2010 xlsx/xlsm files
20
+ Home-page: https://openpyxl.readthedocs.io
21
+ Author: See AUTHORS
22
+ Author-email: charlie.clark@clark-consulting.eu
23
+ License: MIT/Expat
24
+ Location: /anaconda3/lib/python3.6/site-packages
25
+ Requires: jdcal, et-xmlfile
26
+ Required-by:
27
+ You are using pip version 10.0.1, however version 18.0 is available.
28
+ You should consider upgrading via the 'pip install --upgrade pip' command.
16
29
 
17
-
18
30
  ### 該当のソースコード
19
31
 
20
32
  ```ここに言語名を入力

1

ターミナル実行結果を追記しました

2018/08/31 04:53

投稿

gumkuchakucha
gumkuchakucha

スコア6

title CHANGED
File without changes
body CHANGED
@@ -9,6 +9,12 @@
9
9
  ModuleNotFoundError: No module named 'openpyxl
10
10
  ```
11
11
 
12
+ ターミナル実行結果
13
+ (1)which python → which python
14
+ (2)python -V → Python 3.6.5 :: Anaconda, Inc.
15
+ (3)python -c 'import sys; print(sys.prefix)' → /anaconda3
16
+
17
+
12
18
  ### 該当のソースコード
13
19
 
14
20
  ```ここに言語名を入力