Skip to content

ModuleNotFoundError: No module named 'dataclasses' #31

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

Closed
FeliMe opened this issue Feb 7, 2020 · 7 comments
Closed

ModuleNotFoundError: No module named 'dataclasses' #31

FeliMe opened this issue Feb 7, 2020 · 7 comments

Comments

@FeliMe
Copy link

FeliMe commented Feb 7, 2020

If you do not know the root cause of the problem / bug, and wish someone to help you, please
post according to this template:

🐛 Bugs / Unexpected behaviors

error when trying to import pytorch3d.renderer

Instructions To Reproduce the Issue:

I installed pytorch3d according to the INSTALL.md file (installed pytroch3d from Anaconda Cloud), when I try to import pytorch3d.renderer, I get the following error:

ModuleNotFoundError: No module named 'dataclasses'

Complete logs:

$ python
Python 3.6.10 |Anaconda, Inc.| (default, Jan  7 2020, 21:14:29)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.__version__
'1.4.0'
>>> torch.version.cuda
'10.0'
>>> import pytorch3d.renderer
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/meissen/miniconda3/envs/pytorch3d/lib/python3.6/site-packages/pytorch3d/renderer/__init__.py", line 19, in <module>
    from .mesh import (
  File "/home/meissen/miniconda3/envs/pytorch3d/lib/python3.6/site-packages/pytorch3d/renderer/mesh/__init__.py", line 4, in <module>
    from .rasterizer import MeshRasterizer, RasterizationSettings
  File "/home/meissen/miniconda3/envs/pytorch3d/lib/python3.6/site-packages/pytorch3d/renderer/mesh/rasterizer.py", line 5, in <module>
    from dataclasses import dataclass
ModuleNotFoundError: No module named 'dataclasses'
>>>
@nikhilaravi
Copy link
Contributor

nikhilaravi commented Feb 7, 2020

Hi @FeliMe dataclasses is available in Python 3.7! We are updating the anaconda cloud package to support Python 3.6 as well. For now can you try changing the python version to 3.7 and running the code again?

@FeliMe
Copy link
Author

FeliMe commented Feb 7, 2020

Updating to Python 3.7 worked, thanks @nikhilaravi !

@csverma610
Copy link

Thanks. I will do it.
Also for others, it will be nice to update the installation instructions.

@nikhilaravi
Copy link
Contributor

@csverma610 this has been changed on master. We will be updating the conda package soon to incorporate this change as well.

@csverma610
Copy link

csverma610 commented Feb 19, 2020 via email

@bottler
Copy link
Contributor

bottler commented Feb 20, 2020

We don't yet have builds for 10.2, because pytorch does not have builds for 10.2 yet. I recommend 10.1 as it's the latest we do have builds for.

@vivekslair
Copy link

Incase you still need to use python 3.6 you might want to manually install dataclasses. In Mac pip usually fails and hence do a conda install dataclasses.

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

5 participants