Those pits installed by Pyspider (solve all your problems)

 The problems encountered in installing Pyspide can basically be solved by searching for error messages on search engines.

Common problems and solutions are as follows:

1. In the new version of Python (after version 3.7), async becomes a keyword and cannot be used as a variable name, so the async variable in 
related files ( run.py , tornado_fetcher.py, webui> app.py ) should be changed to an alias, such as shark

2. The directory of phantomjs needs to be added to the environment variable Path of the system.

3. ImportError: cannot import name 'DispatcherMiddleware'错误:
pip uninstall tool
python -m pip install tool==0.16.1

4. Flask version is too high:
pip uninstall flask
then pip install flask==1.0

5. It stays at result_worker starting...
You can open two command lines in succession and start pyspider all. As long as the interval between the two is short enough, it will basically succeed.
So you can make a .bat file, enter three lines of start cmd /c pyspider all, and then double-click to execute.
One of the pitfalls I encountered was that when the bat file was executed, the system popped up infinitely. Then I asked in various groups, but no one answered. Baidu's various searches, the results all tell you how to write bat files with infinite pop-up windows. After tossing for a long time, I finally found the result on Google. The reason is that the bat file name pyspider.bat and the command in the file have the same name. It's too much, but it's still great to say that Google is amazing.
Change the bat file name and execute it.

Finally, after the above problems are solved,
the command line input:
pyspider all

 Browser input: http://localhost:5000/

Guess you like

Origin blog.csdn.net/weixin_45387160/article/details/122438577