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

Trouble following packaging libraries tutorial #468

Closed
liamdmccann opened this issue Mar 16, 2021 · 3 comments
Closed

Trouble following packaging libraries tutorial #468

liamdmccann opened this issue Mar 16, 2021 · 3 comments

Comments

@liamdmccann
Copy link

liamdmccann commented Mar 16, 2021

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?

macOS Big Sur, 11.2.1.

  1. What is your Python version?

Python 3.8.5.

  1. What version of pip do you have?

pip 21.0.1.

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

I'm following this guide. https://packaging.python.org/tutorials/packaging-projects/
The section providing me with issues is "Generating distribution archives."

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

I followed the above guide strictly.

Here's the most recent command I ran, and the error message I received as a result.

(base) Liams-MBP:packaging_tutorial dpiemccannl$ python3 -m build
Found existing installation: setuptools 47.1.0
Uninstalling setuptools-47.1.0:
  Successfully uninstalled setuptools-47.1.0
Collecting wheel
  Downloading wheel-0.36.2-py2.py3-none-any.whl (35 kB)
Collecting setuptools>=42
  Downloading setuptools-54.1.2-py3-none-any.whl (785 kB)
     |████████████████████████████████| 785 kB 336 kB/s 
Installing collected packages: wheel, setuptools
Successfully installed setuptools-54.1.2 wheel-0.36.2
WARNING: You are using pip version 20.1.1; however, version 21.0.1 is available.
You should consider upgrading via the '/var/folders/xz/6ypsz21d1zdfk9vw9zgz3x080000gn/T/build-env-unibrx65/bin/python -m pip install --upgrade pip' command.
Traceback (most recent call last):
  File "/Users/dpiemccannl/opt/anaconda3/lib/python3.8/site-packages/pep517/in_process/_in_process.py", line 280, in <module>
    main()
  File "/Users/dpiemccannl/opt/anaconda3/lib/python3.8/site-packages/pep517/in_process/_in_process.py", line 263, in main
    json_out['return_val'] = hook(**hook_input['kwargs'])
  File "/Users/dpiemccannl/opt/anaconda3/lib/python3.8/site-packages/pep517/in_process/_in_process.py", line 236, in build_sdist
    return backend.build_sdist(sdist_directory, config_settings)
  File "/var/folders/xz/6ypsz21d1zdfk9vw9zgz3x080000gn/T/build-env-unibrx65/lib/python3.8/site-packages/setuptools/build_meta.py", line 220, in build_sdist
    return self._build_with_temp_dir(['sdist', '--formats', 'gztar'],
  File "/var/folders/xz/6ypsz21d1zdfk9vw9zgz3x080000gn/T/build-env-unibrx65/lib/python3.8/site-packages/setuptools/build_meta.py", line 204, in _build_with_temp_dir
    result_basename = _file_with_extension(
  File "/var/folders/xz/6ypsz21d1zdfk9vw9zgz3x080000gn/T/build-env-unibrx65/lib/python3.8/site-packages/setuptools/build_meta.py", line 104, in _file_with_extension
    file, = matching
ValueError: not enough values to unpack (expected 1, got 0)
Traceback (most recent call last):
  File "/Users/dpiemccannl/opt/anaconda3/lib/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/var/folders/xz/6ypsz21d1zdfk9vw9zgz3x080000gn/T/build-env-unibrx65/bin/python', '/Users/dpiemccannl/opt/anaconda3/lib/python3.8/site-packages/pep517/in_process/_in_process.py', 'build_sdist', '/var/folders/xz/6ypsz21d1zdfk9vw9zgz3x080000gn/T/tmp7pm_5q7d']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/dpiemccannl/opt/anaconda3/lib/python3.8/site-packages/build/__init__.py", line 309, in _call_backend
    raise BuildBackendException(exception)
build.BuildBackendException: Backend operation failed: CalledProcessError(1, ['/var/folders/xz/6ypsz21d1zdfk9vw9zgz3x080000gn/T/build-env-unibrx65/bin/python', '/Users/dpiemccannl/opt/anaconda3/lib/python3.8/site-packages/pep517/in_process/_in_process.py', 'build_sdist', '/var/folders/xz/6ypsz21d1zdfk9vw9zgz3x080000gn/T/tmp7pm_5q7d'])

ERROR Backend operation failed: CalledProcessError(1, ['/var/folders/xz/6ypsz21d1zdfk9vw9zgz3x080000gn/T/build-env-unibrx65/bin/python', '/Users/dpiemccannl/opt/anaconda3/lib/python3.8/site-packages/pep517/in_process/_in_process.py', 'build_sdist', '/var/folders/xz/6ypsz21d1zdfk9vw9zgz3x080000gn/T/tmp7pm_5q7d'])

@henryiii
Copy link
Contributor

I expect you have a setup.py, but it is empty. Either delete the file, or add:

from setuptools import setup

setup()

@henryiii
Copy link
Contributor

If you followed the guide above strictly, what about this?

Screen Shot 2021-03-16 at 12 16 25 AM

@liamdmccann
Copy link
Author

liamdmccann commented Mar 19, 2021

Fixed it, removed setup.py :)

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