【已解决】Nanodet/python setup.py develop时遇到的各种问题(①No module named ‘setuptools‘ ②‘directory not exit’)

在尝试在NVIDIA AGX Xavier上使用Nanodet进行目标检测时,遇到Python setup.py develop安装过程中权限和模块缺失的错误。错误提示指向了'/usr/lib/python3.8/site-packages/'目录的权限问题以及setuptools模块未找到。通过查看错误信息,发现在'/home/nvidia/.local/lib/python3.8/site-packages/'路径下已有setuptools,但安装过程却尝试在'/usr/lib/python3.8/site-packages/'路径下操作。使用sudo执行安装命令后,又出现了ModuleNotFoundError。解决方案是使用带-d选项指定正确路径并使用python3.8执行安装,最终成功解决问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

最近想在Nvidia AGX Xavier上用一下Nanodet来试一试他的目标检测,在配置环境过程中需要python setup.py develop。这时问题就来了。首先出现的是:

/home/nvidia/.local/lib/python3.8/site-packages/setuptools/dist.py:530: UserWarning: Normalizing '1.0.0-alpha'        to '1.0.0a0'
  warnings.warn(tmpl.format(**locals()))
running develop
/home/nvidia/.local/lib/python3.8/site-packages/setuptools/command/easy_install.py:144: EasyInstallDeprecation       Warning: easy_install command is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
/home/nvidia/.local/lib/python3.8/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning       : setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
error: can't create or remove files in install directory

The following error occurred while trying to add or remove files in the
installation directory:

    [Errno 13] Permission denied: '/usr/lib/python3.8/site-packages'

The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:

    /usr/lib/python3.8/site-packages/

This directory does not currently exist.  Please create it and try again, or
choose a different installation directory (using the -d or --install-dir
option).

我刚开始也没太仔细看,看到了Permission denied就想到了是不是权限问题,于是我使用了

sudo python setup.py develop

随后也会报错,报的是

Traceback (most recent call last):
  File "setup.py", line 2, in <module>
    from setuptools import find_packages, setup
ModuleNotFoundError: No module named 'setuptools'

这就奇怪了,我检查了包列表,并且重新下载了发现他还是显示有这个包的

这样我就仔细的开始看第一个报错了,发现其实他在代码中已经提示了。我的/home/nvidia/.local/lib/python3.8/site-packages/路径下是有setuptools的,但是运行过程中竟然去/usr/lib/python3.8/site-packages/这个下面找了,而且代码中提示用-d的或者-install进行处理。

随后我就在命令语句后加上了-d+正确的路径,并且使用了python3.8而不是python

python3.8  setup.py develop -d /home/nvidia/.local/lib/python3.8/site-packages/

随后成功,完美解决。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

EAZhaoLk

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值