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

Error in pip install on Ubuntu 22.04: AttributeError: install_layout. Did you mean: 'install_platlib'? #167

Closed
LeoBosse opened this issue Aug 19, 2022 · 3 comments

Comments

@LeoBosse
Copy link

Hello,
I just upgraded my laptop to ubuntu 22.04 and must re-install some python packages. In particular, cdflib as a dependency of other things. When I run pip install cdflib in a terminal, I get the following output (see at the end). I found similar errors on different packages online, but none with a satisfying answer (here [https://github.com/pypa/pip/issues/10857] and maybe here [https://github.com/kizniche/Mycodo/issues/1149]). Other packages worked fine.
Do you have any ideas of why this is happening? And a possible solution?
My python version is 3.10.6. I also tried to update setuptool with pip install --upgrade --force-reinstall setuptools, but in vain.
Thanks for your help,
Léo

The output of pip install cdflib:
`Defaulting to user installation because normal site-packages is not writeable
Collecting cdflib
Using cached cdflib-0.4.4.tar.gz (83 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy in /usr/lib/python3/dist-packages (from cdflib) (1.21.5)
Collecting attrs>=19.2.0
Using cached attrs-22.1.0-py2.py3-none-any.whl (58 kB)
Building wheels for collected packages: cdflib
Building wheel for cdflib (pyproject.toml) ... error
error: subprocess-exited-with-error

× Building wheel for cdflib (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [73 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib
creating build/lib/cdflib
copying cdflib/cdfwrite.py -> build/lib/cdflib
copying cdflib/cdf_to_xarray.py -> build/lib/cdflib
copying cdflib/cdfread.py -> build/lib/cdflib
copying cdflib/epochs.py -> build/lib/cdflib
copying cdflib/xarray_to_cdf.py -> build/lib/cdflib
copying cdflib/cdf_factory.py -> build/lib/cdflib
copying cdflib/init.py -> build/lib/cdflib
copying cdflib/epochs_astropy.py -> build/lib/cdflib
creating build/lib/benchmarks
copying benchmarks/benchmarks.py -> build/lib/benchmarks
copying benchmarks/init.py -> build/lib/benchmarks
running egg_info
warning: no files found matching 'README.rst'
writing manifest file 'cdflib.egg-info/SOURCES.txt'
copying cdflib/CDFLeapSeconds.txt -> build/lib/cdflib
running install
running install_lib
Traceback (most recent call last):
File "/home/leob/.local/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in
main()
File "/home/leob/.local/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/home/leob/.local/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 261, in build_wheel
return _build_backend().build_wheel(wheel_directory, config_settings,
File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 230, in build_wheel
return self._build_with_temp_dir(['bdist_wheel'], '.whl',
File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 215, in _build_with_temp_dir
self.run_setup()
File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 267, in run_setup
super(_BuildMetaLegacyBackend,
File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 158, in run_setup
exec(compile(code, file, 'exec'), locals())
File "setup.py", line 3, in
setup()
File "/usr/lib/python3/dist-packages/setuptools/init.py", line 153, in setup
return distutils.core.setup(**attrs)
File "/usr/lib/python3/dist-packages/setuptools/_distutils/core.py", line 148, in setup
return run_commands(dist)
File "/usr/lib/python3/dist-packages/setuptools/_distutils/core.py", line 163, in run_commands
dist.run_commands()
File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 967, in run_commands
self.run_command(cmd)
File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 986, in run_command
cmd_obj.run()
File "/usr/lib/python3/dist-packages/wheel/bdist_wheel.py", line 335, in run
self.run_command('install')
File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 986, in run_command
cmd_obj.run()
File "/usr/lib/python3/dist-packages/setuptools/command/install.py", line 68, in run
return orig.install.run(self)
File "/usr/lib/python3/dist-packages/setuptools/_distutils/command/install.py", line 622, in run
self.run_command(cmd_name)
File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 985, in run_command
cmd_obj.ensure_finalized()
File "/usr/lib/python3/dist-packages/setuptools/_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 "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 290, in set_undefined_options
setattr(self, dst_option, getattr(src_cmd_obj, src_option))
File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 103, in getattr
raise AttributeError(attr)
AttributeError: install_layout. Did you mean: 'install_platlib'?
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for cdflib
Failed to build cdflib
ERROR: Could not build wheels for cdflib, which is required to install pyproject.toml-based projects
`

@bryan-harter
Copy link
Collaborator

I'm not really 100% sure, but I just released a new version which made some small changes to the pip install setup. Perhaps try install this newer one? (0.4.7)

@LeoBosse
Copy link
Author

It works with this version, thank you so much! :)
I just ranpip install cdflib==0.4.7

@LeoBosse
Copy link
Author

LeoBosse commented Sep 1, 2022

In case others find this page, after installing the newer version, I had the exact same issue with an other packages, and it apparently comes from setuptools. Following this: pypa/setuptools#3278
I tried to run: export SETUPTOOLS_USE_DISTUTILS=stdlib in a terminal, and it worked like a charm!

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

2 participants