Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

跑出這個東西 #9

Open
s4028600 opened this issue May 6, 2017 · 13 comments
Open

跑出這個東西 #9

s4028600 opened this issue May 6, 2017 · 13 comments

Comments

@s4028600
Copy link

s4028600 commented May 6, 2017

File "DMHY_DataBase.py", line 45
print "type:", type
^
SyntaxError: Missing parentheses in call to 'print'

雖然我也不清楚前面的操作對不對

@fno2010
Copy link
Collaborator

fno2010 commented May 6, 2017

@s4028600 因为你用的Python3,目前的脚本看起来是基于Python2.7的,和Python3不兼容

@s4028600
Copy link
Author

s4028600 commented May 6, 2017

我是用這裡的PY檔案
https://github.com/VijayQin/DMHY-spider/archive/master.zip
我改用2.7後點兩下畫面一閃就不見了

如果用python DMHY_DataBase.py
他會跑出
D:\python>python DMHY_DataBase.py
'python' 不是內部或外部命令、可執行的程式或批次檔。

對檔案點右鍵用Edit with IDLE
點F5後跑出這個
Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:42:59) [MSC v.1500 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.

==================== RESTART: D:\python\DMHY_DataBase.py ====================

完全不知道怎麼辦……

@fno2010
Copy link
Collaborator

fno2010 commented May 6, 2017

@s4028600 在windows里使用Python,你至少需要 follow 这个链接 里的 3.3.1 和 3.3.2。

不过原作者(@VijayQin)这个很懒的家伙说由于动漫花园网站有更新,目前这个脚本可能有 bug。可能有生之年会更新吧……

@s4028600
Copy link
Author

s4028600 commented May 6, 2017

@fno2010
那拜託可不可以教學一下
或是介紹一下其他可以爬花園種子的程式…
求大神了

@VijayQin
Copy link
Owner

VijayQin commented May 6, 2017

@s4028600
抱歉最近有paper的DDL無法及時做升級。
敬請期待預定下個月發佈的2.0版本。

@nephidog
Copy link

nephidog commented Apr 17, 2020

不好意思我用3python3.8跟2.7都會出現
File "C:\Users\Nephi\Desktop\爬蟲\DMHY-spider-master\DMHY-spider-master\DMHY_DataBase.py", line 45
print "type:", type
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("type:", type)?
請按任意鍵繼續 . . .
然後就閃退了,請問有解決的辦法嗎?

@fno2010
Copy link
Collaborator

fno2010 commented Apr 17, 2020

不好意思我用3python3.8跟2.7都會出現
File "C:\Users\Nephi\Desktop\爬蟲\DMHY-spider-master\DMHY-spider-master\DMHY_DataBase.py", line 45
print "type:", type
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("type:", type)?
請按任意鍵繼續 . . .
然後就閃退了,請問有解決的辦法嗎?

@nephidog 应该只有Python3会报这个错,因为脚本用的python2的语法,只能用python2跑(其实应该是懒得更新了

话说这个项目还在维护吗?仅供学习参考,别对功能有太多期待。。。

@nephidog
Copy link

在CMD中輸入python 會跑出
C:\Users\Nephi>python
Python 2.7.6 (default, Nov 10 2013, 19:24:24) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

所以應該是2.7沒錯

然後我開啟後會出現22行錯誤
Traceback (most recent call last):
File "C:\Users\Nephi\Desktop\爬蟲\DMHY-spider-master\DMHY-spider-master\DMHY_DataBase.py", line 22, in
import requests
ImportError: No module named requests
請按任意鍵繼續 . . .

@nephidog
Copy link

後來發現是有些插件沒裝,淡妝完插件後會跑編碼問題
Traceback (most recent call last):
File "C:\Users\Nephi\Desktop\DMHY-spider-master\DMHY_DataBase.py", line 11, in
codecs.register(cp65001)
NameError: name 'codecs' is not defined

@fno2010
Copy link
Collaborator

fno2010 commented Apr 17, 2020

interesting... code第11行和你的报错也对不上啊,你改code了吗?

@nephidog
Copy link

可以了,我WIN10到語言跟時區那邊改成UTF-8之後用CMD打開DMHY_DataBase.py就沒抱錯了,謝謝你~

@VijayQin
Copy link
Owner

@fno2010 hhhh好久没有维护了

@fno2010
Copy link
Collaborator

fno2010 commented Apr 29, 2020

@VijayQin dmhy已经有自己的app了,并且应该不用爬网页,可以直接读数据库,效率应该更高

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants