質問編集履歴

4

追記

2018/06/26 08:18

投稿

grilled_python
grilled_python

スコア237

test CHANGED
File without changes
test CHANGED
@@ -1,3 +1,7 @@
1
+ ※パッチを追加した後を追記いたしました。
2
+
3
+
4
+
1
5
  pythonのライブラリを使用したかったのですがzlibというライブラリが必須ということでwindows10にインストールしたいです。cygwinを導入して、デスクトップにzipファイルを解凍。
2
6
 
3
7
  $ cd zlib-1.2.11
@@ -179,3 +183,225 @@
179
183
  ```
180
184
 
181
185
  などのエラーが出てしまいます。
186
+
187
+ ### cygwinの中にwopenが無いために起こるエラーに対するパッチを当てました。
188
+
189
+ [パッチ1](https://raw.githubusercontent.com/Alexpux/MSYS2-packages/master/zlib/1.2.11-cygwin-no-widechar.patch)
190
+
191
+ [パッチ2](https://github.com/Alexpux/MSYS2-packages/blob/master/zlib/1.2.7-zlib-symbols.patch)
192
+
193
+ こちらを当てた事で警告がでない様になり、インストールが上手くいった様に思えたので、今一度pip installを行いまいましたが、結果は同じエラーでした。
194
+
195
+ cygwinのコマンドとログを載せます。なにか根本的に間違っているのでしょうか?
196
+
197
+
198
+
199
+
200
+
201
+ $ cd zlib-1.2.11
202
+
203
+ $ ./configure
204
+
205
+ $ make
206
+
207
+ $ make install
208
+
209
+
210
+
211
+ ```ここに言語を入力
212
+
213
+ $ ./configure
214
+
215
+ Checking for gcc...
216
+
217
+ Checking for shared library support...
218
+
219
+ No shared library support.
220
+
221
+ Building static library libz.a version 1.2.11 with gcc.
222
+
223
+ Checking for size_t... Yes.
224
+
225
+ Checking for off64_t... No.
226
+
227
+ Checking for fseeko... Yes.
228
+
229
+ Checking for strerror... Yes.
230
+
231
+ Checking for unistd.h... Yes.
232
+
233
+ Checking for stdarg.h... Yes.
234
+
235
+ Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf().
236
+
237
+ Checking for vsnprintf() in stdio.h... Yes.
238
+
239
+ Checking for return value of vsnprintf()... Yes.
240
+
241
+ Checking for attribute(visibility) support... No.
242
+
243
+
244
+
245
+ ```
246
+
247
+ ```ここに言語を入力
248
+
249
+ $ make
250
+
251
+ gcc -O3 -I. -c -o example.o test/example.c
252
+
253
+ gcc -O3 -c -o adler32.o adler32.c
254
+
255
+ gcc -O3 -c -o crc32.o crc32.c
256
+
257
+ gcc -O3 -c -o deflate.o deflate.c
258
+
259
+ gcc -O3 -c -o infback.o infback.c
260
+
261
+ gcc -O3 -c -o inffast.o inffast.c
262
+
263
+ gcc -O3 -c -o inflate.o inflate.c
264
+
265
+ gcc -O3 -c -o inftrees.o inftrees.c
266
+
267
+ gcc -O3 -c -o trees.o trees.c
268
+
269
+ gcc -O3 -c -o zutil.o zutil.c
270
+
271
+ gcc -O3 -c -o compress.o compress.c
272
+
273
+ gcc -O3 -c -o uncompr.o uncompr.c
274
+
275
+ gcc -O3 -c -o gzclose.o gzclose.c
276
+
277
+ gcc -O3 -c -o gzlib.o gzlib.c
278
+
279
+ gcc -O3 -c -o gzread.o gzread.c
280
+
281
+ gcc -O3 -c -o gzwrite.o gzwrite.c
282
+
283
+ ar rc libz.a adler32.o crc32.o deflate.o infback.o inffast.o inflate.o inftrees.o trees.o zutil.o compress.o uncompr.o gzclose.o gzlib.o gzread.o gzwrite.o
284
+
285
+ gcc -O3 -o example.exe example.o -L. libz.a
286
+
287
+ gcc -O3 -I. -c -o minigzip.o test/minigzip.c
288
+
289
+ gcc -O3 -o minigzip.exe minigzip.o -L. libz.a
290
+
291
+
292
+
293
+ ```
294
+
295
+ ```ここに言語を入力
296
+
297
+ $ make install
298
+
299
+ rm -f /usr/local/lib/libz.a
300
+
301
+ cp libz.a /usr/local/lib
302
+
303
+ chmod 644 /usr/local/lib/libz.a
304
+
305
+ rm -f /usr/local/share/man/man3/zlib.3
306
+
307
+ cp zlib.3 /usr/local/share/man/man3
308
+
309
+ chmod 644 /usr/local/share/man/man3/zlib.3
310
+
311
+ rm -f /usr/local/lib/pkgconfig/zlib.pc
312
+
313
+ cp zlib.pc /usr/local/lib/pkgconfig
314
+
315
+ chmod 644 /usr/local/lib/pkgconfig/zlib.pc
316
+
317
+ rm -f /usr/local/include/zlib.h /usr/local/include/zconf.h
318
+
319
+ cp zlib.h zconf.h /usr/local/include
320
+
321
+ chmod 644 /usr/local/include/zlib.h /usr/local/include/zconf.h
322
+
323
+
324
+
325
+ ```
326
+
327
+ anacondaのenvにインストールしないと意味がないのではと思い。
328
+
329
+
330
+
331
+
332
+
333
+ $ cd zlib-1.2.11
334
+
335
+ $ ./configure --prefix=/users/jun/anaconda3/env/dds
336
+
337
+ $ make
338
+
339
+ $ make install
340
+
341
+ 結果は同じようです。
342
+
343
+
344
+
345
+ pycharmに戻りターミナルから
346
+
347
+ pip install django-dynamic-scraper
348
+
349
+ ログが長いので一部を抜粋
350
+
351
+ ```ここに言語を入力
352
+
353
+ (dds) C:\Users\Jun\PycharmProjects\dds>pip install django-dynamic-scraper
354
+
355
+ Collecting django-dynamic-scraper
356
+
357
+ ====================================
358
+
359
+ Building wheels for collected packages: pillow
360
+
361
+ Running setup.py bdist_wheel for pillow ... error
362
+
363
+ =======================================
364
+
365
+ ValueError: zlib is required unless explicitly disabled using --disable-zlib, aborting
366
+
367
+
368
+
369
+ ----------------------------------------
370
+
371
+ Failed building wheel for pillow
372
+
373
+ Running setup.py clean for pillow
374
+
375
+ Failed to build pillow
376
+
377
+ Installing collected packages: future, pillow, decorator, ply, six, jsonpath-rw, django-dynamic-scraper
378
+
379
+ Running setup.py install for pillow ... error
380
+
381
+ ======================================
382
+
383
+ ValueError: zlib is required unless explicitly disabled using --disable-zlib, aborting
384
+
385
+
386
+
387
+ ----------------------------------------
388
+
389
+ Command "C:\Users\Jun\Anaconda3\envs\dds\python.exe -u -c "import setuptools, tokenize;__file__='C:\Users\Jun\AppData\Local\T
390
+
391
+ emp\pip-install-nz0vhaly\pillow\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.clo
392
+
393
+ se();exec(compile(code, __file__, 'exec'))" install --record C:\Users\Jun\AppData\Local\Temp\pip-record-c2ybtkgm\install-record.tx
394
+
395
+ t --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Jun\AppData\Local\Temp\pip-install-nz0vhaly\
396
+
397
+ pillow\
398
+
399
+
400
+
401
+
402
+
403
+
404
+
405
+
406
+
407
+ ```

3

修正

2018/06/26 08:18

投稿

grilled_python
grilled_python

スコア237

test CHANGED
@@ -1 +1 @@
1
- zlibをwin10にンストールしたいのですがmake: *** [Makefile:289: example.exe] エラー 1
1
+ pythonブラリを使用したいのですがzlibが必要だと言われてしまう ValueError: zlib is required unless explicitly disabled using
test CHANGED
@@ -147,3 +147,35 @@
147
147
 
148
148
 
149
149
  ```
150
+
151
+ ### 使用したいライブラリを追記
152
+
153
+ django-dynamic-scraperというdjango上でscrapyを管理するライブラリです。
154
+
155
+ windows10
156
+
157
+ django1.11
158
+
159
+ Python3.4
160
+
161
+ pip install django-dynamic-scraperの段階で
162
+
163
+
164
+
165
+ ```ここに言語を入力
166
+
167
+
168
+
169
+ Failed building wheel for pillow
170
+
171
+
172
+
173
+
174
+
175
+ ValueError: zlib is required unless explicitly disabled using --disable-zlib, aborting
176
+
177
+
178
+
179
+ ```
180
+
181
+ などのエラーが出てしまいます。

2

修正

2018/06/25 10:59

投稿

grilled_python
grilled_python

スコア237

test CHANGED
File without changes
test CHANGED
@@ -52,35 +52,65 @@
52
52
 
53
53
  ```ここに言語を入力
54
54
 
55
- $ ./configure --shared
55
+ $ make
56
56
 
57
- Checking for gcc...
57
+ gcc -O3 -I. -c -o example.o test/example.c
58
58
 
59
- Checking for shared library support...
59
+ gcc -O3 -c -o adler32.o adler32.c
60
60
 
61
- No shared library support.
61
+ gcc -O3 -c -o crc32.o crc32.c
62
62
 
63
- Building static library libz.a version 1.2.11 with gcc.
63
+ gcc -O3 -c -o deflate.o deflate.c
64
64
 
65
- Checking for size_t... Yes.
65
+ gcc -O3 -c -o infback.o infback.c
66
66
 
67
- Checking for off64_t... No.
67
+ gcc -O3 -c -o inffast.o inffast.c
68
68
 
69
- Checking for fseeko... Yes.
69
+ gcc -O3 -c -o inflate.o inflate.c
70
70
 
71
- Checking for strerror... Yes.
71
+ gcc -O3 -c -o inftrees.o inftrees.c
72
72
 
73
- Checking for unistd.h... Yes.
73
+ gcc -O3 -c -o trees.o trees.c
74
74
 
75
- Checking for stdarg.h... Yes.
75
+ gcc -O3 -c -o zutil.o zutil.c
76
76
 
77
- Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf().
77
+ gcc -O3 -c -o compress.o compress.c
78
78
 
79
- Checking for vsnprintf() in stdio.h... Yes.
79
+ gcc -O3 -c -o uncompr.o uncompr.c
80
80
 
81
- Checking for return value of vsnprintf()... Yes.
81
+ gcc -O3 -c -o gzclose.o gzclose.c
82
82
 
83
+ gcc -O3 -c -o gzlib.o gzlib.c
84
+
85
+ gzlib.c: 関数 ‘gz_open’ 内:
86
+
87
+ gzlib.c:243:20: 警告: implicit declaration of function ‘_wopen’; did you mean ‘f wopen’? [-Wimplicit-function-declaration]
88
+
89
+ fd == -2 ? _wopen(path, oflag, 0666) :
90
+
91
+ ^~~~~~
92
+
93
+ fwopen
94
+
95
+ gcc -O3 -c -o gzread.o gzread.c
96
+
97
+ gcc -O3 -c -o gzwrite.o gzwrite.c
98
+
99
+ ar rc libz.a adler32.o crc32.o deflate.o infback.o inffast.o inflate.o inftrees. o trees.o zutil.o compress.o uncompr.o gzclose.o gzlib.o gzread.o gzwrite.o
100
+
83
- Checking for attribute(visibility) support... No.
101
+ gcc -O3 -o example.exe example.o -L. libz.a
102
+
103
+ libz.a(gzlib.o):gzlib.c:(.text+0xab2): `_wopen' に対する定義されていない参照です
104
+
105
+ libz.a(gzlib.o):gzlib.c:(.text+0xab2): 再配置がオーバーフローしないように切り詰 められました: R_X86_64_PC32 (未定義シンボル `_wopen' に対して)
106
+
107
+ libz.a(gzlib.o):gzlib.c:(.text+0xc50): `_wopen' に対する定義されていない参照です
108
+
109
+ libz.a(gzlib.o):gzlib.c:(.text+0xc50): 再配置がオーバーフローしないように切り詰 められました: R_X86_64_PC32 (未定義シンボル `_wopen' に対して)
110
+
111
+ collect2: エラー: ld はステータス 1 で終了しました
112
+
113
+ make: *** [Makefile:289: example.exe] エラー 1
84
114
 
85
115
 
86
116
 

1

修正

2018/06/24 13:18

投稿

grilled_python
grilled_python

スコア237

test CHANGED
@@ -1 +1 @@
1
- ブラリインストール時に Failed building wheel for pillow
1
+ zlibをwin10にインストールしたいのですがmake: *** [Makefile:289: example.exe] エラー 1
test CHANGED
@@ -1,75 +1,119 @@
1
- django上でscrapyを管理るdjango-dynamic-scraper(以下DDS)というライブラリインストールしたいですpip install でいきなり躓きました
1
+ pythonのライブラリ使用したかったのでがzlibというライブラリが必須ということでwindows10にインストールしたいです。cygwinを導入してデスクトップにzipファイルを解凍
2
+
3
+ $ cd zlib-1.2.11
4
+
5
+ $ ./configure --shared
6
+
7
+ $ make
8
+
9
+ $ make install
10
+
11
+ の順番でコマンド実行したのですが、makeの部分でエラーが出てしまいました。
12
+
13
+ どのように対処すればいいでしょうか。
2
14
 
3
15
 
4
16
 
5
- 教えていただきたい事
17
+ ```
6
18
 
19
+ $ ./configure --shared
20
+
21
+ Checking for gcc...
22
+
23
+ Checking for shared library support...
24
+
7
- windowsへのzlibのインストール方法
25
+ No shared library support.
26
+
27
+ Building static library libz.a version 1.2.11 with gcc.
28
+
29
+ Checking for size_t... Yes.
30
+
31
+ Checking for off64_t... No.
32
+
33
+ Checking for fseeko... Yes.
34
+
35
+ Checking for strerror... Yes.
36
+
37
+ Checking for unistd.h... Yes.
38
+
39
+ Checking for stdarg.h... Yes.
40
+
41
+ Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf().
42
+
43
+ Checking for vsnprintf() in stdio.h... Yes.
44
+
45
+ Checking for return value of vsnprintf()... Yes.
46
+
47
+ Checking for attribute(visibility) support... No.
8
48
 
9
49
 
10
50
 
11
- windows 10
51
+ ```
12
52
 
13
- django 1.11
53
+ ```ここに言語を入力
14
54
 
55
+ $ ./configure --shared
56
+
15
- python3.4.5
57
+ Checking for gcc...
58
+
59
+ Checking for shared library support...
60
+
61
+ No shared library support.
62
+
63
+ Building static library libz.a version 1.2.11 with gcc.
64
+
65
+ Checking for size_t... Yes.
66
+
67
+ Checking for off64_t... No.
68
+
69
+ Checking for fseeko... Yes.
70
+
71
+ Checking for strerror... Yes.
72
+
73
+ Checking for unistd.h... Yes.
74
+
75
+ Checking for stdarg.h... Yes.
76
+
77
+ Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf().
78
+
79
+ Checking for vsnprintf() in stdio.h... Yes.
80
+
81
+ Checking for return value of vsnprintf()... Yes.
82
+
83
+ Checking for attribute(visibility) support... No.
16
84
 
17
85
 
18
86
 
87
+ ```
19
88
 
89
+ ```ここに言語を入力
20
90
 
21
- [DDSのドキュメント](http://django-dynamic-scraper.readthedocs.io/en/latest/index.html)
91
+ $ make install
22
92
 
93
+ rm -f /usr/local/lib/libz.a
94
+
95
+ cp libz.a /usr/local/lib
96
+
97
+ chmod 644 /usr/local/lib/libz.a
98
+
99
+ rm -f /usr/local/share/man/man3/zlib.3
100
+
101
+ cp zlib.3 /usr/local/share/man/man3
102
+
103
+ chmod 644 /usr/local/share/man/man3/zlib.3
104
+
105
+ rm -f /usr/local/lib/pkgconfig/zlib.pc
106
+
107
+ cp zlib.pc /usr/local/lib/pkgconfig
108
+
109
+ chmod 644 /usr/local/lib/pkgconfig/zlib.pc
110
+
111
+ rm -f /usr/local/include/zlib.h /usr/local/include/zconf.h
112
+
113
+ cp zlib.h zconf.h /usr/local/include
114
+
23
- [githubのissues](https://github.com/holgerd77/django-dynamic-scraper/issues)
115
+ chmod 644 /usr/local/include/zlib.h /usr/local/include/zconf.h
24
116
 
25
117
 
26
118
 
27
- pip install django-dynamic-scraperをコマンドした後のメッセージの抜粋
28
-
29
-
30
-
31
- Building wheels for collected packages: pillow
32
-
33
- Running setup.py bdist_wheel for pillow ... error
34
-
35
-
36
-
37
-
38
-
39
-
40
-
41
- Failed building wheel for pillow
42
-
43
-
44
-
45
- ValueError: zlib is required unless explicitly disabled using --disable-zlib, aborting
46
-
47
-
48
-
49
- などのエラーが見受けられます。
50
-
51
-
52
-
53
- スタックオーバーフローなどを検索した結果。zlibを無効にするか、インストールをするかどちらかが解決方法のようですが、zlibのzipファイルをダウンロードしてきたのですが、中をのぞくと無数の似たような名前のファイルがあり、windowsのインストール方法もよく理解できませんでした。
54
-
55
- [zlibダウンロードサイト](hhttps://zlib.net/)
56
-
57
-
58
-
59
- 試した解決方法
119
+ ```
60
-
61
-
62
-
63
- pip install django-dynamic-scraper --global-option="disable-zlib"
64
-
65
-
66
-
67
- Single threaded build for windows
68
-
69
- invalid command name 'disable-zlib'
70
-
71
-
72
-
73
- windowsへのzlibのインストール方法を教えていただけないでしょうか?
74
-
75
- よろしくお願いいたします。