Wildog / douban-exporter

An online service to export 豆瓣 (douban) data to Excel files.
200 stars 38 forks source link

NameError: global name 'count_lock' is not defined #8

Closed xoyabc closed 6 years ago

xoyabc commented 6 years ago

The detailed error message is as follows.

C:\Users\username\Downloads\douban-exporter-master>python exporter.py
Process Process-2:
Traceback (most recent call last):
  File "C:\Python27\lib\multiprocessing\process.py", line 267, in _bootstrap
    self.run()
  File "C:\Python27\lib\multiprocessing\process.py", line 114, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\xiaohui.lou\Downloads\douban-exporter-master\exporter.py", line
 363, in export
    with count_lock:
NameError: global name 'count_lock' is not defined

Hope you can give me some help if it is convenient to you.

Wildog commented 6 years ago

As said in README, this project doesn't work on Windows currently.

xoyabc commented 6 years ago

@Wildog I'm sorry to disturb you so much.

xoyabc commented 6 years ago

@Wildog Can you tell me why it is not available on Windows? Component support or any other reason?

Wildog commented 6 years ago

@xoyabc It's the problem of multiprocessing behaves differently on Unix and Windows. multiprocessing uses fork() to spawn new processes on Unix but not on Windows. Necessary changes must be made to share memory between processes on Windows. I don't work on Windows and I don't have the time to develop and test on Windows. Also this project is somewhat on halt, due to Douban's more restrict policy on anti crawler. Introducing proxy pool to this project might be the sole solution. But I'm currently busy and might not be able to spare my time on this project.

xoyabc commented 6 years ago

@Wildog Thanks for your detailed explanation.