python - 无法安装 python ast
问题描述
我有python 3.6。我正在尝试使用以下方法安装 ast 库:
sudo pip3 install ast
我收到了这个错误,我不知道为什么以及如何解决它。
WARNING: The directory '/home/x/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. WARNING: The directory '/home/x/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. Collecting ast Downloading https://files.pythonhosted.org/packages/4b/fb/2b954d2a38c9a0ef1da6a46737a75b4dbf6f60e5dad0f267a4ec5ece20de/AST-0.0.2.tar.gz
ERROR: Complete output from command python setup.py egg_info:
ERROR: Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-72e5wirc/ast/setup.py", line 6, in <module>
README = codecs.open(os.path.join(here, 'AST/README'), encoding='utf8').read()
File "/usr/local/lib/python3.6/codecs.py", line 897, in open
file = builtins.open(filename, mode, buffering)
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-install-72e5wirc/ast/AST/README'
---------------------------------------- ERROR: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-72e5wirc/ast/
解决方案
ast 默认包含在 python 中,无需安装。 https://docs.python.org/3/library/ast.html
推荐阅读
- php - 基于多维数组生成标记
- python - 如何将列的值复制到新列中
- java - PicoCLI:如何将 @ArgGroup 用于 CommandLine.Command 方法
- amazon - 无法在 Amazon Sagemaker Ground Truth 中加载图像
- excel - 有没有办法让代码重新等待就绪状态?
- java - 为什么我不能在正则表达式 Java 中重复组?
- sql - 用于比较和汇总数据的 CASE 语句的替代方案
- javascript - Discord JS:部署命令
- express - 在 minikube 中运行的快速服务中使用 Redis
- ios - 增强现实应用程序因致命错误而崩溃:在隐式展开可选值时意外发现 nil