Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: install_layout #1677

Closed
yulubin opened this issue Nov 18, 2019 · 10 comments
Closed

AttributeError: install_layout #1677

yulubin opened this issue Nov 18, 2019 · 10 comments

Comments

@yulubin
Copy link

yulubin commented Nov 18, 2019

Thanks for your error report and we appreciate it a lot.

Checklist

  1. I have searched related issues but cannot get the expected help.
  2. The bug has not been fixed in the latest version.

Describe the bug
I follow the step in the INSTALL.md, after I type 'python setup.py develop' in the terminal, the terminal show the error.

Reproduction

  1. What command or script did you run?
python setup.py develop
  1. Did you make any modifications on the code or config? Did you understand what you have modified?
    No
  2. What dataset did you use?
    default
    Environment
  • OS: Ubuntu 16
  • GCC 5.4.0
  • PyTorch version 1.2.0
  • How you installed PyTorch conda
  • GPU model M5000
  • CUDA and CUDNN version CUDA 10 CUDNN 7.6.4

Error traceback
If applicable, paste the error trackback here.

(ylb) scut@scut-PC:~/mmskeleton$ python setup.py develop
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 353, in fetch_build_egg
cmd = self._egg_fetcher
AttributeError: 'Distribution' object has no attribute '_egg_fetcher'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "setup.py", line 174, in
zip_safe=False)
File "/home/scut/miniconda3/envs/ylb/lib/python3.7/distutils/core.py", line 108, in setup
_setup_distribution = dist = klass(attrs)
File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 269, in init
self.fetch_build_eggs(attrs['setup_requires'])
File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 313, in fetch_build_eggs
replace_conflicting=True,
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 826, in resolve
dist = best[req.key] = env.best_match(req, ws, installer)
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 1092, in best_match
return self.obtain(req, installer)
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 1104, in obtain
return installer(requirement)
File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 378, in fetch_build_egg
cmd.ensure_finalized()
File "/home/scut/miniconda3/envs/ylb/lib/python3.7/distutils/cmd.py", line 107, in ensure_finalized
self.finalize_options()
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 289, in finalize_options
'install_lib', ('install_dir', 'install_dir')
File "/home/scut/miniconda3/envs/ylb/lib/python3.7/distutils/cmd.py", line 287, in set_undefined_options
src_cmd_obj.ensure_finalized()
File "/home/scut/miniconda3/envs/ylb/lib/python3.7/distutils/cmd.py", line 107, in ensure_finalized
self.finalize_options()
File "/usr/lib/python3/dist-packages/setuptools/command/install_lib.py", line 17, in finalize_options
self.set_undefined_options('install',('install_layout','install_layout'))
File "/home/scut/miniconda3/envs/ylb/lib/python3.7/distutils/cmd.py", line 290, in set_undefined_options
setattr(self, dst_option, getattr(src_cmd_obj, src_option))
File "/home/scut/miniconda3/envs/ylb/lib/python3.7/distutils/cmd.py", line 103, in getattr
raise AttributeError(attr)
AttributeError: install_layout

Bug fix
If you have already identified the reason, you can provide the information here. If you are willing to create a PR to fix it, please also leave a comment here and that would be much appreciated!

@ZwwWayne
Copy link
Collaborator

This seems to be a bug caused by setuptools, you can try to reinstall it. pypa/setuptools#1086

@ZwwWayne
Copy link
Collaborator

ZwwWayne commented Nov 19, 2019

Btw, why you report the bug to mmdetection when you seem to be installing mmskeleton?

@yulubin
Copy link
Author

yulubin commented Nov 20, 2019

This seems to be a bug caused by setuptools, you can try to reinstall it. pypa/setuptools#1086

OK,I’ll try

@yulubin
Copy link
Author

yulubin commented Nov 20, 2019

Btw, why you report the bug to mmdetection when you seem to be installing mmskeleton?

The bug appeared when I install mmskeleton, so I try to install mmdetection first, then the bug appeared again.

@ZwwWayne
Copy link
Collaborator

So this should be the bug of the code environment rather than the codebase.

@hellock hellock closed this as completed Dec 10, 2019
@EricleiKUANG
Copy link

Btw, why you report the bug to mmdetection when you seem to be installing mmskeleton?

The bug appeared when I install mmskeleton, so I try to install mmdetection first, then the bug appeared again.

Hi there,
I recently encounter with the exact same error, which is AttributeError: install_layout when installing mmcv package.
I was just wondering how did you solve it? Looking forward to your early reply.
Thanks a lot!

@yulubin
Copy link
Author

yulubin commented Jan 8, 2020

Btw, why you report the bug to mmdetection when you seem to be installing mmskeleton?

The bug appeared when I install mmskeleton, so I try to install mmdetection first, then the bug appeared again.

Hi there,
I recently encounter with the exact same error, which is AttributeError: install_layout when installing mmcv package.
I was just wondering how did you solve it? Looking forward to your early reply.
Thanks a lot!

No,I finally install mmedetection on another computer, and it worked. Maybe just like ZwwWayne said, this was caused by the bug of setuptools. I failed to install on the ubuntu with setuptools 20.7, and install on the ubuntu with setuptoolswith 40.8 successfully.

@EricleiKUANG
Copy link

Btw, why you report the bug to mmdetection when you seem to be installing mmskeleton?

The bug appeared when I install mmskeleton, so I try to install mmdetection first, then the bug appeared again.

Hi there,
I recently encounter with the exact same error, which is AttributeError: install_layout when installing mmcv package.
I was just wondering how did you solve it? Looking forward to your early reply.
Thanks a lot!

No,I finally install mmedetection on another computer, and it worked. Maybe just like ZwwWayne said, this was caused by the bug of setuptools. I failed to install on the ubuntu with setuptools 20.7, and install on the ubuntu with setuptoolswith 40.8 successfully.

Yeah I also worked it out recently on another server. Thanks so much for your reply.

@lucasfagiolli
Copy link

It happened to me in a script I downloaded, I followed these instructions to solve the problem by installing Setuptools in Python 3 it worked perfectly for me.

Here's a summary of the steps I took:

Downloaded the latest Setuptools source package for Python 3 from the official website using the command:

curl https://files.pythonhosted.org/packages/69/77/aee1ecacea4d0db740046ce1785e81d16c4b1755af50eceac4ca1a1f8bfd/setuptools-60.5.0.tar.gz > setuptools-60.5.0.tar.gz

Extracted the downloaded package with the command:

tar -xzvf setuptools-60.5.0.tar.gz

Navigated to the Setuptools directory:

cd setuptools-60.5.0

Installed the package using:
python3 setup.py install

After the installation, I verified that Setuptools was installed correctly using:
python3 -m easy_install --version

After installation, I verified that Setuptools installed correctly using:
python3 -m easy_install --version

Import configuration tools:

Python3
> import configuration tools

Once this is done, check if you can execute the command again

@NapatChomchuen
Copy link

NapatChomchuen commented Dec 25, 2023

try this

sudo rm /usr/lib/python3.11/EXTERNALLY-MANAGED

pip uninstall setuptools

pip uninstall ujson

curl https://files.pythonhosted.org/packages/69/77/aee1ecacea4d0db740046ce1785e81d16c4b1755af50eceac4ca1a1f8bfd/setuptools-60.5.0.tar.gz > setuptools-60.5.0.tar.gz

tar -xzvf setuptools-60.5.0.tar.gz

cd setuptools-60.5.0

python3 setup.py install

pip install ujson

Cd OLED_python3

sudo python3 setup.py install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants