Skip to content

TypeError: dist must be a Distribution instance #45

@dzyjjpy

Description

@dzyjjpy

pytorch:1.2.0, torchvision:0.4.0
When I excute the comand: python build.py install
as errors occured(create_extension is deprecated), so I edit the code as below:

from torch.utils.ffi import create_extension?

from torch.utils.cpp_extension import BuildExtension

extra_objects = ['src/my_lib_kernel.o'] # there is no my_lib_kernel.o file in project subdirectory /src/
extra_objects = [os.path.join(this_file, fname) for fname in extra_objects]

ffi = create_extension(

ffi = BuildExtension(
'_ext.my_lib',
headers=headers,
sources=sources,
define_macros=defines,
relative_to=file,
with_cuda=with_cuda,
extra_objects=extra_objects # error happened this line
)

TypeError happened as below:
Including CUDA code.
Traceback (most recent call last):
File "build.py", line 31, in
extra_objects=extra_objects
File "/home/jiapy/virtualEnv/py3torch1.2/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 233, in init
super(BuildExtension, self).init(*args, **kwargs)
File "/home/jiapy/virtualEnv/py3torch1.2/lib/python3.6/site-packages/setuptools/init.py", line 163, in init
_Command.init(self, dist)
File "/usr/lib/python3.6/distutils/cmd.py", line 57, in init
raise TypeError("dist must be a Distribution instance")
TypeError: dist must be a Distribution instance

Anyone have similar experience? Any advice for solving the issue will be appreciated. Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions