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

fail to build for python 3.10 #38

Open
hubutui opened this issue Dec 17, 2021 · 2 comments
Open

fail to build for python 3.10 #38

hubutui opened this issue Dec 17, 2021 · 2 comments

Comments

@hubutui
Copy link

hubutui commented Dec 17, 2021

python setup.py build

outputs:

/usr/lib/python3.10/distutils/dist.py:274: UserWarning: Unknown distribution option: 'tests_requires'
  warnings.warn(msg)
running build
running build_py
creating build
creating build/lib
creating build/lib/torchstat
copying torchstat/statistics.py -> build/lib/torchstat
copying torchstat/stat_tree.py -> build/lib/torchstat
copying torchstat/reporter.py -> build/lib/torchstat
copying torchstat/model_hook.py -> build/lib/torchstat
copying torchstat/compute_memory.py -> build/lib/torchstat
copying torchstat/compute_madd.py -> build/lib/torchstat
copying torchstat/compute_flops.py -> build/lib/torchstat
copying torchstat/__main__.py -> build/lib/torchstat
copying torchstat/__init__.py -> build/lib/torchstat
running egg_info
creating torchstat.egg-info
writing torchstat.egg-info/PKG-INFO
Traceback (most recent call last):
  File "/build/python-torchstat/src/torchstat-0.0.7/setup.py", line 33, in <module>
    setup(
  File "/usr/lib/python3.10/site-packages/setuptools/__init__.py", line 153, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib/python3.10/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib/python3.10/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.10/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/usr/lib/python3.10/distutils/command/build.py", line 135, in run
    self.run_command(cmd_name)
  File "/usr/lib/python3.10/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.10/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/usr/lib/python3.10/site-packages/setuptools/command/build_py.py", line 56, in run
    self.build_package_data()
  File "/usr/lib/python3.10/site-packages/setuptools/command/build_py.py", line 118, in build_package_data
    for package, src_dir, build_dir, filenames in self.data_files:
  File "/usr/lib/python3.10/site-packages/setuptools/command/build_py.py", line 69, in __getattr__
    self.data_files = self._get_data_files()
  File "/usr/lib/python3.10/site-packages/setuptools/command/build_py.py", line 82, in _get_data_files
    self.analyze_manifest()
  File "/usr/lib/python3.10/site-packages/setuptools/command/build_py.py", line 139, in analyze_manifest
    self.run_command('egg_info')
  File "/usr/lib/python3.10/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.10/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/usr/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 292, in run
    writer(self, ep.name, os.path.join(self.egg_info, ep.name))
  File "/usr/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 635, in write_pkg_info
    metadata.write_pkg_info(cmd.egg_info)
  File "/usr/lib/python3.10/distutils/dist.py", line 1117, in write_pkg_info
    self.write_pkg_file(pkg_info)
  File "/usr/lib/python3.10/site-packages/setuptools/dist.py", line 185, in write_pkg_file
    license = rfc822_escape(self.get_license())
  File "/usr/lib/python3.10/distutils/util.py", line 479, in rfc822_escape
    lines = header.split('\n')
AttributeError: '_Printer' object has no attribute 'split'. Did you mean: 'get_data_files'?
@hubutui
Copy link
Author

hubutui commented Dec 17, 2021

It seems that license is undefined, change it to "MIT" fix it.

license=license,

@AvatarHwang
Copy link

It seems that license is undefined, change it to "MIT" fix it.

license=license,

It worked! Thanks.

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