packaging-problems icon indicating copy to clipboard operation
packaging-problems copied to clipboard

Trouble following packaging libraries tutorial

Open javierlorenzod opened this issue 4 years ago • 3 comments

Thank you for providing feedback on Python packaging!

To help us help you, please fill out as much of the following as you can. If a question is not relevant, feel free to skip it.

  1. What is your operating system and version?

Ubuntu 20.04

  1. What is your Python version?

Python 3.8.5

  1. What version of pip do you have?

pip 20.0.2

  1. If following an online tutorial or guide, please provide a link to the page or section giving you trouble:

https://packaging.python.org/tutorials/packaging-projects/#generating-distribution-archives

  1. Could you describe your issue in as much detail as possible?

You can find the configuration files used in https://github.com/javierlorenzod/pytorch-attention-mechanism. I am now following the official tutorial but before finding it I followed this one and using python setup.py sdist it does not get an error.

After executing python3 -m build I obtain the following raw output log:

Found existing installation: setuptools 44.0.0
Uninstalling setuptools-44.0.0:
  Successfully uninstalled setuptools-44.0.0
Collecting wheel
  Downloading wheel-0.36.2-py2.py3-none-any.whl (35 kB)
Collecting setuptools>=42
  Downloading setuptools-56.2.0-py3-none-any.whl (785 kB)
     |████████████████████████████████| 785 kB 3.6 MB/s
Installing collected packages: wheel, setuptools
Successfully installed setuptools-56.2.0 wheel-0.36.2
/tmp/build-env-qhu2628f/lib/python3.8/site-packages/setuptools/dist.py:469: UserWarning: Normalizing '1.0.0-rc-1' to '1.0.0rc1'
  warnings.warn(tmpl.format(**locals()))
running egg_info
writing src/pytorch_attention.egg-info/PKG-INFO
writing dependency_links to src/pytorch_attention.egg-info/dependency_links.txt
writing requirements to src/pytorch_attention.egg-info/requires.txt
writing top-level names to src/pytorch_attention.egg-info/top_level.txt
adding license file 'LICENSE' (matched pattern 'LICEN[CS]E*')
reading manifest file 'src/pytorch_attention.egg-info/SOURCES.txt'
writing manifest file 'src/pytorch_attention.egg-info/SOURCES.txt'
/tmp/build-env-qhu2628f/lib/python3.8/site-packages/setuptools/dist.py:469: UserWarning: Normalizing '1.0.0-rc-1' to '1.0.0rc1'
  warnings.warn(tmpl.format(**locals()))
running sdist
running egg_info
writing src/pytorch_attention.egg-info/PKG-INFO
writing dependency_links to src/pytorch_attention.egg-info/dependency_links.txt
writing requirements to src/pytorch_attention.egg-info/requires.txt
writing top-level names to src/pytorch_attention.egg-info/top_level.txt
adding license file 'LICENSE' (matched pattern 'LICEN[CS]E*')
reading manifest file 'src/pytorch_attention.egg-info/SOURCES.txt'
writing manifest file 'src/pytorch_attention.egg-info/SOURCES.txt'
running check
warning: check: missing meta-data: if 'author' supplied, 'author_email' must be supplied too

creating pytorch-attention-1.0.0rc1
creating pytorch-attention-1.0.0rc1/src
creating pytorch-attention-1.0.0rc1/src/attention
creating pytorch-attention-1.0.0rc1/src/pytorch_attention.egg-info
copying files to pytorch-attention-1.0.0rc1...
copying LICENSE -> pytorch-attention-1.0.0rc1
copying README.md -> pytorch-attention-1.0.0rc1
copying pyproject.toml -> pytorch-attention-1.0.0rc1
copying setup.cfg -> pytorch-attention-1.0.0rc1
copying setup.py -> pytorch-attention-1.0.0rc1
copying src/attention/__init__.py -> pytorch-attention-1.0.0rc1/src/attention
copying src/attention/attention.py -> pytorch-attention-1.0.0rc1/src/attention
copying src/pytorch_attention.egg-info/PKG-INFO -> pytorch-attention-1.0.0rc1/src/pytorch_attention.egg-info
copying src/pytorch_attention.egg-info/SOURCES.txt -> pytorch-attention-1.0.0rc1/src/pytorch_attention.egg-info
copying src/pytorch_attention.egg-info/dependency_links.txt -> pytorch-attention-1.0.0rc1/src/pytorch_attention.egg-info
copying src/pytorch_attention.egg-info/requires.txt -> pytorch-attention-1.0.0rc1/src/pytorch_attention.egg-info
copying src/pytorch_attention.egg-info/top_level.txt -> pytorch-attention-1.0.0rc1/src/pytorch_attention.egg-info
Writing pytorch-attention-1.0.0rc1/setup.cfg
Creating tar archive
removing 'pytorch-attention-1.0.0rc1' (and everything under it)
Found existing installation: setuptools 44.0.0
Uninstalling setuptools-44.0.0:
  Successfully uninstalled setuptools-44.0.0
Collecting wheel
  Using cached wheel-0.36.2-py2.py3-none-any.whl (35 kB)
Collecting setuptools>=42
  Using cached setuptools-56.2.0-py3-none-any.whl (785 kB)
Installing collected packages: wheel, setuptools
Successfully installed setuptools-56.2.0 wheel-0.36.2
/tmp/build-env-ymebx6ux/lib/python3.8/site-packages/setuptools/dist.py:469: UserWarning: Normalizing '1.0.0-rc-1' to '1.0.0rc1'
  warnings.warn(tmpl.format(**locals()))
running egg_info
writing src/pytorch_attention.egg-info/PKG-INFO
writing dependency_links to src/pytorch_attention.egg-info/dependency_links.txt
writing requirements to src/pytorch_attention.egg-info/requires.txt
writing top-level names to src/pytorch_attention.egg-info/top_level.txt
adding license file 'LICENSE' (matched pattern 'LICEN[CS]E*')
reading manifest file 'src/pytorch_attention.egg-info/SOURCES.txt'
writing manifest file 'src/pytorch_attention.egg-info/SOURCES.txt'
Requirement already satisfied: wheel in /tmp/build-env-ymebx6ux/lib/python3.8/site-packages (from -r /tmp/build-reqs-es60qpq1.txt (line 1)) (0.36.2)
/tmp/build-env-ymebx6ux/lib/python3.8/site-packages/setuptools/dist.py:469: UserWarning: Normalizing '1.0.0-rc-1' to '1.0.0rc1'
  warnings.warn(tmpl.format(**locals()))
running bdist_wheel
running build
running build_py
installing to build/bdist.linux-x86_64/wheel
running install
running install_lib
running install_egg_info
running egg_info
writing src/pytorch_attention.egg-info/PKG-INFO
writing dependency_links to src/pytorch_attention.egg-info/dependency_links.txt
writing requirements to src/pytorch_attention.egg-info/requires.txt
writing top-level names to src/pytorch_attention.egg-info/top_level.txt
adding license file 'LICENSE' (matched pattern 'LICEN[CS]E*')
reading manifest file 'src/pytorch_attention.egg-info/SOURCES.txt'
writing manifest file 'src/pytorch_attention.egg-info/SOURCES.txt'
removing 'build/bdist.linux-x86_64/wheel/pytorch_attention-1.0.0rc1-py3.8.egg-info' (and everything under it)
Copying src/pytorch_attention.egg-info to build/bdist.linux-x86_64/wheel/pytorch_attention-1.0.0rc1-py3.8.egg-info
running install_scripts
error: [('build/bdist.linux-x86_64/wheel/pytorch_attention-1.0.0rc1-py3.8.egg-info', 'build/bdist.linux-x86_64/wheel/pytorch_attention-1.0.0rc1.dist-info', "[Errno 13] Permission denied: 'build/bdist.linux-x86_64/wheel/pytorch_attention-1.0.0rc1.dist-info'")]
Traceback (most recent call last):
  File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/tmp/build-env-ymebx6ux/bin/python', '/home/jld/.local/lib/python3.8/site-packages/pep517/in_process/_in_process.py', 'build_wheel', '/tmp/tmpqj9j8g24']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/jld/.local/lib/python3.8/site-packages/build/__init__.py", line 309, in _call_backend
    raise BuildBackendException(exception)
build.BuildBackendException: Backend operation failed: CalledProcessError(1, ['/tmp/build-env-ymebx6ux/bin/python', '/home/jld/.local/lib/python3.8/site-packages/pep517/in_process/_in_process.py', 'build_wheel', '/tmp/tmpqj9j8g24'])

ERROR Backend operation failed: CalledProcessError(1, ['/tmp/build-env-ymebx6ux/bin/python', '/home/jld/.local/lib/python3.8/site-packages/pep517/in_process/_in_process.py', 'build_wheel', '/tmp/tmpqj9j8g24'])

javierlorenzod avatar May 21 '21 08:05 javierlorenzod

What the error is saying is that the build process does not have permission to modify the "build" folder. Presumably this was created during a previous run with sudo or similar. Try nuking "./build" and running python3 -m build again.

layday avatar May 21 '21 10:05 layday

Thanks for the help, but I tried and nothing changes, the error is still there. I forgot to mention, that I am using WSL and maybe that is the reason why it fails.

javierlorenzod avatar May 21 '21 11:05 javierlorenzod

I have tried to execute the code on a machine with native linux and it works. Maybe it is related to WSL. If someone find the solution, please contact me, out of curiosity. I am using the old version of WSL, not the new one, maybe is because of that.

Thank you!

javierlorenzod avatar May 21 '21 11:05 javierlorenzod