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

最近想在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 
    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/

随后成功,完美解决。

你可能感兴趣的:(python,开发语言,目标检测)