pip3 install -U django-socketio输出以下错误python版本在这个环境下是3.4.3。当我尝试在python 3.5或更高版本上安装django频道时,会出现同样的情况
Collecting django-socketio
Downloading django-socketio-0.3.9.tar.gz (48kB)
100% |████████████████████████████████| 51kB 204kB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-j3y67yvi/django-socketio/setup.py", line 7, in <module>
version = __import__("django_socketio").__version__,
File "/tmp/pip-build-j3y67yvi/django-socketio/django_socketio/__init__.py", line 2, in <module>
from django_socketio.utils import NoSocket, send, broadcast, broadcast_channel
File "/tmp/pip-build-j3y67yvi/django-socketio/django_socketio/utils.py", line 44
except IndexError, KeyError:
^
SyntaxError: invalid syntax
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-j3y67yvi/django-socketio/
答案 0 :(得分:4)
我尝试使用pip安装它,但我没有成功。
你能做的是: 1)从GitHub下载Source Code到你想要文件的位置
git clone https://github.com/stephenmcd/django-socketio
2)解压缩并进入django-socketio目录 3)运行:
python3 setup.py install
您可以通过运行命令来检查它是否已安装:
pip3 freeze
希望这有帮助!