回答編集履歴

1

追記

2018/09/13 09:26

投稿

LouiS0616
LouiS0616

スコア35660

test CHANGED
@@ -11,3 +11,39 @@
11
11
 
12
12
 
13
13
  そうすれば import exchange できました。
14
+
15
+
16
+
17
+ コメントを受けて
18
+
19
+ ---
20
+
21
+ なるほど、exchange.pyもGoogle Colaboratory上で作りたいのですね。
22
+
23
+
24
+
25
+ 検索してみたところ、次のQAがヒットしましたが、質問者の望んだ答えは得られなかったようです。
26
+
27
+ [StackOverflow - Is that possible to import from different modules in google colaboratory?
28
+
29
+ ](https://stackoverflow.com/questions/50080423/is-that-possible-to-import-from-different-modules-in-google-colaboratory)
30
+
31
+ > Yeah, uploading one or many files is not the problem. The problem is that you like to have all modules of your project in google colab and be able to edit them easily with colab notebook as well.
32
+
33
+
34
+
35
+ ---
36
+
37
+ さらに調査したところ、海外のブログ記事がヒットしました。
38
+
39
+ [Ping Shiuan Chua - Importing Your Own Python Module or Python File in Colaboratory](http://www.pingshiuanchua.com/blog/post/importing-your-own-python-module-or-python-file-in-colaboratory)
40
+
41
+ このサイトでは、次の手順に従ってインポートしています。
42
+
43
+ 0. Gooleドライブへのアクセス権を確保
44
+
45
+ 0. ノートブックとGoogleドライブ上のファイルとの紐づけ
46
+
47
+
48
+
49
+ かなり面倒そうですね。