質問編集履歴

33

書式の改善

2016/08/02 17:07

投稿

gik
gik

スコア152

test CHANGED
File without changes
test CHANGED
File without changes

32

書式の変更

2016/08/02 17:07

投稿

gik
gik

スコア152

test CHANGED
File without changes
test CHANGED
@@ -540,6 +540,10 @@
540
540
 
541
541
 
542
542
 
543
+ import matplotlibではエラーはでません。
544
+
545
+
546
+
543
547
  もしかしてmatplotlibのせいですか?
544
548
 
545
549
  なにがいけないのでしょうか?

31

書式の変更

2016/08/01 15:14

投稿

gik
gik

スコア152

test CHANGED
File without changes
test CHANGED
@@ -514,9 +514,13 @@
514
514
 
515
515
 
516
516
 
517
+ 行ったのですがまた出ました。
518
+
519
+
520
+
517
521
  後matplotlib.pylotで
518
522
 
519
-
523
+ ```
520
524
 
521
525
  import matplotlib.pylot
522
526
 
@@ -532,11 +536,11 @@
532
536
 
533
537
  ImportError: No module named pylot
534
538
 
535
-
539
+ ```
536
-
537
-
538
-
540
+
541
+
542
+
539
- 行ったのですがまた出ました。
543
+ もしかしてmatplotlibせいですか?
540
544
 
541
545
  なにがいけないのでしょうか?
542
546
 

30

書式変更

2016/08/01 15:10

投稿

gik
gik

スコア152

test CHANGED
File without changes
test CHANGED
@@ -512,6 +512,30 @@
512
512
 
513
513
  yum install python2-tktable.x86_64
514
514
 
515
+
516
+
517
+ 後matplotlib.pylotで
518
+
519
+
520
+
521
+ import matplotlib.pylot
522
+
523
+ ---------------------------------------------------------------------------
524
+
525
+ ImportError Traceback (most recent call last)
526
+
527
+ <ipython-input-5-ac86791859c1> in <module>()
528
+
529
+ ----> 1 import matplotlib.pylot
530
+
531
+
532
+
533
+ ImportError: No module named pylot
534
+
535
+
536
+
537
+
538
+
515
539
  行ったのですがまた出ました。
516
540
 
517
541
  なにがいけないのでしょうか?

29

書式の変更

2016/08/01 15:08

投稿

gik
gik

スコア152

test CHANGED
@@ -1 +1 @@
1
- しょしきpyenvとipythonについて
1
+ pyenvとipythonについて
test CHANGED
@@ -486,8 +486,6 @@
486
486
 
487
487
  ```
488
488
 
489
-
490
-
491
489
  yum -y install tkinter
492
490
 
493
491
  読み込んだプラグイン:fastestmirror, langpacks
@@ -533,3 +531,5 @@
533
531
  あと間違えてyum install ipythonとうってしまいました。
534
532
 
535
533
  大丈夫でしょうか?
534
+
535
+ 助けてください。よろしくお願いします。

28

書式の変更

2016/08/01 11:09

投稿

gik
gik

スコア152

test CHANGED
File without changes
test CHANGED
File without changes

27

書式の変更

2016/08/01 11:06

投稿

gik
gik

スコア152

test CHANGED
@@ -1 +1 @@
1
- pyenvとipythonについて
1
+ しょしきpyenvとipythonについて
test CHANGED
@@ -2,9 +2,11 @@
2
2
 
3
3
  どのようにしたらpython2.7.5にパッケージを入れて、できるようになるのでしょうか?
4
4
 
5
-
5
+ ここを見て行いました
6
+
6
-
7
+ http://pppurple.hatenablog.com/entry/2016/01/24/213645
8
+
7
- ここの部分だしてなどありましたら、掲載します。
9
+ 足りない部分などありましたら、掲載します。
8
10
 
9
11
  ipythonだけで2.7.5でできるようにしたいです。
10
12
 

26

書式の変更

2016/08/01 11:04

投稿

gik
gik

スコア152

test CHANGED
File without changes
test CHANGED
File without changes

25

書式の変更

2016/08/01 10:59

投稿

gik
gik

スコア152

test CHANGED
File without changes
test CHANGED
@@ -168,8 +168,6 @@
168
168
 
169
169
  -----------------------------------------------------
170
170
 
171
- import pandasでエラーはでなくなりました。
172
-
173
171
  今2.7.5でこれを試しにうごかしたのですが、
174
172
 
175
173
 

24

書式変更

2016/08/01 10:58

投稿

gik
gik

スコア152

test CHANGED
File without changes
test CHANGED
@@ -168,14 +168,202 @@
168
168
 
169
169
  -----------------------------------------------------
170
170
 
171
- import pandasでエラーはでなくなりました
171
+ import pandasでエラーはでなくなりました
172
-
172
+
173
- 度は
173
+ 2.7.5でこれを試しにうごかしたのですが、
174
174
 
175
175
 
176
176
 
177
177
  ```
178
178
 
179
+ import numpy as np
180
+
181
+ import matplotlib.pyplot as plt
182
+
183
+ import pandas as pd
184
+
185
+ from pandas import Series, DataFrame
186
+
187
+
188
+
189
+ from numpy.random import normal
190
+
191
+
192
+
193
+ N=10
194
+
195
+ M=[0,1,3,9]
196
+
197
+
198
+
199
+ def create_dataset(num):
200
+
201
+ dataset = DataFrame(columns=['x','y'])
202
+
203
+ for i in range(num):
204
+
205
+ x = float(i)/float(num-1)
206
+
207
+ y = np.sin(2*np.pi*x) + normal(scale=0.3)
208
+
209
+ dataset = dataset.append(Series([x,y], index=['x','y']),
210
+
211
+ ignore_index=True)
212
+
213
+ return dataset
214
+
215
+
216
+
217
+
218
+
219
+ def rms_error(dataset, f):
220
+
221
+ err = 0.0
222
+
223
+ for index, line in dataset.iterrows():
224
+
225
+ x, y = line.x, line.y
226
+
227
+ err += 0.5 * (y - f(x))**2
228
+
229
+ return np.sqrt(2 * err / len(dataset))
230
+
231
+
232
+
233
+ def resolve(dataset, m):
234
+
235
+ t = dataset.y
236
+
237
+ phi = DataFrame()
238
+
239
+ for i in range(0,m+1):
240
+
241
+ p = dataset.x**i
242
+
243
+ p.name="x**%d" % i
244
+
245
+ phi = pd.concat([phi,p], axis=1)
246
+
247
+ tmp = np.linalg.inv(np.dot(phi.T, phi))
248
+
249
+ ws = np.dot(np.dot(tmp, phi.T), t)
250
+
251
+
252
+
253
+ def f(x):
254
+
255
+ y = 0
256
+
257
+ for i, w in enumerate(ws):
258
+
259
+ y += w * (x ** i)
260
+
261
+ return y
262
+
263
+
264
+
265
+ return (f, ws)
266
+
267
+
268
+
269
+ # Main
270
+
271
+ if __name__ == '__main__':
272
+
273
+ train_set = create_dataset(N)
274
+
275
+ test_set = create_dataset(N)
276
+
277
+ df_ws = DataFrame()
278
+
279
+
280
+
281
+ fig = plt.figure()
282
+
283
+ for c, m in enumerate(M):
284
+
285
+ f, ws = resolve(train_set, m)
286
+
287
+ df_ws = df_ws.append(Series(ws,name="M=%d" % m))
288
+
289
+
290
+
291
+ subplot = fig.add_subplot(2,2,c+1)
292
+
293
+ subplot.set_xlim(-0.05,1.05)
294
+
295
+ subplot.set_ylim(-1.5,1.5)
296
+
297
+ subplot.set_title("M=%d" % m)
298
+
299
+
300
+
301
+
302
+
303
+ subplot.scatter(train_set.x, train_set.y, marker='o', color='blue')
304
+
305
+
306
+
307
+ linex = np.linspace(0,1,101)
308
+
309
+ liney = np.sin(2*np.pi*linex)
310
+
311
+ subplot.plot(linex, liney, color='green', linestyle='--')
312
+
313
+
314
+
315
+
316
+
317
+ linex = np.linspace(0,1,101)
318
+
319
+ liney = f(linex)
320
+
321
+ label = "E(RMS)=%.2f" % rms_error(train_set, f)
322
+
323
+ subplot.plot(linex, liney, color='red', label=label)
324
+
325
+ subplot.legend(loc=1)
326
+
327
+
328
+
329
+
330
+
331
+ print "Table of the coefficients"
332
+
333
+ print df_ws.transpose()
334
+
335
+ fig.show()
336
+
337
+
338
+
339
+ df = DataFrame(columns=['Training set','Test set'])
340
+
341
+ for m in range(0,10): # 多項式の次数
342
+
343
+ f, ws = resolve(train_set, m)
344
+
345
+ train_error = rms_error(train_set, f)
346
+
347
+ test_error = rms_error(test_set, f)
348
+
349
+ df = df.append(
350
+
351
+ Series([train_error, test_error],
352
+
353
+ index=['Training set','Test set']),
354
+
355
+ ignore_index=True)
356
+
357
+ df.plot(title='RMS Error', style=['-','--'], grid=True, ylim=(0,0.9))
358
+
359
+ plt.show()
360
+
361
+ ```
362
+
363
+ 以下のようなエラーがでます。
364
+
365
+ ```
366
+
179
367
  ImportError Traceback (most recent call last)
180
368
 
181
369
  /root/ml4se/scripts/02-square_error.py in <module>()
@@ -298,6 +486,8 @@
298
486
 
299
487
  ```
300
488
 
489
+
490
+
301
491
  yum -y install tkinter
302
492
 
303
493
  読み込んだプラグイン:fastestmirror, langpacks
@@ -334,6 +524,12 @@
334
524
 
335
525
 
336
526
 
527
+ もう一度 pyenv uninstall 2.7.5
528
+
529
+ して再度インストールしたほうがいいのでしょうか?
530
+
531
+
532
+
337
533
  あと間違えてyum install ipythonとうってしまいました。
338
534
 
339
535
  大丈夫でしょうか?

23

書式の変更

2016/08/01 10:57

投稿

gik
gik

スコア152

test CHANGED
File without changes
test CHANGED
@@ -42,8 +42,6 @@
42
42
 
43
43
 
44
44
 
45
-
46
-
47
45
  で2.7.5は
48
46
 
49
47
  pyenv versions
@@ -168,226 +166,156 @@
168
166
 
169
167
 
170
168
 
169
+ -----------------------------------------------------
170
+
171
+ import pandasでエラーはでなくなりましたが
172
+
173
+ 今度は
174
+
175
+
176
+
171
177
  ```
172
178
 
173
- In [2]: import panda
174
-
175
- ImportError Traceback (most recent call last)
179
+ ImportError Traceback (most recent call last)
176
-
180
+
177
- <ipython-input-2-908607987b94> in <module>()
181
+ /root/ml4se/scripts/02-square_error.py in <module>()
182
+
178
-
183
+ 7
184
+
185
+ 8 import numpy as np
186
+
187
+ ----> 9 import matplotlib.pyplot as plt
188
+
189
+ 10 import pandas as pd
190
+
191
+ 11 from pandas import Series, DataFrame
192
+
193
+
194
+
195
+ /root/.local/lib/python2.7/site-packages/matplotlib/pyplot.py in <module>()
196
+
197
+ 112
198
+
199
+ 113 from matplotlib.backends import pylab_setup
200
+
201
+ --> 114 _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
202
+
203
+ 115
204
+
205
+ 116 _IP_REGISTERED = None
206
+
207
+
208
+
209
+ /root/.local/lib/python2.7/site-packages/matplotlib/backends/__init__.pyc in pylab_setup()
210
+
211
+ 30 # imports. 0 means only perform absolute imports.
212
+
213
+ 31 backend_mod = __import__(backend_name,
214
+
215
+ ---> 32 globals(),locals(),[backend_name],0)
216
+
217
+ 33
218
+
219
+ 34 # Things we pull in from all backends
220
+
221
+
222
+
223
+ /root/.local/lib/python2.7/site-packages/matplotlib/backends/backend_tkagg.py in <module>()
224
+
225
+ 4
226
+
227
+ 5 import six
228
+
229
+ ----> 6 from six.moves import tkinter as Tk
230
+
231
+ 7 from six.moves import tkinter_filedialog as FileDialog
232
+
233
+ 8
234
+
235
+
236
+
237
+ /root/.local/lib/python2.7/site-packages/six.pyc in load_module(self, fullname)
238
+
239
+ 201 mod = self.__get_module(fullname)
240
+
241
+ 202 if isinstance(mod, MovedModule):
242
+
243
+ --> 203 mod = mod._resolve()
244
+
245
+ 204 else:
246
+
247
+ 205 mod.__loader__ = self
248
+
249
+
250
+
251
+ /root/.local/lib/python2.7/site-packages/six.pyc in _resolve(self)
252
+
253
+ 113
254
+
255
+ 114 def _resolve(self):
256
+
257
+ --> 115 return _import_module(self.mod)
258
+
259
+ 116
260
+
261
+ 117 def __getattr__(self, attr):
262
+
263
+
264
+
265
+ /root/.local/lib/python2.7/site-packages/six.pyc in _import_module(name)
266
+
267
+ 80 def _import_module(name):
268
+
269
+ 81 """Import module, returning the module after the last dot."""
270
+
179
- ----> 1 import panda
271
+ ---> 82 __import__(name)
272
+
180
-
273
+ 83 return sys.modules[name]
274
+
275
+ 84
276
+
277
+
278
+
279
+ /root/.pyenv/versions/2.7.5/lib/python2.7/lib-tk/Tkinter.py in <module>()
280
+
281
+ 37 # Attempt to configure Tcl/Tk without requiring PATH
282
+
283
+ 38 import FixTk
284
+
285
+ ---> 39 import _tkinter # If this fails your Python may not be configured for Tk
286
+
287
+ 40 tkinter = _tkinter # b/w compat for export
288
+
289
+ 41 TclError = _tkinter.TclError
290
+
291
+
292
+
181
- ImportError: No module named panda
293
+ ImportError: No module named _tkinter
182
294
 
183
295
  ```
184
296
 
185
-
186
-
187
- pythonとうっ
297
+ tkinterに関し
188
-
189
- import pandaはエラーでませんでした。
190
-
191
-
192
298
 
193
299
  ```
194
300
 
195
- pip install ipython
196
-
197
- Requirement already satisfied (use --upgrade to upgrade): ipython in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages
198
-
199
- Requirement already satisfied (use --upgrade to upgrade): traitlets>=4.2 in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from ipython)
200
-
201
- Requirement already satisfied (use --upgrade to upgrade): pickleshare in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from ipython)
202
-
203
- Requirement already satisfied (use --upgrade to upgrade): backports.shutil-get-terminal-size; python_version == "2.7" in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from ipython)
204
-
205
- Requirement already satisfied (use --upgrade to upgrade): setuptools>=18.5 in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from ipython)
206
-
207
- Requirement already satisfied (use --upgrade to upgrade): pygments in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from ipython)
208
-
209
- Requirement already satisfied (use --upgrade to upgrade): pathlib2; python_version == "2.7" or python_version == "3.3" in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from ipython)
210
-
211
- Requirement already satisfied (use --upgrade to upgrade): pexpect; sys_platform != "win32" in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from ipython)
212
-
213
- Requirement already satisfied (use --upgrade to upgrade): simplegeneric>0.8 in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from ipython)
214
-
215
- Requirement already satisfied (use --upgrade to upgrade): decorator in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from ipython)
216
-
217
- Requirement already satisfied (use --upgrade to upgrade): prompt-toolkit<2.0.0,>=1.0.3 in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from ipython)
218
-
219
- Requirement already satisfied (use --upgrade to upgrade): ipython-genutils in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from traitlets>=4.2->ipython)
220
-
221
- Requirement already satisfied (use --upgrade to upgrade): six in ./.local/lib/python2.7/site-packages (from pathlib2; python_version == "2.7" or python_version == "3.3"->ipython)
222
-
223
- Requirement already satisfied (use --upgrade to upgrade): ptyprocess>=0.5 in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from pexpect; sys_platform != "win32"->ipython)
224
-
225
- Requirement already satisfied (use --upgrade to upgrade): wcwidth in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from prompt-toolkit<2.0.0,>=1.0.3->ipython)
226
-
227
- [root@ichioka ~]# pip install ipython
228
-
229
- Requirement already satisfied (use --upgrade to upgrade): ipython in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages
230
-
231
- Requirement already satisfied (use --upgrade to upgrade): traitlets>=4.2 in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from ipython)
232
-
233
- Requirement already satisfied (use --upgrade to upgrade): pickleshare in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from ipython)
234
-
235
- Requiremeimport pandant already satisfied (use --upgrade to upgrade): backports.shutil-get-terminal-size; python_version == "2.7" in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from ipython)
236
-
237
- Requirement already satisfied (use --upgrade to upgrade): setuptools>=18.5 in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from ipython)
238
-
239
- Requirement already satisfied (use --upgrade to upgrade): pygments in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from ipython)
240
-
241
- Requirement already satisfied (use --upgrade to upgrade): pathlib2; python_version == "2.7" or python_version == "3.3" in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from ipython)
242
-
243
- Requirement already satisfied (use --upgrade to upgrade): pexpect; sys_platform != "win32" in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from ipython)
244
-
245
- Requirement already satisfied (use --upgrade to upgrade): simplegeneric>0.8 in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from ipython)
246
-
247
- Requirement already satisfied (use --upgrade to upgrade): decorator in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from ipython)
248
-
249
- Requirement already satisfied (use --upgrade to upgrade): prompt-toolkit<2.0.0,>=1.0.3 in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from ipython)
250
-
251
- Requirement already satisfied (use --upgrade to upgrade): ipython-genutils in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from traitlets>=4.2->ipython)
252
-
253
- Requirement already satisfied (use --upgrade to upgrade): six in ./.local/lib/python2.7/site-packages (from pathlib2; python_version == "2.7" or python_version == "3.3"->ipython)
254
-
255
- Requirement already satisfied (use --upgrade to upgrade): ptyprocess>=0.5 in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from pexpect; sys_platform != "win32"->ipython)
256
-
257
- Requirement already satisfied (use --upgrade to upgrade): wcwidth in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from prompt-toolkit<2.0.0,>=1.0.3->ipython)
301
+ yum -y install tkinter
302
+
303
+ 読み込んだプラグイン:fastestmirror, langpacks
304
+
305
+ Loading mirror speeds from cached hostfile
306
+
307
+ * base: ftp.iij.ad.jp
308
+
309
+ * epel: ftp.riken.jp
310
+
311
+ * extras: ftp.iij.ad.jp
312
+
313
+ * updates: ftp.iij.ad.jp
314
+
315
+ パッケージ tkinter-2.7.5-34.el7.x86_64 はインストール済みか最新バージョンです何もしません
258
316
 
259
317
  ```
260
318
 
261
-
262
-
263
- -----------------------------------------------------
264
-
265
- import pandasでエラーはでなくなりましたが
266
-
267
- 今度は
268
-
269
- ```
270
-
271
- ImportError Traceback (most recent call last)
272
-
273
- /root/ml4se/scripts/02-square_error.py in <module>()
274
-
275
- 7
276
-
277
- 8 import numpy as np
278
-
279
- ----> 9 import matplotlib.pyplot as plt
280
-
281
- 10 import pandas as pd
282
-
283
- 11 from pandas import Series, DataFrame
284
-
285
-
286
-
287
- /root/.local/lib/python2.7/site-packages/matplotlib/pyplot.py in <module>()
288
-
289
- 112
290
-
291
- 113 from matplotlib.backends import pylab_setup
292
-
293
- --> 114 _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
294
-
295
- 115
296
-
297
- 116 _IP_REGISTERED = None
298
-
299
-
300
-
301
- /root/.local/lib/python2.7/site-packages/matplotlib/backends/__init__.pyc in pylab_setup()
302
-
303
- 30 # imports. 0 means only perform absolute imports.
304
-
305
- 31 backend_mod = __import__(backend_name,
306
-
307
- ---> 32 globals(),locals(),[backend_name],0)
308
-
309
- 33
310
-
311
- 34 # Things we pull in from all backends
312
-
313
-
314
-
315
- /root/.local/lib/python2.7/site-packages/matplotlib/backends/backend_tkagg.py in <module>()
316
-
317
- 4
318
-
319
- 5 import six
320
-
321
- ----> 6 from six.moves import tkinter as Tk
322
-
323
- 7 from six.moves import tkinter_filedialog as FileDialog
324
-
325
- 8
326
-
327
-
328
-
329
- /root/.local/lib/python2.7/site-packages/six.pyc in load_module(self, fullname)
330
-
331
- 201 mod = self.__get_module(fullname)
332
-
333
- 202 if isinstance(mod, MovedModule):
334
-
335
- --> 203 mod = mod._resolve()
336
-
337
- 204 else:
338
-
339
- 205 mod.__loader__ = self
340
-
341
-
342
-
343
- /root/.local/lib/python2.7/site-packages/six.pyc in _resolve(self)
344
-
345
- 113
346
-
347
- 114 def _resolve(self):
348
-
349
- --> 115 return _import_module(self.mod)
350
-
351
- 116
352
-
353
- 117 def __getattr__(self, attr):
354
-
355
-
356
-
357
- /root/.local/lib/python2.7/site-packages/six.pyc in _import_module(name)
358
-
359
- 80 def _import_module(name):
360
-
361
- 81 """Import module, returning the module after the last dot."""
362
-
363
- ---> 82 __import__(name)
364
-
365
- 83 return sys.modules[name]
366
-
367
- 84
368
-
369
-
370
-
371
- /root/.pyenv/versions/2.7.5/lib/python2.7/lib-tk/Tkinter.py in <module>()
372
-
373
- 37 # Attempt to configure Tcl/Tk without requiring PATH
374
-
375
- 38 import FixTk
376
-
377
- ---> 39 import _tkinter # If this fails your Python may not be configured for Tk
378
-
379
- 40 tkinter = _tkinter # b/w compat for export
380
-
381
- 41 TclError = _tkinter.TclError
382
-
383
-
384
-
385
- ImportError: No module named _tkinter
386
-
387
- ```
388
-
389
- tkinterに関しては
390
-
391
319
  yum install tk tcl tk-devel
392
320
 
393
321
  yum install openssl openssl-devel

22

書式の変更

2016/07/31 16:19

投稿

gik
gik

スコア152

test CHANGED
File without changes
test CHANGED
@@ -262,9 +262,9 @@
262
262
 
263
263
  -----------------------------------------------------
264
264
 
265
- import pandasエラーはでなくなりましたが
265
+ import pandasエラーはでなくなりましたが
266
+
266
-
267
+ 今度は
267
-
268
268
 
269
269
  ```
270
270
 
@@ -400,7 +400,7 @@
400
400
 
401
401
  なにがいけないのでしょうか?
402
402
 
403
- ほかにこういう方法でpython2.7.5と3.5.1で動かす方法も
403
+ ほかにもしこういう方法でpython2.7.5と3.5.1で動かす方法も
404
404
 
405
405
  あれば教えてください
406
406
 

21

書式の変更

2016/07/31 16:11

投稿

gik
gik

スコア152

test CHANGED
@@ -1 +1 @@
1
- 与式pyenvとipythonについて
1
+ pyenvとipythonについて
test CHANGED
File without changes

20

書式

2016/07/31 16:00

投稿

gik
gik

スコア152

test CHANGED
@@ -1 +1 @@
1
- pyenvとipythonについて
1
+ 与式pyenvとipythonについて
test CHANGED
@@ -386,9 +386,17 @@
386
386
 
387
387
  ```
388
388
 
389
-
389
+ tkinterに関しては
390
+
390
-
391
+ yum install tk tcl tk-devel
392
+
393
+ yum install openssl openssl-devel
394
+
395
+ yum search tkinter
396
+
397
+ yum install python2-tktable.x86_64
398
+
391
- でま
399
+ 行ったのすがた出ました
392
400
 
393
401
  なにがいけないのでしょうか?
394
402
 

19

書式の改善

2016/07/31 15:52

投稿

gik
gik

スコア152

test CHANGED
File without changes
test CHANGED
@@ -392,6 +392,10 @@
392
392
 
393
393
  なにがいけないのでしょうか?
394
394
 
395
+ ほかにこういう方法でpython2.7.5と3.5.1で動かす方法も
396
+
397
+ あれば教えてください
398
+
395
399
 
396
400
 
397
401
  あと間違えてyum install ipythonとうってしまいました。

18

書式の変更

2016/07/31 15:45

投稿

gik
gik

スコア152

test CHANGED
File without changes
test CHANGED
@@ -232,7 +232,7 @@
232
232
 
233
233
  Requirement already satisfied (use --upgrade to upgrade): pickleshare in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from ipython)
234
234
 
235
- Requirement already satisfied (use --upgrade to upgrade): backports.shutil-get-terminal-size; python_version == "2.7" in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from ipython)
235
+ Requiremeimport pandant already satisfied (use --upgrade to upgrade): backports.shutil-get-terminal-size; python_version == "2.7" in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from ipython)
236
236
 
237
237
  Requirement already satisfied (use --upgrade to upgrade): setuptools>=18.5 in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from ipython)
238
238
 
@@ -260,6 +260,134 @@
260
260
 
261
261
 
262
262
 
263
+ -----------------------------------------------------
264
+
265
+ import pandasデエラーはでなくなりましたが
266
+
267
+
268
+
269
+ ```
270
+
271
+ ImportError Traceback (most recent call last)
272
+
273
+ /root/ml4se/scripts/02-square_error.py in <module>()
274
+
275
+ 7
276
+
277
+ 8 import numpy as np
278
+
279
+ ----> 9 import matplotlib.pyplot as plt
280
+
281
+ 10 import pandas as pd
282
+
283
+ 11 from pandas import Series, DataFrame
284
+
285
+
286
+
287
+ /root/.local/lib/python2.7/site-packages/matplotlib/pyplot.py in <module>()
288
+
289
+ 112
290
+
291
+ 113 from matplotlib.backends import pylab_setup
292
+
293
+ --> 114 _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
294
+
295
+ 115
296
+
297
+ 116 _IP_REGISTERED = None
298
+
299
+
300
+
301
+ /root/.local/lib/python2.7/site-packages/matplotlib/backends/__init__.pyc in pylab_setup()
302
+
303
+ 30 # imports. 0 means only perform absolute imports.
304
+
305
+ 31 backend_mod = __import__(backend_name,
306
+
307
+ ---> 32 globals(),locals(),[backend_name],0)
308
+
309
+ 33
310
+
311
+ 34 # Things we pull in from all backends
312
+
313
+
314
+
315
+ /root/.local/lib/python2.7/site-packages/matplotlib/backends/backend_tkagg.py in <module>()
316
+
317
+ 4
318
+
319
+ 5 import six
320
+
321
+ ----> 6 from six.moves import tkinter as Tk
322
+
323
+ 7 from six.moves import tkinter_filedialog as FileDialog
324
+
325
+ 8
326
+
327
+
328
+
329
+ /root/.local/lib/python2.7/site-packages/six.pyc in load_module(self, fullname)
330
+
331
+ 201 mod = self.__get_module(fullname)
332
+
333
+ 202 if isinstance(mod, MovedModule):
334
+
335
+ --> 203 mod = mod._resolve()
336
+
337
+ 204 else:
338
+
339
+ 205 mod.__loader__ = self
340
+
341
+
342
+
343
+ /root/.local/lib/python2.7/site-packages/six.pyc in _resolve(self)
344
+
345
+ 113
346
+
347
+ 114 def _resolve(self):
348
+
349
+ --> 115 return _import_module(self.mod)
350
+
351
+ 116
352
+
353
+ 117 def __getattr__(self, attr):
354
+
355
+
356
+
357
+ /root/.local/lib/python2.7/site-packages/six.pyc in _import_module(name)
358
+
359
+ 80 def _import_module(name):
360
+
361
+ 81 """Import module, returning the module after the last dot."""
362
+
363
+ ---> 82 __import__(name)
364
+
365
+ 83 return sys.modules[name]
366
+
367
+ 84
368
+
369
+
370
+
371
+ /root/.pyenv/versions/2.7.5/lib/python2.7/lib-tk/Tkinter.py in <module>()
372
+
373
+ 37 # Attempt to configure Tcl/Tk without requiring PATH
374
+
375
+ 38 import FixTk
376
+
377
+ ---> 39 import _tkinter # If this fails your Python may not be configured for Tk
378
+
379
+ 40 tkinter = _tkinter # b/w compat for export
380
+
381
+ 41 TclError = _tkinter.TclError
382
+
383
+
384
+
385
+ ImportError: No module named _tkinter
386
+
387
+ ```
388
+
389
+
390
+
263
391
  とでます。
264
392
 
265
393
  なにがいけないのでしょうか?

17

書式

2016/07/31 15:37

投稿

gik
gik

スコア152

test CHANGED
File without changes
test CHANGED
@@ -262,7 +262,7 @@
262
262
 
263
263
  とでます。
264
264
 
265
- なにが足りないのでしょうか?
265
+ なにがいけないのでしょうか?
266
266
 
267
267
 
268
268
 

16

書式

2016/07/31 13:13

投稿

gik
gik

スコア152

test CHANGED
File without changes
test CHANGED
@@ -62,8 +62,6 @@
62
62
 
63
63
 
64
64
 
65
- ```
66
-
67
65
  pip freeze
68
66
 
69
67
  backports-abc==0.4
@@ -192,6 +190,8 @@
192
190
 
193
191
 
194
192
 
193
+ ```
194
+
195
195
  pip install ipython
196
196
 
197
197
  Requirement already satisfied (use --upgrade to upgrade): ipython in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages
@@ -256,8 +256,16 @@
256
256
 
257
257
  Requirement already satisfied (use --upgrade to upgrade): wcwidth in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from prompt-toolkit<2.0.0,>=1.0.3->ipython)
258
258
 
259
+ ```
260
+
259
261
 
260
262
 
261
263
  とでます。
262
264
 
263
265
  なにが足りないのでしょうか?
266
+
267
+
268
+
269
+ あと間違えてyum install ipythonとうってしまいました。
270
+
271
+ 大丈夫でしょうか?

15

書式

2016/07/31 13:10

投稿

gik
gik

スコア152

test CHANGED
@@ -1 +1 @@
1
- pyenvとpycharmについて
1
+ pyenvとipythonについて
test CHANGED
@@ -1,525 +1,263 @@
1
- cent os7でpythonを機械学習でつかっておりま
1
+ cent os7でpyenv使い3.5.1と2.7.5を両方つかいたいで
2
-
2
+
3
- python2.7.5とPython 3.5.1両方機械学習プログラムを書きたく
3
+ どのようにしたらpython2.7.5にパッケージを入れて、きるようになるでしょうか?
4
+
5
+
6
+
4
-
7
+ ここの部分だしてなどありましたら、掲載します。
8
+
5
- pyenv+pycharmを入れました
9
+ ipythonだけで2.7.5でできるようにしたいです
10
+
6
-
11
+ よろしくお願いします。
12
+
13
+
14
+
7
- pyenvで
15
+ 3.5.1は
16
+
17
+ python --version
18
+
19
+ Python 3.5.1
20
+
21
+ pip freeze
22
+
23
+ cycler==0.10.0
24
+
25
+ matplotlib==1.5.1
26
+
27
+ numpy==1.11.1
28
+
29
+ pandas==0.18.1
30
+
31
+ pyparsing==2.1.5
32
+
33
+ python-dateutil==2.5.3
34
+
35
+ pytz==2016.6.1
36
+
37
+ scikit-learn==0.17.1
38
+
39
+ scipy==0.18.0
40
+
41
+ six==1.10.0
42
+
43
+
44
+
45
+
46
+
47
+ で2.7.5は
8
48
 
9
49
  pyenv versions
10
50
 
51
+ - system
52
+
11
- * system (set by /root/.pyenv/version)
53
+ - * 2.7.5 (set by /root/.pyenv/version)
12
-
13
- 2.7.5
54
+
14
-
15
- 3.5.1
55
+ - 3.5.1
16
-
56
+
57
+
58
+
17
- とでるようになり
59
+ pip install --upgrade pip
60
+
61
+ Requirement already up-to-date: pip in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages
18
62
 
19
63
 
20
64
 
21
65
  ```
22
66
 
23
- []# python --version
24
-
25
- Python 2.7.5
26
-
27
- []#pip freeze
28
-
29
- Exception:
30
-
31
- Traceback (most recent call last):
32
-
33
- File "/usr/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
34
-
35
- status = self.run(options, args)
36
-
37
- File "/usr/lib/python2.7/site-packages/pip/commands/freeze.py", line 85, in run
38
-
39
- for line in freeze(**freeze_kwargs):
40
-
41
- File "/usr/lib/python2.7/site-packages/pip/operations/freeze.py", line 47, in freeze
42
-
43
- dependency_links
44
-
45
- File "/usr/lib/python2.7/site-packages/pip/__init__.py", line 264, in from_dist
46
-
47
- req = dist.as_requirement()
48
-
49
- File "/usr/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2562, in as_requirement
50
-
51
- return Requirement.parse(spec)
52
-
53
- File "/usr/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2833, in parse
54
-
55
- req, = parse_requirements(s)
56
-
57
- File "/usr/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2781, in parse_requirements
58
-
59
- yield Requirement(line)
60
-
61
- File "/usr/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2790, in __init__
62
-
63
- raise RequirementParseError(str(e))
64
-
65
- RequirementParseError: Invalid requirement, parse error at "'-ipap11h'"
67
+ pip freeze
68
+
69
+ backports-abc==0.4
70
+
71
+ backports.shutil-get-terminal-size==1.0.0
72
+
73
+ backports.ssl-match-hostname==3.5.0.1
74
+
75
+ certifi==2016.2.28
76
+
77
+ configparser==3.5.0
78
+
79
+ cycler==0.10.0
80
+
81
+ Cython==0.24.1
82
+
83
+ decorator==4.0.10
84
+
85
+ entrypoints==0.2.2
86
+
87
+ functools32==3.2.3.post2
88
+
89
+ ipykernel==4.3.1
90
+
91
+ ipython==5.0.0
92
+
93
+ ipython-genutils==0.1.0
94
+
95
+ ipywidgets==5.2.2
96
+
97
+ Jinja2==2.8
98
+
99
+ jsonschema==2.5.1
100
+
101
+ jupyter==1.0.0
102
+
103
+ jupyter-client==4.3.0
104
+
105
+ jupyter-console==5.0.0
106
+
107
+ jupyter-core==4.1.0
108
+
109
+ MarkupSafe==0.23
110
+
111
+ matplotlib==2.0.0b3
112
+
113
+ mistune==0.7.3
114
+
115
+ nbconvert==4.2.0
116
+
117
+ nbformat==4.0.1
118
+
119
+ notebook==4.2.1
120
+
121
+ numpy==1.11.1
122
+
123
+ pandas==0.18.1
124
+
125
+ pathlib2==2.1.0
126
+
127
+ pexpect==4.2.0
128
+
129
+ pickleshare==0.7.3
130
+
131
+ prompt-toolkit==1.0.3
132
+
133
+ ptyprocess==0.5.1
134
+
135
+ pydot==1.2.2
136
+
137
+ Pygments==2.1.3
138
+
139
+ pyparsing==2.1.5
140
+
141
+ python-dateutil==2.5.3
142
+
143
+ pytz==2016.6.1
144
+
145
+ pyzmq==15.3.0
146
+
147
+ qtconsole==4.2.1
148
+
149
+ scikit-learn==0.17.1
150
+
151
+ scipy==0.18.0
152
+
153
+ simplegeneric==0.8.1
154
+
155
+ singledispatch==3.4.0.3
156
+
157
+ six==1.10.0
158
+
159
+ subprocess32==3.2.7
160
+
161
+ terminado==0.6
162
+
163
+ tornado==4.4.1
164
+
165
+ traitlets==4.2.2
166
+
167
+ wcwidth==0.1.7
168
+
169
+ widgetsnbextension==1.2.6
170
+
171
+
66
172
 
67
173
  ```
68
174
 
175
+ In [2]: import panda
176
+
177
+ ImportError Traceback (most recent call last)
178
+
179
+ <ipython-input-2-908607987b94> in <module>()
180
+
181
+ ----> 1 import panda
182
+
69
- python2.7.5でコードをかきたい場合パッケージがはいりません
183
+ ImportError: No module named panda
70
-
71
- ipythonでも
72
184
 
73
185
  ```
74
186
 
75
- ImportError Traceback (most recent call last)
76
-
77
- /root/setup/gen_webstats.py in <module>()
78
-
79
- 10
80
-
81
- 11 import os
82
-
83
- ---> 12 import scipy as sp
84
-
85
- 13 from scipy.stats import gamma
86
-
87
- 14 import matplotlib.pyplot as plt
88
-
89
- ImportError: No module named scipy
90
-
91
- ```
92
-
93
-
94
-
95
- でます。
96
-
97
- またpycharmでは
98
-
99
- パッケージをインストールしようとすると
100
-
101
-
102
-
103
- ```
104
-
105
- Could not find platform dependent libraries <exec_prefix>
106
-
107
- Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
108
-
109
- Traceback (most recent call last):
110
-
111
- File "/opt/pycharm/pycharm-community-2016.2/helpers/packaging_tool.py", line 190, in main
112
-
113
- retcode = do_untar(name)
114
-
115
- File "/opt/pycharm/pycharm-community-2016.2/helpers/packaging_tool.py", line 129, in
116
-
117
- do_untar
118
-
119
- import tempfile
120
-
121
- File "/root/.pyenv/versions/2.7.5/lib/python2.7/tempfile.py", line 32, in <module>
122
-
123
- import io as _io
124
-
125
- File "/root/.pyenv/versions/2.7.5/lib/python2.7/io.py", line 51, in <module>
126
-
127
- import _io
128
-
129
- ImportError: No module named _io
130
-
131
- ```
132
-
133
-
134
-
135
- がでます。
136
-
137
- どのようにしたらpython2.7.5にパッケージを入れて、できるようになるのでしょうか?
138
-
139
-
140
-
141
- ここの部分だしてなどありましたら、掲載します。
142
-
143
- ipythonだけでも2.7.5でできるようにしたいです。
144
-
145
- よろしくお願いします。
146
-
147
- --------------------------------------------------------------
148
-
149
- 昨日もしかして別個にptythonもパッケージをインストールしなくてはいけないのか思い
150
-
151
- pyenv install 2.75をインストール
152
-
153
- pip install --upgrade pip
154
-
155
-
156
-
157
- その後機械学習のライブラリーをインストールして
158
-
159
- ここまでいきました
160
-
161
- pip freeze
162
-
163
- cycler==0.10.0
164
-
165
- functools32==3.2.3.post2
166
-
167
- matplotlib==2.0.0b3
168
-
169
- numpy==1.11.1
170
-
171
- pyparsing==2.1.5
172
-
173
- python-dateutil==2.5.3
174
-
175
- pytz==2016.6.1
176
-
177
- scikit-learn==0.17.1
178
-
179
- scipy==0.18.0
180
-
181
- six==1.10.0
182
-
183
- subprocess32==3.2.7
184
-
185
-
186
-
187
- pip uninstall _ipap11helper
188
-
189
- をおこなったところ
190
-
191
- ```
192
-
193
- Invalid requirement: '_ipap11helper'
194
-
195
- Traceback (most recent call last):
196
-
197
- File "/root/.pyenv/versions/2.7.5/lib/python2.7/site-packages/pip/req/req_install.py", line 78, in __init__
198
-
199
- req = Requirement(req)
200
-
201
- File "/root/.pyenv/versions/2.7.5/lib/python2.7/site-packages/pip/_vendor/packaging/requirements.py", line 96, in __init__
202
-
203
- requirement_string[e.loc:e.loc + 8]))
204
-
205
- InvalidRequirement: Invalid requirement, parse error at "'_ipap11h'"
206
-
207
- ```
208
-
209
-
210
-
211
- 再度
212
-
213
- pip install --upgrade pip
214
-
215
- Requirement already up-to-date: pip in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages
216
-
217
-
218
-
219
- pyenv versions
220
-
221
- - system
222
-
223
- - * 2.7.5 (set by /root/.pyenv/version)
224
-
225
- - 3.5.1
226
-
227
-
228
-
229
- pip install --upgrade pip
230
-
231
- Requirement already up-to-date: pip in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages
232
-
233
-
234
-
235
- pip freeze
236
-
237
- cycler==0.10.0
238
-
239
- functools32==3.2.3.post2
240
-
241
- matplotlib==2.0.0b3
242
-
243
- numpy==1.11.1
244
-
245
- pyparsing==2.1.5
246
-
247
- python-dateutil==2.5.3
248
-
249
- pytz==2016.6.1
250
-
251
- scikit-learn==0.17.1
252
-
253
- scipy==0.18.0
254
-
255
- six==1.10.0
256
-
257
- subprocess32==3.2.7
258
-
259
-
260
-
261
- で、python2.7のソースコードで
262
-
263
-
264
-
265
- ```
266
-
267
- Traceback (most recent call last)
268
-
269
- /root/setup/ml4se/scripts/02-square_error.py in <module>()
270
-
271
- 7
272
-
273
- 8 import numpy as np
274
-
275
- ----> 9 import matplotlib.pyplot as plt
276
-
277
- 10 import pandas as pd
278
-
279
- 11 from pandas import Series, DataFrame
280
-
281
- /root/.local/lib/python2.7/site-packages/matplotlib/pyplot.py in <module>()
282
-
283
- 112
284
-
285
- 113 from matplotlib.backends import pylab_setup
286
-
287
- --> 114 _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
288
-
289
- 115
290
-
291
- 116 _IP_REGISTERED = None
292
-
293
- /root/.local/lib/python2.7/site-packages/matplotlib/backends/__init__.pyc in pylab_setup()
294
-
295
- 30 # imports. 0 means only perform absolute imports.
296
-
297
- 31 backend_mod = __import__(backend_name,
298
-
299
- ---> 32 globals(),locals(),[backend_name],0)
300
-
301
- 33
302
-
303
- 34 # Things we pull in from all backends
304
-
305
- /root/.local/lib/python2.7/site-packages/matplotlib/backends/backend_tkagg.py in <module>()
306
-
307
- 4
308
-
309
- 5 import six
310
-
311
- ----> 6 from six.moves import tkinter as Tk
312
-
313
- 7 from six.moves import tkinter_filedialog as FileDialog
314
-
315
- 8
316
-
317
- /root/.local/lib/python2.7/site-packages/six.pyc in load_module(self, fullname)
318
-
319
- 201 mod = self.__get_module(fullname)
320
-
321
- 202 if isinstance(mod, MovedModule):
322
-
323
- --> 203 mod = mod._resolve()
324
-
325
- 204 else:
326
-
327
- 205 mod.__loader__ = self
328
-
329
- /root/.local/lib/python2.7/site-packages/six.pyc in _resolve(self)
330
-
331
- 113
332
-
333
- 114 def _resolve(self):
334
-
335
- --> 115 return _import_module(self.mod)
336
-
337
- 116
338
-
339
- 117 def __getattr__(self, attr):
340
-
341
- /root/.local/lib/python2.7/site-packages/six.pyc in _import_module(name)
342
-
343
- 80 def _import_module(name):
344
-
345
- 81 """Import module, returning the module after the last dot."""
346
-
347
- ---> 82 __import__(name)
348
-
349
- 83 return sys.modules[name]
350
-
351
- 84
352
-
353
- ImportError: No module named Tkinter`
354
-
355
- ```
356
-
357
-
358
-
359
- pip install matplotlib
360
-
361
- ```
362
-
363
- Requirement already satisfied (use --upgrade to upgrade): matplotlib in ./.local/lib/python2.7/site-packages
364
-
365
- Requirement already satisfied (use --upgrade to upgrade): python-dateutil in ./.local/lib/python2.7/site-packages (from matplotlib)
366
-
367
- Requirement already satisfied (use --upgrade to upgrade): pyparsing!=2.0.0,!=2.0.4,!=2.1.2,>=1.5.6 in ./.local/lib/python2.7/site-packages (from matplotlib)
368
-
369
- Requirement already satisfied (use --upgrade to upgrade): pytz in ./.local/lib/python2.7/site-packages (from matplotlib)
370
-
371
- Requirement already satisfied (use --upgrade to upgrade): six>=1.10 in ./.local/lib/python2.7/site-packages (from matplotlib)
372
-
373
- Requirement already satisfied (use --upgrade to upgrade): functools32 in ./.local/lib/python2.7/site-packages (from matplotlib)
374
-
375
- Requirement already satisfied (use --upgrade to upgrade): numpy>=1.6 in ./.local/lib/python2.7/site-packages (from matplotlib)
376
-
377
- Requirement already satisfied (use --upgrade to upgrade): cycler>=0.10 in ./.local/lib/python2.7/site-packages (from matplotlib)
378
-
379
- Requirement already satisfied (use --upgrade to upgrade): subprocess32 in ./.local/lib/python2.7/site-packages (from matplotlib)`
380
-
381
- ```
382
-
383
- とでます
384
-
385
- どうしたらいいでしょうか?
386
-
387
- なにかたりないのでしょうか?
388
-
389
- 教えてください。よろしくお願いします
390
-
391
-
392
-
393
- --------------------------------------------------------------
394
-
395
- Tkinterについてですが
396
-
397
- yum install Tkinter
398
-
399
- yum install python -tk
400
-
401
- yum install tk tcl tk-devel
402
-
403
- yum install openssl openssl-devel
404
-
405
- yum install python2-tktable.x86_64
406
-
407
- 行ったところ
408
-
409
-
410
-
411
- from six.moves import tkinter as Tk
412
-
413
- のエラーはなくなりましたがありがとうございます
414
-
415
-
416
-
417
- 今度は
418
-
419
- ```
420
-
421
- ImportError Traceback (most recent call last)
422
-
423
- /root/setup/ml4se/scripts/02-square_error.py in <module>()
424
-
425
- 8 import numpy as np
426
-
427
- 9 import matplotlib.pyplot as plt
428
-
429
- ---> 10 import pandas as pd
430
-
431
- 11 from pandas import Series, DataFrame
432
-
433
- 12
434
-
435
- ImportError: No module named pandas
436
-
437
- In [4]: No module named pandas
438
-
439
- ...: exit
440
-
441
- File "<ipython-input-4-442cc5665745>", line 1
442
-
443
- No module named pandas
444
-
445
- ^
446
-
447
- SyntaxError: invalid syntax`
448
-
449
- ```
450
-
451
- のエラーがでます
452
-
453
- ```
454
-
455
- pip install wheel
456
-
457
- Requirement already satisfied (use --upgrade to upgrade): wheel in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages`
458
-
459
-
460
-
461
- pip install pandas
462
-
463
- Requirement already satisfied (use --upgrade to upgrade): pandas in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages
464
-
465
- Requirement already satisfied (use --upgrade to upgrade): python-dateutil in ./.local/lib/python2.7/site-packages (from pandas)
466
-
467
- Requirement already satisfied (use --upgrade to upgrade): numpy>=1.7.0 in ./.local/lib/python2.7/site-packages (from pandas)
468
-
469
- Requirement already satisfied (use --upgrade to upgrade): pytz>=2011k in ./.local/lib/python2.7/site-packages (from pandas)
470
-
471
- Requirement already satisfied (use --upgrade to upgrade): six>=1.5 in ./.local/lib/python2.7/site-packages (from python-dateutil->pandas)`
472
-
473
- ```
474
-
475
- pip freeze
476
-
477
- cycler==0.10.0
478
-
479
- functools32==3.2.3.post2
480
-
481
- matplotlib==2.0.0b3
482
-
483
- numpy==1.11.1
484
-
485
- pandas==0.18.1
486
-
487
- pyparsing==2.1.5
488
-
489
- python-dateutil==2.5.3
490
-
491
- pytz==2016.6.1
492
-
493
- scikit-learn==0.17.1
494
-
495
- scipy==0.18.0
496
-
497
- six==1.10.0
498
-
499
- subprocess32==3.2.7
500
-
501
-
502
-
503
- pandas==0.18.1入っているのになぜmoduleがないといわれるのでしょうか?
504
-
505
-
506
-
507
- またimport pandasをおこなったころ
508
-
509
- ```
510
-
511
- In [2]: import panda
512
-
513
- ImportError Traceback (most recent call last)
514
-
515
- <ipython-input-2-908607987b94> in <module>()
516
-
517
- ----> 1 import panda
518
-
519
- ImportError: No module named panda
520
-
521
- ```
522
-
523
- のエラーがでました
524
-
525
- すみません。教えてください
187
+
188
+
189
+ pythonとうって
190
+
191
+ import pandaはエラーでませんでした。
192
+
193
+
194
+
195
+ pip install ipython
196
+
197
+ Requirement already satisfied (use --upgrade to upgrade): ipython in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages
198
+
199
+ Requirement already satisfied (use --upgrade to upgrade): traitlets>=4.2 in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from ipython)
200
+
201
+ Requirement already satisfied (use --upgrade to upgrade): pickleshare in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from ipython)
202
+
203
+ Requirement already satisfied (use --upgrade to upgrade): backports.shutil-get-terminal-size; python_version == "2.7" in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from ipython)
204
+
205
+ Requirement already satisfied (use --upgrade to upgrade): setuptools>=18.5 in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from ipython)
206
+
207
+ Requirement already satisfied (use --upgrade to upgrade): pygments in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from ipython)
208
+
209
+ Requirement already satisfied (use --upgrade to upgrade): pathlib2; python_version == "2.7" or python_version == "3.3" in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from ipython)
210
+
211
+ Requirement already satisfied (use --upgrade to upgrade): pexpect; sys_platform != "win32" in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from ipython)
212
+
213
+ Requirement already satisfied (use --upgrade to upgrade): simplegeneric>0.8 in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from ipython)
214
+
215
+ Requirement already satisfied (use --upgrade to upgrade): decorator in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from ipython)
216
+
217
+ Requirement already satisfied (use --upgrade to upgrade): prompt-toolkit<2.0.0,>=1.0.3 in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from ipython)
218
+
219
+ Requirement already satisfied (use --upgrade to upgrade): ipython-genutils in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from traitlets>=4.2->ipython)
220
+
221
+ Requirement already satisfied (use --upgrade to upgrade): six in ./.local/lib/python2.7/site-packages (from pathlib2; python_version == "2.7" or python_version == "3.3"->ipython)
222
+
223
+ Requirement already satisfied (use --upgrade to upgrade): ptyprocess>=0.5 in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from pexpect; sys_platform != "win32"->ipython)
224
+
225
+ Requirement already satisfied (use --upgrade to upgrade): wcwidth in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from prompt-toolkit<2.0.0,>=1.0.3->ipython)
226
+
227
+ [root@ichioka ~]# pip install ipython
228
+
229
+ Requirement already satisfied (use --upgrade to upgrade): ipython in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages
230
+
231
+ Requirement already satisfied (use --upgrade to upgrade): traitlets>=4.2 in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from ipython)
232
+
233
+ Requirement already satisfied (use --upgrade to upgrade): pickleshare in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from ipython)
234
+
235
+ Requirement already satisfied (use --upgrade to upgrade): backports.shutil-get-terminal-size; python_version == "2.7" in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from ipython)
236
+
237
+ Requirement already satisfied (use --upgrade to upgrade): setuptools>=18.5 in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from ipython)
238
+
239
+ Requirement already satisfied (use --upgrade to upgrade): pygments in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from ipython)
240
+
241
+ Requirement already satisfied (use --upgrade to upgrade): pathlib2; python_version == "2.7" or python_version == "3.3" in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from ipython)
242
+
243
+ Requirement already satisfied (use --upgrade to upgrade): pexpect; sys_platform != "win32" in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from ipython)
244
+
245
+ Requirement already satisfied (use --upgrade to upgrade): simplegeneric>0.8 in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from ipython)
246
+
247
+ Requirement already satisfied (use --upgrade to upgrade): decorator in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from ipython)
248
+
249
+ Requirement already satisfied (use --upgrade to upgrade): prompt-toolkit<2.0.0,>=1.0.3 in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from ipython)
250
+
251
+ Requirement already satisfied (use --upgrade to upgrade): ipython-genutils in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from traitlets>=4.2->ipython)
252
+
253
+ Requirement already satisfied (use --upgrade to upgrade): six in ./.local/lib/python2.7/site-packages (from pathlib2; python_version == "2.7" or python_version == "3.3"->ipython)
254
+
255
+ Requirement already satisfied (use --upgrade to upgrade): ptyprocess>=0.5 in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from pexpect; sys_platform != "win32"->ipython)
256
+
257
+ Requirement already satisfied (use --upgrade to upgrade): wcwidth in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages (from prompt-toolkit<2.0.0,>=1.0.3->ipython)
258
+
259
+
260
+
261
+ でます。
262
+
263
+ なにが足りないのでょうか?

14

書式

2016/07/31 13:06

投稿

gik
gik

スコア152

test CHANGED
File without changes
test CHANGED
@@ -180,7 +180,7 @@
180
180
 
181
181
  six==1.10.0
182
182
 
183
- subprocess32==3.2.7`
183
+ subprocess32==3.2.7
184
184
 
185
185
 
186
186
 
@@ -254,7 +254,7 @@
254
254
 
255
255
  six==1.10.0
256
256
 
257
- subprocess32==3.2.7`
257
+ subprocess32==3.2.7
258
258
 
259
259
 
260
260
 

13

書式変更

2016/07/31 11:09

投稿

gik
gik

スコア152

test CHANGED
File without changes
test CHANGED
@@ -18,18 +18,470 @@
18
18
 
19
19
 
20
20
 
21
+ ```
22
+
21
- python --version
23
+ []# python --version
22
-
24
+
23
- Python 3.5.1
25
+ Python 2.7.5
24
-
26
+
25
- []# pip freeze
27
+ []#pip freeze
28
+
29
+ Exception:
30
+
31
+ Traceback (most recent call last):
32
+
33
+ File "/usr/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
34
+
35
+ status = self.run(options, args)
36
+
37
+ File "/usr/lib/python2.7/site-packages/pip/commands/freeze.py", line 85, in run
38
+
39
+ for line in freeze(**freeze_kwargs):
40
+
41
+ File "/usr/lib/python2.7/site-packages/pip/operations/freeze.py", line 47, in freeze
42
+
43
+ dependency_links
44
+
45
+ File "/usr/lib/python2.7/site-packages/pip/__init__.py", line 264, in from_dist
46
+
47
+ req = dist.as_requirement()
48
+
49
+ File "/usr/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2562, in as_requirement
50
+
51
+ return Requirement.parse(spec)
52
+
53
+ File "/usr/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2833, in parse
54
+
55
+ req, = parse_requirements(s)
56
+
57
+ File "/usr/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2781, in parse_requirements
58
+
59
+ yield Requirement(line)
60
+
61
+ File "/usr/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2790, in __init__
62
+
63
+ raise RequirementParseError(str(e))
64
+
65
+ RequirementParseError: Invalid requirement, parse error at "'-ipap11h'"
66
+
67
+ ```
68
+
69
+ python2.7.5でコードをかきたい場合パッケージがはいりません
70
+
71
+ ipythonでも
72
+
73
+ ```
74
+
75
+ ImportError Traceback (most recent call last)
76
+
77
+ /root/setup/gen_webstats.py in <module>()
78
+
79
+ 10
80
+
81
+ 11 import os
82
+
83
+ ---> 12 import scipy as sp
84
+
85
+ 13 from scipy.stats import gamma
86
+
87
+ 14 import matplotlib.pyplot as plt
88
+
89
+ ImportError: No module named scipy
90
+
91
+ ```
92
+
93
+
94
+
95
+ でます。
96
+
97
+ またpycharmでは
98
+
99
+ パッケージをインストールしようとすると
100
+
101
+
102
+
103
+ ```
104
+
105
+ Could not find platform dependent libraries <exec_prefix>
106
+
107
+ Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
108
+
109
+ Traceback (most recent call last):
110
+
111
+ File "/opt/pycharm/pycharm-community-2016.2/helpers/packaging_tool.py", line 190, in main
112
+
113
+ retcode = do_untar(name)
114
+
115
+ File "/opt/pycharm/pycharm-community-2016.2/helpers/packaging_tool.py", line 129, in
116
+
117
+ do_untar
118
+
119
+ import tempfile
120
+
121
+ File "/root/.pyenv/versions/2.7.5/lib/python2.7/tempfile.py", line 32, in <module>
122
+
123
+ import io as _io
124
+
125
+ File "/root/.pyenv/versions/2.7.5/lib/python2.7/io.py", line 51, in <module>
126
+
127
+ import _io
128
+
129
+ ImportError: No module named _io
130
+
131
+ ```
132
+
133
+
134
+
135
+ がでます。
136
+
137
+ どのようにしたらpython2.7.5にパッケージを入れて、できるようになるのでしょうか?
138
+
139
+
140
+
141
+ ここの部分だしてなどありましたら、掲載します。
142
+
143
+ ipythonだけでも2.7.5でできるようにしたいです。
144
+
145
+ よろしくお願いします。
146
+
147
+ --------------------------------------------------------------
148
+
149
+ 昨日もしかして別個にptythonもパッケージをインストールしなくてはいけないのかと思い
150
+
151
+ pyenv install 2.75をインストールし
152
+
153
+ pip install --upgrade pip
154
+
155
+
156
+
157
+ その後機械学習のライブラリーをインストールして
158
+
159
+ ここまでいきました
160
+
161
+ pip freeze
26
162
 
27
163
  cycler==0.10.0
28
164
 
165
+ functools32==3.2.3.post2
166
+
29
- matplotlib==1.5.1
167
+ matplotlib==2.0.0b3
30
168
 
31
169
  numpy==1.11.1
32
170
 
171
+ pyparsing==2.1.5
172
+
173
+ python-dateutil==2.5.3
174
+
175
+ pytz==2016.6.1
176
+
177
+ scikit-learn==0.17.1
178
+
179
+ scipy==0.18.0
180
+
181
+ six==1.10.0
182
+
183
+ subprocess32==3.2.7`
184
+
185
+
186
+
187
+ pip uninstall _ipap11helper
188
+
189
+ をおこなったところ
190
+
191
+ ```
192
+
193
+ Invalid requirement: '_ipap11helper'
194
+
195
+ Traceback (most recent call last):
196
+
197
+ File "/root/.pyenv/versions/2.7.5/lib/python2.7/site-packages/pip/req/req_install.py", line 78, in __init__
198
+
199
+ req = Requirement(req)
200
+
201
+ File "/root/.pyenv/versions/2.7.5/lib/python2.7/site-packages/pip/_vendor/packaging/requirements.py", line 96, in __init__
202
+
203
+ requirement_string[e.loc:e.loc + 8]))
204
+
205
+ InvalidRequirement: Invalid requirement, parse error at "'_ipap11h'"
206
+
207
+ ```
208
+
209
+
210
+
211
+ 再度
212
+
213
+ pip install --upgrade pip
214
+
215
+ Requirement already up-to-date: pip in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages
216
+
217
+
218
+
219
+ pyenv versions
220
+
221
+ - system
222
+
223
+ - * 2.7.5 (set by /root/.pyenv/version)
224
+
225
+ - 3.5.1
226
+
227
+
228
+
229
+ pip install --upgrade pip
230
+
231
+ Requirement already up-to-date: pip in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages
232
+
233
+
234
+
235
+ pip freeze
236
+
237
+ cycler==0.10.0
238
+
239
+ functools32==3.2.3.post2
240
+
241
+ matplotlib==2.0.0b3
242
+
243
+ numpy==1.11.1
244
+
245
+ pyparsing==2.1.5
246
+
247
+ python-dateutil==2.5.3
248
+
249
+ pytz==2016.6.1
250
+
251
+ scikit-learn==0.17.1
252
+
253
+ scipy==0.18.0
254
+
255
+ six==1.10.0
256
+
257
+ subprocess32==3.2.7`
258
+
259
+
260
+
261
+ で、python2.7のソースコードで
262
+
263
+
264
+
265
+ ```
266
+
267
+ Traceback (most recent call last)
268
+
269
+ /root/setup/ml4se/scripts/02-square_error.py in <module>()
270
+
271
+ 7
272
+
273
+ 8 import numpy as np
274
+
275
+ ----> 9 import matplotlib.pyplot as plt
276
+
277
+ 10 import pandas as pd
278
+
279
+ 11 from pandas import Series, DataFrame
280
+
281
+ /root/.local/lib/python2.7/site-packages/matplotlib/pyplot.py in <module>()
282
+
283
+ 112
284
+
285
+ 113 from matplotlib.backends import pylab_setup
286
+
287
+ --> 114 _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
288
+
289
+ 115
290
+
291
+ 116 _IP_REGISTERED = None
292
+
293
+ /root/.local/lib/python2.7/site-packages/matplotlib/backends/__init__.pyc in pylab_setup()
294
+
295
+ 30 # imports. 0 means only perform absolute imports.
296
+
297
+ 31 backend_mod = __import__(backend_name,
298
+
299
+ ---> 32 globals(),locals(),[backend_name],0)
300
+
301
+ 33
302
+
303
+ 34 # Things we pull in from all backends
304
+
305
+ /root/.local/lib/python2.7/site-packages/matplotlib/backends/backend_tkagg.py in <module>()
306
+
307
+ 4
308
+
309
+ 5 import six
310
+
311
+ ----> 6 from six.moves import tkinter as Tk
312
+
313
+ 7 from six.moves import tkinter_filedialog as FileDialog
314
+
315
+ 8
316
+
317
+ /root/.local/lib/python2.7/site-packages/six.pyc in load_module(self, fullname)
318
+
319
+ 201 mod = self.__get_module(fullname)
320
+
321
+ 202 if isinstance(mod, MovedModule):
322
+
323
+ --> 203 mod = mod._resolve()
324
+
325
+ 204 else:
326
+
327
+ 205 mod.__loader__ = self
328
+
329
+ /root/.local/lib/python2.7/site-packages/six.pyc in _resolve(self)
330
+
331
+ 113
332
+
333
+ 114 def _resolve(self):
334
+
335
+ --> 115 return _import_module(self.mod)
336
+
337
+ 116
338
+
339
+ 117 def __getattr__(self, attr):
340
+
341
+ /root/.local/lib/python2.7/site-packages/six.pyc in _import_module(name)
342
+
343
+ 80 def _import_module(name):
344
+
345
+ 81 """Import module, returning the module after the last dot."""
346
+
347
+ ---> 82 __import__(name)
348
+
349
+ 83 return sys.modules[name]
350
+
351
+ 84
352
+
353
+ ImportError: No module named Tkinter`
354
+
355
+ ```
356
+
357
+
358
+
359
+ pip install matplotlib
360
+
361
+ ```
362
+
363
+ Requirement already satisfied (use --upgrade to upgrade): matplotlib in ./.local/lib/python2.7/site-packages
364
+
365
+ Requirement already satisfied (use --upgrade to upgrade): python-dateutil in ./.local/lib/python2.7/site-packages (from matplotlib)
366
+
367
+ Requirement already satisfied (use --upgrade to upgrade): pyparsing!=2.0.0,!=2.0.4,!=2.1.2,>=1.5.6 in ./.local/lib/python2.7/site-packages (from matplotlib)
368
+
369
+ Requirement already satisfied (use --upgrade to upgrade): pytz in ./.local/lib/python2.7/site-packages (from matplotlib)
370
+
371
+ Requirement already satisfied (use --upgrade to upgrade): six>=1.10 in ./.local/lib/python2.7/site-packages (from matplotlib)
372
+
373
+ Requirement already satisfied (use --upgrade to upgrade): functools32 in ./.local/lib/python2.7/site-packages (from matplotlib)
374
+
375
+ Requirement already satisfied (use --upgrade to upgrade): numpy>=1.6 in ./.local/lib/python2.7/site-packages (from matplotlib)
376
+
377
+ Requirement already satisfied (use --upgrade to upgrade): cycler>=0.10 in ./.local/lib/python2.7/site-packages (from matplotlib)
378
+
379
+ Requirement already satisfied (use --upgrade to upgrade): subprocess32 in ./.local/lib/python2.7/site-packages (from matplotlib)`
380
+
381
+ ```
382
+
383
+ とでます
384
+
385
+ どうしたらいいでしょうか?
386
+
387
+ なにかたりないのでしょうか?
388
+
389
+ 教えてください。よろしくお願いします
390
+
391
+
392
+
393
+ --------------------------------------------------------------
394
+
395
+ Tkinterについてですが
396
+
397
+ yum install Tkinter
398
+
399
+ yum install python -tk
400
+
401
+ yum install tk tcl tk-devel
402
+
403
+ yum install openssl openssl-devel
404
+
405
+ yum install python2-tktable.x86_64
406
+
407
+ 行ったところ
408
+
409
+
410
+
411
+ from six.moves import tkinter as Tk
412
+
413
+ のエラーはなくなりましたがありがとうございます
414
+
415
+
416
+
417
+ 今度は
418
+
419
+ ```
420
+
421
+ ImportError Traceback (most recent call last)
422
+
423
+ /root/setup/ml4se/scripts/02-square_error.py in <module>()
424
+
425
+ 8 import numpy as np
426
+
427
+ 9 import matplotlib.pyplot as plt
428
+
429
+ ---> 10 import pandas as pd
430
+
431
+ 11 from pandas import Series, DataFrame
432
+
433
+ 12
434
+
435
+ ImportError: No module named pandas
436
+
437
+ In [4]: No module named pandas
438
+
439
+ ...: exit
440
+
441
+ File "<ipython-input-4-442cc5665745>", line 1
442
+
443
+ No module named pandas
444
+
445
+ ^
446
+
447
+ SyntaxError: invalid syntax`
448
+
449
+ ```
450
+
451
+ のエラーがでます
452
+
453
+ ```
454
+
455
+ pip install wheel
456
+
457
+ Requirement already satisfied (use --upgrade to upgrade): wheel in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages`
458
+
459
+
460
+
461
+ pip install pandas
462
+
463
+ Requirement already satisfied (use --upgrade to upgrade): pandas in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages
464
+
465
+ Requirement already satisfied (use --upgrade to upgrade): python-dateutil in ./.local/lib/python2.7/site-packages (from pandas)
466
+
467
+ Requirement already satisfied (use --upgrade to upgrade): numpy>=1.7.0 in ./.local/lib/python2.7/site-packages (from pandas)
468
+
469
+ Requirement already satisfied (use --upgrade to upgrade): pytz>=2011k in ./.local/lib/python2.7/site-packages (from pandas)
470
+
471
+ Requirement already satisfied (use --upgrade to upgrade): six>=1.5 in ./.local/lib/python2.7/site-packages (from python-dateutil->pandas)`
472
+
473
+ ```
474
+
475
+ pip freeze
476
+
477
+ cycler==0.10.0
478
+
479
+ functools32==3.2.3.post2
480
+
481
+ matplotlib==2.0.0b3
482
+
483
+ numpy==1.11.1
484
+
33
485
  pandas==0.18.1
34
486
 
35
487
  pyparsing==2.1.5
@@ -44,472 +496,6 @@
44
496
 
45
497
  six==1.10.0
46
498
 
47
- まではできましたが、
48
-
49
-
50
-
51
-
52
-
53
- []# python --version
54
-
55
- Python 2.7.5
56
-
57
- `[]#pip freeze
58
-
59
- Exception:
60
-
61
- Traceback (most recent call last):
62
-
63
- File "/usr/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
64
-
65
- status = self.run(options, args)
66
-
67
- File "/usr/lib/python2.7/site-packages/pip/commands/freeze.py", line 85, in run
68
-
69
- for line in freeze(**freeze_kwargs):
70
-
71
- File "/usr/lib/python2.7/site-packages/pip/operations/freeze.py", line 47, in freeze
72
-
73
- dependency_links
74
-
75
- File "/usr/lib/python2.7/site-packages/pip/__init__.py", line 264, in from_dist
76
-
77
- req = dist.as_requirement()
78
-
79
- File "/usr/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2562, in as_requirement
80
-
81
- return Requirement.parse(spec)
82
-
83
- File "/usr/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2833, in parse
84
-
85
- req, = parse_requirements(s)
86
-
87
- File "/usr/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2781, in parse_requirements
88
-
89
- yield Requirement(line)
90
-
91
- File "/usr/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2790, in __init__
92
-
93
- raise RequirementParseError(str(e))
94
-
95
- RequirementParseError: Invalid requirement, parse error at "'-ipap11h'"`
96
-
97
-
98
-
99
- とでます。
100
-
101
- python2.7.5でコードをかきたい場合パッケージがはいりません
102
-
103
- ipythonでも
104
-
105
-
106
-
107
- `ImportError Traceback (most recent call last)
108
-
109
- /root/setup/gen_webstats.py in <module>()
110
-
111
- 10
112
-
113
- 11 import os
114
-
115
- ---> 12 import scipy as sp
116
-
117
- 13 from scipy.stats import gamma
118
-
119
- 14 import matplotlib.pyplot as plt
120
-
121
- ImportError: No module named scipy`
122
-
123
- でます。
124
-
125
- またpycharmでは
126
-
127
- パッケージをインストールしようとすると
128
-
129
- `Could not find platform dependent libraries <exec_prefix>
130
-
131
- Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
132
-
133
- Traceback (most recent call last):
134
-
135
- File "/opt/pycharm/pycharm-community-2016.2/helpers/packaging_tool.py", line 190, in main
136
-
137
- retcode = do_untar(name)
138
-
139
- File "/opt/pycharm/pycharm-community-2016.2/helpers/packaging_tool.py", line 129, in
140
-
141
- do_untar
142
-
143
- import tempfile
144
-
145
- File "/root/.pyenv/versions/2.7.5/lib/python2.7/tempfile.py", line 32, in <module>
146
-
147
- import io as _io
148
-
149
- File "/root/.pyenv/versions/2.7.5/lib/python2.7/io.py", line 51, in <module>
150
-
151
- import _io
152
-
153
- ImportError: No module named _io`
154
-
155
-
156
-
157
- がでます。
158
-
159
- どのようにしたらpython2.7.5にパッケージを入れて、できるようになるのでしょうか?
160
-
161
-
162
-
163
- ここの部分だしてなどありましたら、掲載します。
164
-
165
- ipythonだけでも2.7.5でできるようにしたいです。
166
-
167
- よろしくお願いします。
168
-
169
- --------------------------------------------------------------
170
-
171
- 昨日もしかして別個にptythonもパッケージをインストールしなくてはいけないのかと思い
172
-
173
- pyenv install 2.75をインストールし
174
-
175
- pip install --upgrade pip
176
-
177
-
178
-
179
- その後機械学習のライブラリーをインストールして
180
-
181
- ここまでいきました
182
-
183
-
184
-
185
- `pip freeze
186
-
187
- cycler==0.10.0
188
-
189
- functools32==3.2.3.post2
190
-
191
- matplotlib==2.0.0b3
192
-
193
- numpy==1.11.1
194
-
195
- pyparsing==2.1.5
196
-
197
- python-dateutil==2.5.3
198
-
199
- pytz==2016.6.1
200
-
201
- scikit-learn==0.17.1
202
-
203
- scipy==0.18.0
204
-
205
- six==1.10.0
206
-
207
- subprocess32==3.2.7`
208
-
209
-
210
-
211
-
212
-
213
- pip uninstall _ipap11helper
214
-
215
- をおこなったところ
216
-
217
-
218
-
219
- `Invalid requirement: '_ipap11helper'
220
-
221
- Traceback (most recent call last):
222
-
223
- File "/root/.pyenv/versions/2.7.5/lib/python2.7/site-packages/pip/req/req_install.py", line 78, in __init__
224
-
225
- req = Requirement(req)
226
-
227
- File "/root/.pyenv/versions/2.7.5/lib/python2.7/site-packages/pip/_vendor/packaging/requirements.py", line 96, in __init__
228
-
229
- requirement_string[e.loc:e.loc + 8]))
230
-
231
- InvalidRequirement: Invalid requirement, parse error at "'_ipap11h'"`
232
-
233
-
234
-
235
- 再度
236
-
237
- pip install --upgrade pip
238
-
239
- Requirement already up-to-date: pip in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages
240
-
241
-
242
-
243
- pyenv versions
244
-
245
- - system
246
-
247
- - * 2.7.5 (set by /root/.pyenv/version)
248
-
249
- - 3.5.1
250
-
251
-
252
-
253
- pip install --upgrade pip
254
-
255
- Requirement already up-to-date: pip in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages
256
-
257
-
258
-
259
- `pip freeze
260
-
261
- cycler==0.10.0
262
-
263
- functools32==3.2.3.post2
264
-
265
- matplotlib==2.0.0b3
266
-
267
- numpy==1.11.1
268
-
269
- pyparsing==2.1.5
270
-
271
- python-dateutil==2.5.3
272
-
273
- pytz==2016.6.1
274
-
275
- scikit-learn==0.17.1
276
-
277
- scipy==0.18.0
278
-
279
- six==1.10.0
280
-
281
- subprocess32==3.2.7`
282
-
283
-
284
-
285
- で、python2.7のソースコードで
286
-
287
-
288
-
289
- `Traceback (most recent call last)
290
-
291
- /root/setup/ml4se/scripts/02-square_error.py in <module>()
292
-
293
- 7
294
-
295
- 8 import numpy as np
296
-
297
- ----> 9 import matplotlib.pyplot as plt
298
-
299
- 10 import pandas as pd
300
-
301
- 11 from pandas import Series, DataFrame
302
-
303
- /root/.local/lib/python2.7/site-packages/matplotlib/pyplot.py in <module>()
304
-
305
- 112
306
-
307
- 113 from matplotlib.backends import pylab_setup
308
-
309
- --> 114 _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
310
-
311
- 115
312
-
313
- 116 _IP_REGISTERED = None
314
-
315
- /root/.local/lib/python2.7/site-packages/matplotlib/backends/__init__.pyc in pylab_setup()
316
-
317
- 30 # imports. 0 means only perform absolute imports.
318
-
319
- 31 backend_mod = __import__(backend_name,
320
-
321
- ---> 32 globals(),locals(),[backend_name],0)
322
-
323
- 33
324
-
325
- 34 # Things we pull in from all backends
326
-
327
- /root/.local/lib/python2.7/site-packages/matplotlib/backends/backend_tkagg.py in <module>()
328
-
329
- 4
330
-
331
- 5 import six
332
-
333
- ----> 6 from six.moves import tkinter as Tk
334
-
335
- 7 from six.moves import tkinter_filedialog as FileDialog
336
-
337
- 8
338
-
339
- /root/.local/lib/python2.7/site-packages/six.pyc in load_module(self, fullname)
340
-
341
- 201 mod = self.__get_module(fullname)
342
-
343
- 202 if isinstance(mod, MovedModule):
344
-
345
- --> 203 mod = mod._resolve()
346
-
347
- 204 else:
348
-
349
- 205 mod.__loader__ = self
350
-
351
- /root/.local/lib/python2.7/site-packages/six.pyc in _resolve(self)
352
-
353
- 113
354
-
355
- 114 def _resolve(self):
356
-
357
- --> 115 return _import_module(self.mod)
358
-
359
- 116
360
-
361
- 117 def __getattr__(self, attr):
362
-
363
- /root/.local/lib/python2.7/site-packages/six.pyc in _import_module(name)
364
-
365
- 80 def _import_module(name):
366
-
367
- 81 """Import module, returning the module after the last dot."""
368
-
369
- ---> 82 __import__(name)
370
-
371
- 83 return sys.modules[name]
372
-
373
- 84
374
-
375
- ImportError: No module named Tkinter`
376
-
377
-
378
-
379
- pip install matplotlib
380
-
381
- `Requirement already satisfied (use --upgrade to upgrade): matplotlib in ./.local/lib/python2.7/site-packages
382
-
383
- Requirement already satisfied (use --upgrade to upgrade): python-dateutil in ./.local/lib/python2.7/site-packages (from matplotlib)
384
-
385
- Requirement already satisfied (use --upgrade to upgrade): pyparsing!=2.0.0,!=2.0.4,!=2.1.2,>=1.5.6 in ./.local/lib/python2.7/site-packages (from matplotlib)
386
-
387
- Requirement already satisfied (use --upgrade to upgrade): pytz in ./.local/lib/python2.7/site-packages (from matplotlib)
388
-
389
- Requirement already satisfied (use --upgrade to upgrade): six>=1.10 in ./.local/lib/python2.7/site-packages (from matplotlib)
390
-
391
- Requirement already satisfied (use --upgrade to upgrade): functools32 in ./.local/lib/python2.7/site-packages (from matplotlib)
392
-
393
- Requirement already satisfied (use --upgrade to upgrade): numpy>=1.6 in ./.local/lib/python2.7/site-packages (from matplotlib)
394
-
395
- Requirement already satisfied (use --upgrade to upgrade): cycler>=0.10 in ./.local/lib/python2.7/site-packages (from matplotlib)
396
-
397
- Requirement already satisfied (use --upgrade to upgrade): subprocess32 in ./.local/lib/python2.7/site-packages (from matplotlib)`
398
-
399
-
400
-
401
- とでます
402
-
403
- どうしたらいいでしょうか?
404
-
405
- なにかたりないのでしょうか?
406
-
407
- 教えてください。よろしくお願いします
408
-
409
-
410
-
411
- --------------------------------------------------------------
412
-
413
- Tkinterについてですが
414
-
415
- yum install Tkinter
416
-
417
- yum install python -tk
418
-
419
- yum install tk tcl tk-devel
420
-
421
- yum install openssl openssl-devel
422
-
423
- yum install python2-tktable.x86_64
424
-
425
- 行ったところ
426
-
427
-
428
-
429
- from six.moves import tkinter as Tk
430
-
431
- のエラーはなくなりましたがありがとうございます
432
-
433
-
434
-
435
- `ImportError Traceback (most recent call last)
436
-
437
- /root/setup/ml4se/scripts/02-square_error.py in <module>()
438
-
439
- 8 import numpy as np
440
-
441
- 9 import matplotlib.pyplot as plt
442
-
443
- ---> 10 import pandas as pd
444
-
445
- 11 from pandas import Series, DataFrame
446
-
447
- 12
448
-
449
- ImportError: No module named pandas
450
-
451
- In [4]: No module named pandas
452
-
453
- ...: exit
454
-
455
- File "<ipython-input-4-442cc5665745>", line 1
456
-
457
- No module named pandas
458
-
459
- ^
460
-
461
- SyntaxError: invalid syntax`
462
-
463
-
464
-
465
- のエラーがでます
466
-
467
-
468
-
469
- `pip install wheel
470
-
471
- Requirement already satisfied (use --upgrade to upgrade): wheel in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages`
472
-
473
-
474
-
475
- `pip install pandas
476
-
477
- Requirement already satisfied (use --upgrade to upgrade): pandas in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages
478
-
479
- Requirement already satisfied (use --upgrade to upgrade): python-dateutil in ./.local/lib/python2.7/site-packages (from pandas)
480
-
481
- Requirement already satisfied (use --upgrade to upgrade): numpy>=1.7.0 in ./.local/lib/python2.7/site-packages (from pandas)
482
-
483
- Requirement already satisfied (use --upgrade to upgrade): pytz>=2011k in ./.local/lib/python2.7/site-packages (from pandas)
484
-
485
- Requirement already satisfied (use --upgrade to upgrade): six>=1.5 in ./.local/lib/python2.7/site-packages (from python-dateutil->pandas)`
486
-
487
-
488
-
489
- pip freeze
490
-
491
- cycler==0.10.0
492
-
493
- functools32==3.2.3.post2
494
-
495
- matplotlib==2.0.0b3
496
-
497
- numpy==1.11.1
498
-
499
- pandas==0.18.1
500
-
501
- pyparsing==2.1.5
502
-
503
- python-dateutil==2.5.3
504
-
505
- pytz==2016.6.1
506
-
507
- scikit-learn==0.17.1
508
-
509
- scipy==0.18.0
510
-
511
- six==1.10.0
512
-
513
499
  subprocess32==3.2.7
514
500
 
515
501
 
@@ -520,7 +506,9 @@
520
506
 
521
507
  またimport pandasをおこなったころ
522
508
 
509
+ ```
510
+
523
- ```In [2]: import panda
511
+ In [2]: import panda
524
512
 
525
513
  ImportError Traceback (most recent call last)
526
514
 
@@ -528,9 +516,9 @@
528
516
 
529
517
  ----> 1 import panda
530
518
 
531
- ImportError: No module named panda```
519
+ ImportError: No module named panda
520
+
532
-
521
+ ```
533
-
534
522
 
535
523
  のエラーがでました
536
524
 

12

書式変更

2016/07/31 11:07

投稿

gik
gik

スコア152

test CHANGED
File without changes
test CHANGED
@@ -4,8 +4,6 @@
4
4
 
5
5
  pyenv+pycharmを入れましたが。
6
6
 
7
-
8
-
9
7
  pyenvで
10
8
 
11
9
  pyenv versions
@@ -56,8 +54,6 @@
56
54
 
57
55
  Python 2.7.5
58
56
 
59
-
60
-
61
57
  `[]#pip freeze
62
58
 
63
59
  Exception:
@@ -100,8 +96,6 @@
100
96
 
101
97
 
102
98
 
103
-
104
-
105
99
  とでます。
106
100
 
107
101
  python2.7.5でコードをかきたい場合パッケージがはいりません
@@ -126,18 +120,12 @@
126
120
 
127
121
  ImportError: No module named scipy`
128
122
 
129
-
130
-
131
123
  でます。
132
124
 
133
-
134
-
135
125
  またpycharmでは
136
126
 
137
127
  パッケージをインストールしようとすると
138
128
 
139
-
140
-
141
129
  `Could not find platform dependent libraries <exec_prefix>
142
130
 
143
131
  Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
@@ -178,9 +166,7 @@
178
166
 
179
167
  よろしくお願いします。
180
168
 
181
- ------------------------------------------------------------------------------------------
169
+ --------------------------------------------------------------
182
-
183
-
184
170
 
185
171
  昨日もしかして別個にptythonもパッケージをインストールしなくてはいけないのかと思い
186
172
 
@@ -422,7 +408,7 @@
422
408
 
423
409
 
424
410
 
425
- --------------------------------------------------------------------------------
411
+ --------------------------------------------------------------
426
412
 
427
413
  Tkinterについてですが
428
414
 
@@ -530,4 +516,22 @@
530
516
 
531
517
  pandas==0.18.1入っているのになぜmoduleがないといわれるのでしょうか?
532
518
 
519
+
520
+
521
+ またimport pandasをおこなったころ
522
+
523
+ ```In [2]: import panda
524
+
525
+ ImportError Traceback (most recent call last)
526
+
527
+ <ipython-input-2-908607987b94> in <module>()
528
+
529
+ ----> 1 import panda
530
+
531
+ ImportError: No module named panda```
532
+
533
+
534
+
535
+ のエラーがでました
536
+
533
537
  すみません。教えてください

11

書式

2016/07/31 10:59

投稿

gik
gik

スコア152

test CHANGED
File without changes
test CHANGED
@@ -422,7 +422,9 @@
422
422
 
423
423
 
424
424
 
425
- -------------------------------------------------
425
+ --------------------------------------------------------------------------------
426
+
427
+ Tkinterについてですが
426
428
 
427
429
  yum install Tkinter
428
430
 
@@ -440,11 +442,11 @@
440
442
 
441
443
  from six.moves import tkinter as Tk
442
444
 
443
- のエラーはなくなりましたが
445
+ のエラーはなくなりましたがありがとうございます
444
-
445
-
446
-
446
+
447
+
448
+
447
- ImportError Traceback (most recent call last)
449
+ `ImportError Traceback (most recent call last)
448
450
 
449
451
  /root/setup/ml4se/scripts/02-square_error.py in <module>()
450
452
 
@@ -458,12 +460,8 @@
458
460
 
459
461
  12
460
462
 
461
-
462
-
463
463
  ImportError: No module named pandas
464
464
 
465
-
466
-
467
465
  In [4]: No module named pandas
468
466
 
469
467
  ...: exit
@@ -474,17 +472,21 @@
474
472
 
475
473
  ^
476
474
 
477
- SyntaxError: invalid syntax
475
+ SyntaxError: invalid syntax`
476
+
477
+
478
+
478
-
479
+ のエラーがでます
479
-
480
-
480
+
481
+
482
+
481
- pip install wheel
483
+ `pip install wheel
482
-
484
+
483
- Requirement already satisfied (use --upgrade to upgrade): wheel in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages
485
+ Requirement already satisfied (use --upgrade to upgrade): wheel in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages`
484
-
485
-
486
-
486
+
487
+
488
+
487
- pip install pandas
489
+ `pip install pandas
488
490
 
489
491
  Requirement already satisfied (use --upgrade to upgrade): pandas in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages
490
492
 
@@ -494,11 +496,11 @@
494
496
 
495
497
  Requirement already satisfied (use --upgrade to upgrade): pytz>=2011k in ./.local/lib/python2.7/site-packages (from pandas)
496
498
 
497
- Requirement already satisfied (use --upgrade to upgrade): six>=1.5 in ./.local/lib/python2.7/site-packages (from python-dateutil->pandas)
499
+ Requirement already satisfied (use --upgrade to upgrade): six>=1.5 in ./.local/lib/python2.7/site-packages (from python-dateutil->pandas)`
498
-
499
-
500
-
500
+
501
+
502
+
501
- ip freeze
503
+ pip freeze
502
504
 
503
505
  cycler==0.10.0
504
506
 
@@ -527,3 +529,5 @@
527
529
 
528
530
 
529
531
  pandas==0.18.1入っているのになぜmoduleがないといわれるのでしょうか?
532
+
533
+ すみません。教えてください

10

書式

2016/07/31 09:05

投稿

gik
gik

スコア152

test CHANGED
File without changes
test CHANGED
@@ -419,3 +419,111 @@
419
419
  なにかたりないのでしょうか?
420
420
 
421
421
  教えてください。よろしくお願いします
422
+
423
+
424
+
425
+ -------------------------------------------------
426
+
427
+ yum install Tkinter
428
+
429
+ yum install python -tk
430
+
431
+ yum install tk tcl tk-devel
432
+
433
+ yum install openssl openssl-devel
434
+
435
+ yum install python2-tktable.x86_64
436
+
437
+ 行ったところ
438
+
439
+
440
+
441
+ from six.moves import tkinter as Tk
442
+
443
+ のエラーはなくなりましたが
444
+
445
+
446
+
447
+ ImportError Traceback (most recent call last)
448
+
449
+ /root/setup/ml4se/scripts/02-square_error.py in <module>()
450
+
451
+ 8 import numpy as np
452
+
453
+ 9 import matplotlib.pyplot as plt
454
+
455
+ ---> 10 import pandas as pd
456
+
457
+ 11 from pandas import Series, DataFrame
458
+
459
+ 12
460
+
461
+
462
+
463
+ ImportError: No module named pandas
464
+
465
+
466
+
467
+ In [4]: No module named pandas
468
+
469
+ ...: exit
470
+
471
+ File "<ipython-input-4-442cc5665745>", line 1
472
+
473
+ No module named pandas
474
+
475
+ ^
476
+
477
+ SyntaxError: invalid syntax
478
+
479
+
480
+
481
+ pip install wheel
482
+
483
+ Requirement already satisfied (use --upgrade to upgrade): wheel in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages
484
+
485
+
486
+
487
+ pip install pandas
488
+
489
+ Requirement already satisfied (use --upgrade to upgrade): pandas in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages
490
+
491
+ Requirement already satisfied (use --upgrade to upgrade): python-dateutil in ./.local/lib/python2.7/site-packages (from pandas)
492
+
493
+ Requirement already satisfied (use --upgrade to upgrade): numpy>=1.7.0 in ./.local/lib/python2.7/site-packages (from pandas)
494
+
495
+ Requirement already satisfied (use --upgrade to upgrade): pytz>=2011k in ./.local/lib/python2.7/site-packages (from pandas)
496
+
497
+ Requirement already satisfied (use --upgrade to upgrade): six>=1.5 in ./.local/lib/python2.7/site-packages (from python-dateutil->pandas)
498
+
499
+
500
+
501
+ ip freeze
502
+
503
+ cycler==0.10.0
504
+
505
+ functools32==3.2.3.post2
506
+
507
+ matplotlib==2.0.0b3
508
+
509
+ numpy==1.11.1
510
+
511
+ pandas==0.18.1
512
+
513
+ pyparsing==2.1.5
514
+
515
+ python-dateutil==2.5.3
516
+
517
+ pytz==2016.6.1
518
+
519
+ scikit-learn==0.17.1
520
+
521
+ scipy==0.18.0
522
+
523
+ six==1.10.0
524
+
525
+ subprocess32==3.2.7
526
+
527
+
528
+
529
+ pandas==0.18.1入っているのになぜmoduleがないといわれるのでしょうか?

9

書式改善

2016/07/31 09:00

投稿

gik
gik

スコア152

test CHANGED
File without changes
test CHANGED
@@ -162,7 +162,7 @@
162
162
 
163
163
  import _io
164
164
 
165
- ImportError: No module named _io
165
+ ImportError: No module named _io`
166
166
 
167
167
 
168
168
 
@@ -194,6 +194,8 @@
194
194
 
195
195
  ここまでいきました
196
196
 
197
+
198
+
197
199
  `pip freeze
198
200
 
199
201
  cycler==0.10.0

8

書式変更

2016/07/31 07:35

投稿

gik
gik

スコア152

test CHANGED
File without changes
test CHANGED
@@ -178,11 +178,53 @@
178
178
 
179
179
  よろしくお願いします。
180
180
 
181
+ ------------------------------------------------------------------------------------------
182
+
183
+
184
+
185
+ 昨日もしかして別個にptythonもパッケージをインストールしなくてはいけないのかと思い
186
+
187
+ pyenv install 2.75をインストールし
188
+
189
+ pip install --upgrade pip
190
+
191
+
192
+
193
+ その後機械学習のライブラリーをインストールして
194
+
195
+ ここまでいきました
196
+
197
+ `pip freeze
198
+
199
+ cycler==0.10.0
200
+
201
+ functools32==3.2.3.post2
202
+
203
+ matplotlib==2.0.0b3
204
+
205
+ numpy==1.11.1
206
+
207
+ pyparsing==2.1.5
208
+
209
+ python-dateutil==2.5.3
210
+
211
+ pytz==2016.6.1
212
+
213
+ scikit-learn==0.17.1
214
+
215
+ scipy==0.18.0
216
+
217
+ six==1.10.0
218
+
219
+ subprocess32==3.2.7`
220
+
221
+
222
+
181
223
 
182
224
 
183
225
  pip uninstall _ipap11helper
184
226
 
185
- をおこったところ
227
+ をおこったところ
186
228
 
187
229
 
188
230
 
@@ -202,13 +244,21 @@
202
244
 
203
245
 
204
246
 
247
+ 再度
248
+
249
+ pip install --upgrade pip
250
+
251
+ Requirement already up-to-date: pip in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages
252
+
253
+
254
+
205
255
  pyenv versions
206
256
 
207
- system
257
+ - system
208
-
258
+
209
- * 2.7.5 (set by /root/.pyenv/version)
259
+ - * 2.7.5 (set by /root/.pyenv/version)
210
-
260
+
211
- 3.5.1
261
+ - 3.5.1
212
262
 
213
263
 
214
264
 
@@ -363,3 +413,7 @@
363
413
  とでます
364
414
 
365
415
  どうしたらいいでしょうか?
416
+
417
+ なにかたりないのでしょうか?
418
+
419
+ 教えてください。よろしくお願いします

7

誤字

2016/07/31 07:29

投稿

gik
gik

スコア152

test CHANGED
File without changes
test CHANGED
@@ -162,7 +162,7 @@
162
162
 
163
163
  import _io
164
164
 
165
- ImportError: No module named _io`
165
+ ImportError: No module named _io
166
166
 
167
167
 
168
168
 
@@ -212,13 +212,13 @@
212
212
 
213
213
 
214
214
 
215
- `pip install --upgrade pip
215
+ pip install --upgrade pip
216
216
 
217
217
  Requirement already up-to-date: pip in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages
218
218
 
219
219
 
220
220
 
221
- pip freeze
221
+ `pip freeze
222
222
 
223
223
  cycler==0.10.0
224
224
 
@@ -248,7 +248,7 @@
248
248
 
249
249
 
250
250
 
251
- `ImportError Traceback (most recent call last)
251
+ `Traceback (most recent call last)
252
252
 
253
253
  /root/setup/ml4se/scripts/02-square_error.py in <module>()
254
254
 
@@ -262,8 +262,6 @@
262
262
 
263
263
  11 from pandas import Series, DataFrame
264
264
 
265
-
266
-
267
265
  /root/.local/lib/python2.7/site-packages/matplotlib/pyplot.py in <module>()
268
266
 
269
267
  112
@@ -276,8 +274,6 @@
276
274
 
277
275
  116 _IP_REGISTERED = None
278
276
 
279
-
280
-
281
277
  /root/.local/lib/python2.7/site-packages/matplotlib/backends/__init__.pyc in pylab_setup()
282
278
 
283
279
  30 # imports. 0 means only perform absolute imports.
@@ -290,8 +286,6 @@
290
286
 
291
287
  34 # Things we pull in from all backends
292
288
 
293
-
294
-
295
289
  /root/.local/lib/python2.7/site-packages/matplotlib/backends/backend_tkagg.py in <module>()
296
290
 
297
291
  4
@@ -304,8 +298,6 @@
304
298
 
305
299
  8
306
300
 
307
-
308
-
309
301
  /root/.local/lib/python2.7/site-packages/six.pyc in load_module(self, fullname)
310
302
 
311
303
  201 mod = self.__get_module(fullname)
@@ -318,8 +310,6 @@
318
310
 
319
311
  205 mod.__loader__ = self
320
312
 
321
-
322
-
323
313
  /root/.local/lib/python2.7/site-packages/six.pyc in _resolve(self)
324
314
 
325
315
  113
@@ -332,8 +322,6 @@
332
322
 
333
323
  117 def __getattr__(self, attr):
334
324
 
335
-
336
-
337
325
  /root/.local/lib/python2.7/site-packages/six.pyc in _import_module(name)
338
326
 
339
327
  80 def _import_module(name):
@@ -346,13 +334,13 @@
346
334
 
347
335
  84
348
336
 
349
-
350
-
351
- ImportError: No module named Tkinter
337
+ ImportError: No module named Tkinter`
352
-
338
+
339
+
340
+
353
- pip install matplotlib
341
+ pip install matplotlib
354
-
342
+
355
- Requirement already satisfied (use --upgrade to upgrade): matplotlib in ./.local/lib/python2.7/site-packages
343
+ `Requirement already satisfied (use --upgrade to upgrade): matplotlib in ./.local/lib/python2.7/site-packages
356
344
 
357
345
  Requirement already satisfied (use --upgrade to upgrade): python-dateutil in ./.local/lib/python2.7/site-packages (from matplotlib)
358
346
 

6

誤字

2016/07/31 07:22

投稿

gik
gik

スコア152

test CHANGED
File without changes
test CHANGED
@@ -177,3 +177,201 @@
177
177
  ipythonだけでも2.7.5でできるようにしたいです。
178
178
 
179
179
  よろしくお願いします。
180
+
181
+
182
+
183
+ pip uninstall _ipap11helper
184
+
185
+ をおこったところ
186
+
187
+
188
+
189
+ `Invalid requirement: '_ipap11helper'
190
+
191
+ Traceback (most recent call last):
192
+
193
+ File "/root/.pyenv/versions/2.7.5/lib/python2.7/site-packages/pip/req/req_install.py", line 78, in __init__
194
+
195
+ req = Requirement(req)
196
+
197
+ File "/root/.pyenv/versions/2.7.5/lib/python2.7/site-packages/pip/_vendor/packaging/requirements.py", line 96, in __init__
198
+
199
+ requirement_string[e.loc:e.loc + 8]))
200
+
201
+ InvalidRequirement: Invalid requirement, parse error at "'_ipap11h'"`
202
+
203
+
204
+
205
+ pyenv versions
206
+
207
+ system
208
+
209
+ * 2.7.5 (set by /root/.pyenv/version)
210
+
211
+ 3.5.1
212
+
213
+
214
+
215
+ `pip install --upgrade pip
216
+
217
+ Requirement already up-to-date: pip in ./.pyenv/versions/2.7.5/lib/python2.7/site-packages
218
+
219
+
220
+
221
+ pip freeze
222
+
223
+ cycler==0.10.0
224
+
225
+ functools32==3.2.3.post2
226
+
227
+ matplotlib==2.0.0b3
228
+
229
+ numpy==1.11.1
230
+
231
+ pyparsing==2.1.5
232
+
233
+ python-dateutil==2.5.3
234
+
235
+ pytz==2016.6.1
236
+
237
+ scikit-learn==0.17.1
238
+
239
+ scipy==0.18.0
240
+
241
+ six==1.10.0
242
+
243
+ subprocess32==3.2.7`
244
+
245
+
246
+
247
+ で、python2.7のソースコードで
248
+
249
+
250
+
251
+ `ImportError Traceback (most recent call last)
252
+
253
+ /root/setup/ml4se/scripts/02-square_error.py in <module>()
254
+
255
+ 7
256
+
257
+ 8 import numpy as np
258
+
259
+ ----> 9 import matplotlib.pyplot as plt
260
+
261
+ 10 import pandas as pd
262
+
263
+ 11 from pandas import Series, DataFrame
264
+
265
+
266
+
267
+ /root/.local/lib/python2.7/site-packages/matplotlib/pyplot.py in <module>()
268
+
269
+ 112
270
+
271
+ 113 from matplotlib.backends import pylab_setup
272
+
273
+ --> 114 _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
274
+
275
+ 115
276
+
277
+ 116 _IP_REGISTERED = None
278
+
279
+
280
+
281
+ /root/.local/lib/python2.7/site-packages/matplotlib/backends/__init__.pyc in pylab_setup()
282
+
283
+ 30 # imports. 0 means only perform absolute imports.
284
+
285
+ 31 backend_mod = __import__(backend_name,
286
+
287
+ ---> 32 globals(),locals(),[backend_name],0)
288
+
289
+ 33
290
+
291
+ 34 # Things we pull in from all backends
292
+
293
+
294
+
295
+ /root/.local/lib/python2.7/site-packages/matplotlib/backends/backend_tkagg.py in <module>()
296
+
297
+ 4
298
+
299
+ 5 import six
300
+
301
+ ----> 6 from six.moves import tkinter as Tk
302
+
303
+ 7 from six.moves import tkinter_filedialog as FileDialog
304
+
305
+ 8
306
+
307
+
308
+
309
+ /root/.local/lib/python2.7/site-packages/six.pyc in load_module(self, fullname)
310
+
311
+ 201 mod = self.__get_module(fullname)
312
+
313
+ 202 if isinstance(mod, MovedModule):
314
+
315
+ --> 203 mod = mod._resolve()
316
+
317
+ 204 else:
318
+
319
+ 205 mod.__loader__ = self
320
+
321
+
322
+
323
+ /root/.local/lib/python2.7/site-packages/six.pyc in _resolve(self)
324
+
325
+ 113
326
+
327
+ 114 def _resolve(self):
328
+
329
+ --> 115 return _import_module(self.mod)
330
+
331
+ 116
332
+
333
+ 117 def __getattr__(self, attr):
334
+
335
+
336
+
337
+ /root/.local/lib/python2.7/site-packages/six.pyc in _import_module(name)
338
+
339
+ 80 def _import_module(name):
340
+
341
+ 81 """Import module, returning the module after the last dot."""
342
+
343
+ ---> 82 __import__(name)
344
+
345
+ 83 return sys.modules[name]
346
+
347
+ 84
348
+
349
+
350
+
351
+ ImportError: No module named Tkinter
352
+
353
+ pip install matplotlib
354
+
355
+ Requirement already satisfied (use --upgrade to upgrade): matplotlib in ./.local/lib/python2.7/site-packages
356
+
357
+ Requirement already satisfied (use --upgrade to upgrade): python-dateutil in ./.local/lib/python2.7/site-packages (from matplotlib)
358
+
359
+ Requirement already satisfied (use --upgrade to upgrade): pyparsing!=2.0.0,!=2.0.4,!=2.1.2,>=1.5.6 in ./.local/lib/python2.7/site-packages (from matplotlib)
360
+
361
+ Requirement already satisfied (use --upgrade to upgrade): pytz in ./.local/lib/python2.7/site-packages (from matplotlib)
362
+
363
+ Requirement already satisfied (use --upgrade to upgrade): six>=1.10 in ./.local/lib/python2.7/site-packages (from matplotlib)
364
+
365
+ Requirement already satisfied (use --upgrade to upgrade): functools32 in ./.local/lib/python2.7/site-packages (from matplotlib)
366
+
367
+ Requirement already satisfied (use --upgrade to upgrade): numpy>=1.6 in ./.local/lib/python2.7/site-packages (from matplotlib)
368
+
369
+ Requirement already satisfied (use --upgrade to upgrade): cycler>=0.10 in ./.local/lib/python2.7/site-packages (from matplotlib)
370
+
371
+ Requirement already satisfied (use --upgrade to upgrade): subprocess32 in ./.local/lib/python2.7/site-packages (from matplotlib)`
372
+
373
+
374
+
375
+ とでます
376
+
377
+ どうしたらいいでしょうか?

5

誤字

2016/07/31 07:18

投稿

gik
gik

スコア152

test CHANGED
File without changes
test CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  python2.7.5とPython 3.5.1両方で機械学習のプログラムを書きたく
4
4
 
5
- pyenv+pycharmを入れましたが。(3.5はできました)
5
+ pyenv+pycharmを入れましたが。
6
6
 
7
7
 
8
8
 

4

誤字

2016/07/30 16:29

投稿

gik
gik

スコア152

test CHANGED
File without changes
test CHANGED
@@ -58,7 +58,7 @@
58
58
 
59
59
 
60
60
 
61
- []#pip freeze
61
+ `[]#pip freeze
62
62
 
63
63
  Exception:
64
64
 
@@ -96,7 +96,7 @@
96
96
 
97
97
  raise RequirementParseError(str(e))
98
98
 
99
- RequirementParseError: Invalid requirement, parse error at "'-ipap11h'"
99
+ RequirementParseError: Invalid requirement, parse error at "'-ipap11h'"`
100
100
 
101
101
 
102
102
 
@@ -110,7 +110,7 @@
110
110
 
111
111
 
112
112
 
113
- ImportError Traceback (most recent call last)
113
+ `ImportError Traceback (most recent call last)
114
114
 
115
115
  /root/setup/gen_webstats.py in <module>()
116
116
 
@@ -124,9 +124,9 @@
124
124
 
125
125
  14 import matplotlib.pyplot as plt
126
126
 
127
+ ImportError: No module named scipy`
127
128
 
128
129
 
129
- ImportError: No module named scipy
130
130
 
131
131
  でます。
132
132
 
@@ -138,7 +138,7 @@
138
138
 
139
139
 
140
140
 
141
- Could not find platform dependent libraries <exec_prefix>
141
+ `Could not find platform dependent libraries <exec_prefix>
142
142
 
143
143
  Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
144
144
 
@@ -162,7 +162,7 @@
162
162
 
163
163
  import _io
164
164
 
165
- ImportError: No module named _io
165
+ ImportError: No module named _io`
166
166
 
167
167
 
168
168
 
@@ -174,8 +174,6 @@
174
174
 
175
175
  ここの部分だしてなどありましたら、掲載します。
176
176
 
177
- また、エラー文字がmarkdownにならずに見にくくなっていますが、すいません。
178
-
179
177
  ipythonだけでも2.7.5でできるようにしたいです。
180
178
 
181
179
  よろしくお願いします。

3

誤字

2016/07/30 16:14

投稿

gik
gik

スコア152

test CHANGED
@@ -1 +1 @@
1
- pyenvとpycharmについて(機械学習のため)
1
+ pyenvとpycharmについて
test CHANGED
@@ -1,4 +1,8 @@
1
- cent os7で今pythonをつかっております
1
+ cent os7で今pythonを機械学習でつかっております
2
+
3
+ python2.7.5とPython 3.5.1両方で機械学習のプログラムを書きたく
4
+
5
+ pyenv+pycharmを入れましたが。(3.5はできました)
2
6
 
3
7
 
4
8
 
@@ -164,4 +168,14 @@
164
168
 
165
169
  がでます。
166
170
 
167
- どのようにしたらpython2.7.5にパッケージを入れて、操作できるようになるのでしょうか?
171
+ どのようにしたらpython2.7.5にパッケージを入れて、できるようになるのでしょうか?
172
+
173
+
174
+
175
+ ここの部分だしてなどありましたら、掲載します。
176
+
177
+ また、エラー文字がmarkdownにならずに見にくくなっていますが、すいません。
178
+
179
+ ipythonだけでも2.7.5でできるようにしたいです。
180
+
181
+ よろしくお願いします。

2

誤字修正

2016/07/30 16:06

投稿

gik
gik

スコア152

test CHANGED
File without changes
test CHANGED
File without changes

1

誤字

2016/07/30 16:00

投稿

gik
gik

スコア152

test CHANGED
@@ -1 +1 @@
1
- pyenvとpycharmについて
1
+ pyenvとpycharmについて(機械学習のため)
test CHANGED
@@ -1,4 +1,6 @@
1
1
  cent os7で今pythonをつかっております
2
+
3
+
2
4
 
3
5
  pyenvで
4
6
 
@@ -11,6 +13,8 @@
11
13
  3.5.1
12
14
 
13
15
  とでるようになり
16
+
17
+
14
18
 
15
19
  python --version
16
20
 
@@ -44,11 +48,13 @@
44
48
 
45
49
 
46
50
 
47
- python --version
51
+ []# python --version
48
52
 
49
53
  Python 2.7.5
50
54
 
55
+
56
+
51
- [root@ichioka ~]# pip freeze
57
+ []#pip freeze
52
58
 
53
59
  Exception:
54
60
 
@@ -90,13 +96,17 @@
90
96
 
91
97
 
92
98
 
99
+
100
+
93
101
  とでます。
94
102
 
95
103
  python2.7.5でコードをかきたい場合パッケージがはいりません
96
104
 
97
105
  ipythonでも
98
106
 
107
+
108
+
99
- ImportError Traceback (most recent call last)
109
+ ImportError Traceback (most recent call last)
100
110
 
101
111
  /root/setup/gen_webstats.py in <module>()
102
112
 
@@ -122,7 +132,7 @@
122
132
 
123
133
  パッケージをインストールしようとすると
124
134
 
125
- '''
135
+
126
136
 
127
137
  Could not find platform dependent libraries <exec_prefix>
128
138
 
@@ -134,7 +144,9 @@
134
144
 
135
145
  retcode = do_untar(name)
136
146
 
137
- File "/opt/pycharm/pycharm-community-2016.2/helpers/packaging_tool.py", line 129, in do_untar
147
+ File "/opt/pycharm/pycharm-community-2016.2/helpers/packaging_tool.py", line 129, in
148
+
149
+ do_untar
138
150
 
139
151
  import tempfile
140
152
 
@@ -148,8 +160,8 @@
148
160
 
149
161
  ImportError: No module named _io
150
162
 
151
- '''
152
163
 
153
- がでます
154
164
 
155
- すいません、よろしくお願いします
165
+ ます
166
+
167
+ どのようにしたらpython2.7.5にパッケージを入れて、操作できるようになるのでしょうか?