我在我的Mac上的终端中输入了以下命令:sudo pip install python-docx --user。事情发生了,终端里的东西像疯了一样跳上跳下。突然..。一个错误!这让我有点恼火。接下来会出现以下内容:
error: can't copy 'docx/templates/default-docx-template': doesn't exist or not a regular file
----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-install-NbCMpP/python-docx/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/tmp/pip-record-rulxzG/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /private/tmp/pip-install-NbCMpP/python-docx/我只想让docx出现在我那该死的Pycharm Lib文件中。为什么坏事会发生在好人身上?提前谢谢。我完全是个初学者,所以假装你在和一个五岁的孩子说话。
发布于 2019-01-25 22:52:09
当您使用--user标志运行pip install时,软件包将安装在您的用户目录(as explained here)中。因此,您不需要超级用户权限,也不需要使用sudo。
你可以只运行:
pip install python-docx --user
而且可能会运行得很好(我在我的Mac上测试过,工作得很好)。
https://stackoverflow.com/questions/54367197
复制相似问题