我正在使用已安装Python 2.6的VPS。但是,我想使用Python 2.7。我已经安装了它,并且可以看到它已经安装,因为当我运行curl
时,响应为from kivy.network.urlrequest import UrlRequest
def success(req, result):
print('success')
def fail(req, result):
print('fail')
def error(req, result):
print('error')
def progress(req, result, chunk):
print('loading')
req = UrlRequest('http://123.12.123.xxx:1234/name/foo.json', on_success=success, on_failure=fail, on_error=error, on_progress=progress)
#>>
#<UrlRequest(Thread-1, started daemon 12792)>
#Press any key to continue . . .
# If using 'curl' command then success.
#{
# "ResultSet": {
# "Result": {
# "Greeting": "Hello foo from flask!"
# }
# }
#}
。然后,我尝试通过pip(which python
)安装软件包,从错误中可以看到我的系统正在使用Python 2.6:
~/python/Python-2.7.2/python
然后我输入pip install sysconfig
,响应为:
File "/usr/bin/pip", line 5, in <module>
from pkg_resources import load_entry_point
File "/home/me/.local/lib/python2.6/site-packages/pkg_resources/__init__.py", line 959, in <module>
所以...看来我没有像我想的那样访问2.7。然后,我尝试了:
whereis python
,并且出现命令未找到错误。可能需要在某处添加一个路径,以便可以找到命令python2.7,以便可以将软件包安装到我的Python 2.7文件夹中。