【发布时间】:2020-07-17 14:34:48
【问题描述】:
我正在尝试在 Debian 10 中从 Python3 导入 tkSnack。
我已经从 apt 安装了 tkSnack:
apt-get install python3-tksnack
无论如何,当尝试从 python3 导入 tkSnack 模块时:
ModuleNotFoundError: No module named 'tkSnack'
我也尝试过从pip安装tkSnack,但是出现如下错误信息:
ERROR: Command errored out with exit status 1:
command: /home/cooper/anaconda3/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-x8rnbcp1/snack/setup.py'"'"'; __file__='"'"'/tmp/pip-install-x8rnbcp1/snack/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-x8rnbcp1/snack/pip-egg-info
cwd: /tmp/pip-install-x8rnbcp1/snack/
Complete output (6 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-x8rnbcp1/snack/setup.py", line 47
print GCC_VERSION
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(GCC_VERSION)?
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
奇怪的是,在python2.7中导入tkSnack时一切正常!
有人对此有任何想法吗?谢谢!
【问题讨论】:
标签: python-3.x python-2.7 import module pip