質問編集履歴
4
変更
test
CHANGED
File without changes
|
test
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
// test.py (仮想環境env1のもとで実行)
|
3
3
|
import sys
|
4
4
|
print(sys.executable)
|
5
|
-
// C:\Users\user\anaconda3\envs\
|
5
|
+
// C:\Users\user\anaconda3\envs\env1\python.exe
|
6
6
|
print(sys.path)
|
7
7
|
// [c:\users\user\anaconda3\lib\site-packages, etc]
|
8
8
|
import numpy as np
|
@@ -37,7 +37,7 @@
|
|
37
37
|
|
38
38
|
Please note and check the following:
|
39
39
|
|
40
|
-
* The Python version is: Python3.7 from "C:\Users\user\anaconda3\envs\
|
40
|
+
* The Python version is: Python3.7 from "C:\Users\user\anaconda3\envs\env1\python.exe"
|
41
41
|
* The NumPy version is: "1.21.5"
|
42
42
|
|
43
43
|
and make sure that they are the versions you expect.
|
@@ -62,7 +62,7 @@
|
|
62
62
|
https://numpy.org/devdocs/user/troubleshooting-importerror.html
|
63
63
|
Please note and check the following
|
64
64
|
|
65
|
-
* The Python version is: Python3.7 from "C:\Users\user\anaconda3\envs\
|
65
|
+
* The Python version is: Python3.7 from "C:\Users\user\anaconda3\envs\env1\python.exe"
|
66
66
|
* The NumPy version is: "1.21.5"
|
67
67
|
|
68
68
|
and make sure that they are the versions you expect.
|
3
変更
test
CHANGED
File without changes
|
test
CHANGED
@@ -19,7 +19,7 @@
|
|
19
19
|
import numpy
|
20
20
|
// path指定前と同様にImportError
|
21
21
|
```
|
22
|
-
Anacondaで作った仮想環境env1で、numpyをimportしたらエラー(下に詳細を記載)が発生します。実行時に参照するパスを、sys.path.append()で明示的に指定したのですが、改善しません。助言をお願いします。
|
22
|
+
Anacondaで作った仮想環境env1で、numpyをimportしたらエラー(下に詳細を記載)が発生します。実行時に参照するパスを、sys.path.append()で明示的に指定したのですが、改善しません。また、AnacondaPromptでimport numpyをした際には、正常に実行されました。助言をお願いします。
|
23
23
|
|
24
24
|
------Error-----
|
25
25
|
例外が発生しました: ImportError
|
2
henkou
test
CHANGED
File without changes
|
test
CHANGED
@@ -48,7 +48,7 @@
|
|
48
48
|
|
49
49
|
During handling of the above exception, another exception occurred:
|
50
50
|
|
51
|
-
File "C:\Users\user\Desktop\PythonProgram\t
|
51
|
+
File "C:\Users\user\Desktop\PythonProgram\test.py", line 6, in <module>
|
52
52
|
import numpy as np
|
53
53
|
ImportError:
|
54
54
|
|
1
変更
test
CHANGED
File without changes
|
test
CHANGED
@@ -12,15 +12,14 @@
|
|
12
12
|
pip freeze
|
13
13
|
// numpy, etc
|
14
14
|
pip install numpy
|
15
|
-
// Requirement already satisfied: numpy in
|
16
|
-
// c:\users\user\anaconda3\lib\site-packages (1.23.5)
|
15
|
+
// Requirement already satisfied: numpy in c:\users\user\anaconda3\lib\site-packages (1.23.5)
|
17
16
|
-----ここからImport時にpathを指定------
|
18
17
|
import sys
|
19
18
|
sys.path.append(r"c:\users\user\anaconda3\lib\site-packages")
|
20
19
|
import numpy
|
21
20
|
// path指定前と同様にImportError
|
22
21
|
```
|
23
|
-
Anacondaで作った仮想環境env1で、numpyをimportしたらエラーが発生します。実行時に参照するパスを、sys.path.append()で明示的に指定したのですが、改善しません。助言をお願いします。
|
22
|
+
Anacondaで作った仮想環境env1で、numpyをimportしたらエラー(下に詳細を記載)が発生します。実行時に参照するパスを、sys.path.append()で明示的に指定したのですが、改善しません。助言をお願いします。
|
24
23
|
|
25
24
|
------Error-----
|
26
25
|
例外が発生しました: ImportError
|