python-3.x - 安装 pip install 'python-decouple' 时出错
问题描述
Collecting python-decouple
Using cached python-decouple-3.3.tar.gz (10 kB)
Using legacy setup.py install for python-decouple, since package 'wheel' is not installed.
Installing collected packages: python-decouple
Running setup.py install for python-decouple ... error
ERROR: Command errored out with exit status 1:
command: 'c:\python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\slms_\\AppData\\Local\\Temp\\pip-install-awe0dvrf\\python-decouple\\setup.py'"'"'; __file__='"'"'C:\\Users\\slms_\\AppData\\Local\\Temp\\pip-install-awe0dvrf\\python-decouple\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\slms_\AppData\Local\Temp\pip-record-aljfw6bc\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\python38\Include\python-decouple'
cwd: C:\Users\slms_\AppData\Local\Temp\pip-install-awe0dvrf\python-decouple\
Complete output (16 lines):
running install
running build
running build_py
creating build
creating build\lib
copying decouple.py -> build\lib
running egg_info
writing python_decouple.egg-info\PKG-INFO
writing dependency_links to python_decouple.egg-info\dependency_links.txt
writing top-level names to python_decouple.egg-info\top_level.txt
reading manifest file 'python_decouple.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'python_decouple.egg-info\SOURCES.txt'
running install_lib
byte-compiling c:\python38\Lib\site-packages\decouple.py to decouple.cpython-38.pyc
error: [Errno 13] Permission denied: 'c:\\python38\\Lib\\site-packages\\__pycache__\\decouple.cpython-38.pyc.2802584858032'
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\slms_\\AppData\\Local\\Temp\\pip-install-awe0dvrf\\python-decouple\\setup.py'"'"'; __file__='"'"'C:\\Users\\slms_\\AppData\\Local\\Temp\\pip-install-awe0dvrf\\python-decouple\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\slms_\AppData\Local\Temp\pip-record-aljfw6bc\install-rec
解决方案
您显然缺乏进行安装的权限,您可以使用venv或以管理员身份运行 cmd(idk 我不使用 Windows)
要设置 venv,请在启动 cmd 时在项目目录中运行以下命令
C:\> python3 -m venv ./.venv
然后运行你的安装脚本
推荐阅读
- spring - 远程分区的 2 个步骤 - 春季批处理
- php - $_POST 返回空我该如何解决这个错误?
- python - Wagtail 如何渲染图像:无法识别的操作:原始
- macos - 为什么来自 /dev/null 的 ioctl FIONREAD 在 Mac OS X 上返回 0 而在 Linux 上返回随机数?
- selenium - Selenium 和 Docker:我无法加载自定义 chrome 用户配置文件
- java - 应用在 recyclerViewPager 上运行时不显示内容
- python - 在我的旋转矩阵代码中找不到错误
- docker - docker版本和docker引擎版本一样吗?如何分别检查?
- node.js - Koa 端点总是返回 404
- pandas - 如果列的值在熊猫中有值,如何将函数应用于行