简体   繁体   English

如何在ubuntu中安装django-channels?

[英]How to install django-channels in ubuntu?

I have tried to install django channels using this command. 我试图使用此命令安装Django频道。

pip install -U channels

but am getting this error 但出现此错误

Downloading/unpacking channels Downloading channels-2.0.2-py2.py3-none-any.whl Cleaning up... Exception: Traceback (most recent call last): File "/home/praneet/pral/myvenv/lib/python-wheels/setuptools-3.3-py2.py3-none-any.whl/pkg_resources.py", line 2482, in _dep_map return self. 下载/解压缩通道正在下载通道2.0.2-py2.py3-none-any.whl清理中...例外:追溯(最近一次通话是最后一次):文件“ / home / praneet / pral / myvenv / lib / python- _dep_map中的“ wheels / setuptools-3.3-py2.py3-none-any.whl / pkg_resources.py”行2482返回自身。 dep_map File "/home/praneet/pral/myvenv/lib/python-wheels/setuptools-3.3-py2.py3-none-any.whl/pkg_resources.py", line 2344, in __getattr raise AttributeError(attr) AttributeError: _DistInfoDistribution__dep_map dep_map文件“ /home/praneet/pral/myvenv/lib/python-wheels/setuptools-3.3-py2.py3-none-any.whl/pkg_resources.py”,第2344行,位于__getattr中,引发AttributeError(attr)AttributeError:_DistInfoDistribution__dep_map

During handling of the above exception, another exception occurred: 在处理上述异常期间,发生了另一个异常:

Traceback (most recent call last): File "/home/praneet/pral/myvenv/lib/python3.4/site-packages/pip/basecommand.py", line 122, in main status = self.run(options, args) File "/home/praneet/pral/myvenv/lib/python3.4/site-packages/pip/commands/install.py", line 278, in run requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle) File "/home/praneet/pral/myvenv/lib/python3.4/site-packages/pip/req.py", line 1266, in prepare_files req_to_install.extras): File "/home/praneet/pral/myvenv/lib/python-wheels/setuptools-3.3-py2.py3-none-any.whl/pkg_resources.py", line 2291, in requires dm = self._dep_map File "/home/praneet/pral/myvenv/lib/python-wheels/setuptools-3.3-py2.py3-none-any.whl/pkg_resources.py", line 2484, in _dep_map self.__dep_map = self._compute_dependencies() File "/home/praneet/pral/myvenv/lib/python-wheels/setuptools-3.3-py2.py3-none-any.whl/pkg_resources.py", line 2508, in _compute_dependencies parsed = next(parse_requirements(distvers)) File "/h 追溯(最近一次呼叫最近):文件“ /home/praneet/pral/myvenv/lib/python3.4/site-packages/pip/basecommand.py”,行122,处于主要状态= self.run(选项,参数)文件“ /home/praneet/pral/myvenv/lib/python3.4/site-packages/pip/commands/install.py”,第278行,在运行require_set.prepare_files(finder,force_root_egg_info = self.bundle,bundle = self.bundle)文件“ /home/praneet/pral/myvenv/lib/python3.4/site-packages/pip/req.py”,行1266,在prepare_files req_to_install.extras中):文件“ / home / praneet / pral /myvenv/lib/python-wheels/setuptools-3.3-py2.py3-none-any.whl/pkg_resources.py“,第2291行,要求dm = self._dep_map文件” / home / praneet / pral / myvenv / lib“ /python-wheels/setuptools-3.3-py2.py3-none-any.whl/pkg_resources.py“,第2484行,位于_dep_map self .__ dep_map = self._compute_dependencies()文件” / home / praneet / pral / myvenv / lib /python-wheels/setuptools-3.3-py2.py3-none-any.whl/pkg_resources.py“,第2508行,在_compute_dependencies中已解析= next(parse_requirements(distvers))文件” / h ome/praneet/pral/myvenv/lib/python-wheels/setuptools-3.3-py2.py3-none-any.whl/pkg_resources.py", line 2605, in parse_requirements line, p, specs = scan_list(VERSION,LINE_END,line,p,(1,2),"version spec") File "/home/praneet/pral/myvenv/lib/python-wheels/setuptools-3.3-py2.py3-none-any.whl/pkg_resources.py", line 2573, in scan_list raise ValueError("Expected "+item_name+" in",line,"at",line[p:]) ValueError: ('Expected version spec in', 'asgiref ~=2.1', 'at', ' ~=2.1') ome / praneet / pral / myvenv / lib / python-wheels / setuptools-3.3-py2.py3-none-any.whl / pkg_resources.py“,第2605行,位于parse_requirements行,p,specs = scan_list(VERSION,LINE_END,行,p,(1,2),“版本说明”)文件“ /home/praneet/pral/myvenv/lib/python-wheels/setuptools-3.3-py2.py3-none-any.whl/pkg_resources.py” ,在scan_list中的第2573行,引发ValueError(“在”,line,“ at”,line [p:]中的“预期的” + item_name +“”)ValueError:('在...中的预期版本规范,'asgiref〜= 2.1','at' ,'〜= 2.1')

Storing debug log for failure in /home/praneet/.pip/pip.log 在/home/praneet/.pip/pip.log中存储故障调试日志

I was also stuck with same issue. 我也遇到同样的问题。

Now,I have fixed it by installing following packages: 现在,我通过安装以下软件包来修复它:

python2 python2

sudo apt-get install python-dev python-pip libxml2-dev libxslt1-dev zlib1g-dev libffi-dev libssl-dev

python3 python3

sudo apt-get install python3-dev python3-pip libxml2-dev libxslt1-dev zlib1g-dev libffi-dev libssl-dev

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM