Ubuntu 16.04 LTS,尝试使用 pip 安装 cpickle。我搜索了一下,还没有找到任何有用的东西。
PYTHONPATH 未设置。
错误信息
user@hostname:~$ sudo -H pip3 install cpickle
Collecting cpickle
Using cached cpickle-0.5.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python3.5/tokenize.py", line 454, in open
buffer = _builtin_open(filename, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-build-wn926hef/cpickle/setup.py'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-wn926hef/cpickle/
You are using pip version 8.1.1, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-q46tq1l8/cpickle/
You are using pip version 8.1.1, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
故障排除步骤
# version info
user@hostname:~$ python --version
Python 2.7.12
user@hostname:~$ python3 --version
Python 3.5.2
# I don't think cache is the problem
rm -rf ~/.cache/
sudo -H pip install cpickle --no-cache-dir # same problem
sudo -H pip3 install cpickle --no-cache-dir # same problem
原文由 invapid 发布,翻译遵循 CC BY-SA 4.0 许可协议
上网查了一下,发现了这个
这意味着在 Python3 中它作为一个库出现……
更新
正如 Invapid 在下面的评论中所说,这与上面的答案相似