python 同樣的代碼在linux和windows運行結果不同 ,求大佬指點 第一個是windows 運行結果,成功了,第二個是linux運行結果,503錯誤,我換了個服務器一樣的結果,求大佬指點,就是這個網址有問題

uj5u.com熱心網友回復:
(pythonenv) [andy@star Downloads]$ python request.py<Response [200]>
(pythonenv) [andy@star Downloads]$ cat request.py
import requests
url = "http://ip138.com/ips138.asp"
kw2 = {"ip": "116.230.228.152"}
r = requests.request('GET', url, params=kw2)
print(r)
我的在Linux運行沒問題啊
uj5u.com熱心網友回復:
能問下你的python版本是多少嗎?uj5u.com熱心網友回復:
下面是我的python和requests版本,我覺得和python版本沒關系。
(pythonenv) [andy@star Downloads]$ python --version
Python 3.7.4
(pythonenv) [andy@star Downloads]$ pip list | grep -i requests
requests 2.21.0
uj5u.com熱心網友回復:
能問下你的python版本是多少嗎?
(pythonenv) [andy@star Downloads]$ python request.py
<Response [200]>
(pythonenv) [andy@star Downloads]$ cat request.py
import requests
url = "http://ip138.com/ips138.asp"
kw2 = {"ip": "116.230.228.152"}
r = requests.request('GET', url, params=kw2)
print(r)
我的在Linux運行沒問題啊
下面是我的python和requests版本,我覺得和python版本沒關系。
(pythonenv) [andy@star Downloads]$ python --version
Python 3.7.4
(pythonenv) [andy@star Downloads]$ pip list | grep -i requests
requests 2.21.0
我的windows python 版本是3.6.7 linux版本是3.6.5 我換了一個服務器 這個也是不行的 所以我想先試試看看版本有沒有影響
uj5u.com熱心網友回復:
能問下你的python版本是多少嗎?
(pythonenv) [andy@star Downloads]$ python request.py
<Response [200]>
(pythonenv) [andy@star Downloads]$ cat request.py
import requests
url = "http://ip138.com/ips138.asp"
kw2 = {"ip": "116.230.228.152"}
r = requests.request('GET', url, params=kw2)
print(r)
我的在Linux運行沒問題啊
下面是我的python和requests版本,我覺得和python版本沒關系。
(pythonenv) [andy@star Downloads]$ python --version
Python 3.7.4
(pythonenv) [andy@star Downloads]$ pip list | grep -i requests
requests 2.21.0
我的windows python 版本是3.6.7 linux版本是3.6.5 我換了一個服務器 這個也是不行的 所以我想先試試看看版本有沒有影響
requests版本一樣嗎?
uj5u.com熱心網友回復:
能問下你的python版本是多少嗎?
(pythonenv) [andy@star Downloads]$ python request.py
<Response [200]>
(pythonenv) [andy@star Downloads]$ cat request.py
import requests
url = "http://ip138.com/ips138.asp"
kw2 = {"ip": "116.230.228.152"}
r = requests.request('GET', url, params=kw2)
print(r)
我的在Linux運行沒問題啊
下面是我的python和requests版本,我覺得和python版本沒關系。
(pythonenv) [andy@star Downloads]$ python --version
Python 3.7.4
(pythonenv) [andy@star Downloads]$ pip list | grep -i requests
requests 2.21.0
我的windows python 版本是3.6.7 linux版本是3.6.5 我換了一個服務器 這個也是不行的 所以我想先試試看看版本有沒有影響
requests版本一樣嗎?
我把python版本和requests版本升級以后 還是一樣的問題
uj5u.com熱心網友回復:
能問下你的python版本是多少嗎?
(pythonenv) [andy@star Downloads]$ python request.py
<Response [200]>
(pythonenv) [andy@star Downloads]$ cat request.py
import requests
url = "http://ip138.com/ips138.asp"
kw2 = {"ip": "116.230.228.152"}
r = requests.request('GET', url, params=kw2)
print(r)
我的在Linux運行沒問題啊
下面是我的python和requests版本,我覺得和python版本沒關系。
(pythonenv) [andy@star Downloads]$ python --version
Python 3.7.4
(pythonenv) [andy@star Downloads]$ pip list | grep -i requests
requests 2.21.0
我的windows python 版本是3.6.7 linux版本是3.6.5 我換了一個服務器 這個也是不行的 所以我想先試試看看版本有沒有影響
requests版本一樣嗎?
我把python版本和requests版本升級以后 還是一樣的問題
我用 curl http://ip138.com/ips138.asp?ip=116.230.228.152
出來的資料也不對
uj5u.com熱心網友回復:
能問下你的python版本是多少嗎?
(pythonenv) [andy@star Downloads]$ python request.py
<Response [200]>
(pythonenv) [andy@star Downloads]$ cat request.py
import requests
url = "http://ip138.com/ips138.asp"
kw2 = {"ip": "116.230.228.152"}
r = requests.request('GET', url, params=kw2)
print(r)
我的在Linux運行沒問題啊
下面是我的python和requests版本,我覺得和python版本沒關系。
(pythonenv) [andy@star Downloads]$ python --version
Python 3.7.4
(pythonenv) [andy@star Downloads]$ pip list | grep -i requests
requests 2.21.0
我的windows python 版本是3.6.7 linux版本是3.6.5 我換了一個服務器 這個也是不行的 所以我想先試試看看版本有沒有影響
requests版本一樣嗎?
我把python版本和requests版本升級以后 還是一樣的問題
你在Linux上手動打開這個網頁看看有沒有問題。
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/60393.html
標籤:實用資料發布區
上一篇:安裝fontforge-pdf2htmlEX報錯,編譯的時候出錯
下一篇:裝Ubuntu系統出錯
