Skip to content

PyTorch-nightly can not me imported using python-3.7.0 #74087

@malfet

Description

@malfet

🐛 Describe the bug

Steps to reproduce:

conda create -n py3.7-torch-nightly python==3.7.0 pytorch cpuonly -c pytorch-nightly
conda activate py3.7-torch-nightly
python -c "import torch"

which would fail with:

% python -c "import torch"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/nshulga/git/pytorch/pytorch/torch/__init__.py", line 751, in <module>
    from .functional import *  # noqa: F403
  File "/Users/nshulga/git/pytorch/pytorch/torch/functional.py", line 9, in <module>
    import torch.nn.functional as F
  File "/Users/nshulga/git/pytorch/pytorch/torch/nn/__init__.py", line 1, in <module>
    from .modules import *  # noqa: F403
  File "/Users/nshulga/git/pytorch/pytorch/torch/nn/modules/__init__.py", line 1, in <module>
    from .module import Module
  File "/Users/nshulga/git/pytorch/pytorch/torch/nn/modules/module.py", line 205, in <module>
    class Module:
  File "/Users/nshulga/git/pytorch/pytorch/torch/nn/modules/module.py", line 1318, in Module
    def state_dict(self, *, prefix: str = ..., keep_vars: bool = ...) -> typing.OrderedDict[str, Tensor]:
AttributeError: module 'typing' has no attribute 'OrderedDict'

Same works fine if Python-3.7.2 or newer is used

Introduced by #72211

Versions

nightly

cc @ezyang @gchanan @zou3519

Metadata

Metadata

Assignees

Labels

high prioritymodule: python frontendFor issues relating to PyTorch's Python frontendmodule: regressionIt used to work, and now it doesn'ttriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions