我正在尝试在一个virutal环境中安装django串行化器模块。它给了我一个错误,我不知道如何绕过它。我已经在2台计算机和一台vps上尝试了,并且得到了相同的错误。它可以在虚拟环境之外工作,但不能在内部工作。
下面是获得错误的原因:
mkdir test-pi;cd test-pi/;virtualenv -p python3;source bin/activate;pip install django-serializer;
这就是错误
ERROR: Command errored out with exit status 1:
command: /home/owner2/Dev/BELove/src/belove/test-pi/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-o2kpa85w/django-serializers/setup.py'"'"'; __file__='"'"'/tmp/pip-install-o2kpa85w/django-serializers/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-o2kpa85w/django-serializers/pip-egg-info
cwd: /tmp/pip-install-o2kpa85w/django-serializers/
Complete output (6 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-o2kpa85w/django-serializers/setup.py", line 56
print "You probably want to also tag the version now:"
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("You probably want to also tag the version now:")?
----------------------------------------错误:命令错误,退出状态为1: python setup.py egg_info检查日志以获取完整的命令输出。
发布于 2021-05-18 00:55:49
查看错误消息,它显示缺少print周围的括号。在python2中,允许不带括号的print语句,但在python3中删除了这些语句。
如果您仍然想安装这个包,那么创建一个使用python2作为解释器的虚拟环境,它应该可以工作。但我不建议这样做,因为对python2的官方支持已经在去年结束了。
发布于 2020-04-02 00:25:09
https://stackoverflow.com/questions/60975442
复制相似问题