简体   繁体   English

Python | 如何修复错误“NotADirectoryError: [Errno 20] Not a directory: '/usr/bin/python3/site-packages'”

[英]Python | How to fix the error “NotADirectoryError: [Errno 20] Not a directory: '/usr/bin/python3/site-packages'”

I am using macOS Big Sur and I've been having a problem with installing any python packages for a couple of days now.我正在使用 macOS Big Sur 并且几天来一直在安装任何 python 软件包时遇到问题。 This error happens everytime I try to install or uninstall a python package.每次我尝试安装或卸载 python package 时都会发生此错误。

I have tried using sudo as well, but the error persists.我也尝试过使用sudo ,但错误仍然存在。 Another solution that I have tried was to change the PATH variable to add the /usr/local/bin folder before the /usr/bin one, which contains brew's installation of python3, however that didn't help either.我尝试过的另一个解决方案是更改 PATH 变量以在 /usr/bin 之前添加 /usr/local/bin 文件夹,其中包含 brew 的 python3 安装,但这也无济于事。

Do you have any better suggestions?你有更好的建议吗?

You can locate the site-packages directory, by executing from command line:您可以通过从命令行执行来找到 site-packages 目录:

python -c 'import site; print(site.getsitepackages())'
['/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/site-python', '/Library/Python/2.7/site-packages']

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何解决 python 错误 NotADirectoryError: [Errno 20] Not a directory: - How to resolve python error NotADirectoryError: [Errno 20] Not a directory: NotADirectoryError:[Errno 20] 不是目录:“/home/ghost/automation/pwd/geckodriver”与 GeckoDrriver Firefox 和 Selenium 使用 Python3 - NotADirectoryError: [Errno 20] Not a directory: '/home/ghost/automation/pwd/geckodriver' with GeckoDrriver Firefox and Selenium using Python3 “PermissionError: [Errno 13] Permission denied: '/usr/lib/python3.5/site-packages'” 安装 Django - “PermissionError: [Errno 13] Permission denied: '/usr/lib/python3.5/site-packages'” installing Django Python3 setuptools bidst_rpm:删除/usr/lib/python3.x/site-packages前缀。 使rpm安装目录适应客户端计算机的python路径 - Python3 setuptools bidst_rpm : remove /usr/lib/python3.x/site-packages prefix. Adapt rpm install directory to client machine's python path 如何解决“ NotADirectoryError:[Errno 20]不是目录:”? - How to troubleshoot “NotADirectoryError: [Errno 20] Not a directory:”? 如何处理“ NotADirectoryError: [Errno 20] 不是目录:” - How to deal with " NotADirectoryError: [Errno 20] Not a directory: " python的站点包目录是什么? - What is python's site-packages directory? 使用CMake查找python site-packages目录 - Finding python site-packages directory with CMake 何时/如何在/ usr / local中将site-packages从/ usr更改为python sys.prefix? - When/how to change python sys.prefix from /usr when site-packages is in /usr/local? 如何为本地Python 2.7安装设置site-packages目录 - How to set site-packages directory for local Python 2.7 install
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM