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

import fail: SyntaxError: invalid syntax #4014

Closed
SomaLily opened this issue Nov 13, 2024 · 2 comments
Closed

import fail: SyntaxError: invalid syntax #4014

SomaLily opened this issue Nov 13, 2024 · 2 comments
Labels
installation Everything concerning the installation process

Comments

@SomaLily
Copy link

SomaLily commented Nov 13, 2024

I installed manim by conda install -c conda-forge manim.
Imported manim and ran some examples on jupyter notebook successful last day, until raised dvisvgm not found.
Then I installed and updated some depends for dvisvgm include Clipper2, FreeType2, Ghostscript, Kpathsea, potracelib, ttfautohint, woff2 , brotli , xxHash, zlib.
Finally make install dvisvgm , and manim.NumberPlane().add_coordinates() run OK.
But the other day (today), when import manim , it went wrong:

Python 3.12.4 | packaged by conda-forge | (main, Jun 17 2024, 10:23:07) [GCC 12.3.0] on linux                    
Type "help", "copyright", "credits" or "license" for more information.                                           
>>> import manim                                                                                                 
Traceback (most recent call last):                                                                               
  File "<stdin>", line 1, in <module>                                                                            
  File "/home/soma/gs/envs/opt/lib/python3.12/site-packages/manim/__init__.py", line 51, in <module>             
    from .mobject.graph import *                                                                                 
  File "/home/soma/gs/envs/opt/lib/python3.12/site-packages/manim/mobject/graph.py", line 14, in <module>        
    import networkx as nx                                                                                        
  File "/home/soma/gs/envs/opt/lib/python3.12/site-packages/networkx/__init__.py", line 23, in <module>          
    config = utils.backends._set_configs_from_environment()                                                      
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                      
  File "/home/soma/gs/envs/opt/lib/python3.12/site-packages/networkx/utils/backends.py", line 574, in _set_configs_from_environment                                                                                               
    backends=Config(                                                                                             
             ^^^^^^^                                                                                             
  File "/home/soma/gs/envs/opt/lib/python3.12/site-packages/networkx/utils/configs.py", line 84, in __new__      
    cls = dataclass(                                                                                             
          ^^^^^^^^^^                                                                                             
  File "/home/soma/gs/envs/opt/lib/python3.12/dataclasses.py", line 1265, in wrap                                
    return _process_class(cls, init, repr, eq, order, unsafe_hash,                                               
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                               
  File "/home/soma/gs/envs/opt/lib/python3.12/dataclasses.py", line 1063, in _process_class                      
    _init_fn(all_init_fields,                                                                                    
  File "/home/soma/gs/envs/opt/lib/python3.12/dataclasses.py", line 619, in _init_fn                             
    return _create_fn('__init__',                                                                                
           ^^^^^^^^^^^^^^^^^^^^^^                                                                                
  File "/home/soma/gs/envs/opt/lib/python3.12/dataclasses.py", line 473, in _create_fn                           
    exec(txt, globals, ns)                                                                                       
  File "<string>", line 1                                                                                        
    def __create_fn__(__dataclass_type_nx-loopback__, __dataclass_HAS_DEFAULT_FACTORY__, __dataclass_builtins_object__, __dataclass_return_type__):                                                                               
                                         ^                                                                       
SyntaxError: invalid syntax                                                                                      

I've try reinstall manim but not work. May it a C lib issue? Which lib?

@SomaLily SomaLily added the installation Everything concerning the installation process label Nov 13, 2024
@github-project-automation github-project-automation bot moved this to 🆕 New in Dev Board Nov 13, 2024
@SomaLily
Copy link
Author

SomaLily commented Nov 13, 2024

it's strange when I change my env to another, and conda install than import goes well !!!!

Python 3.12.0 | packaged by conda-forge | (main, Oct  3 2023, 08:43:22) [GCC 12.3.0] on linux                    
Type "help", "copyright", "credits" or "license" for more information.                                           
>>> import manim
>>> manim.__version__                                                                                            
'0.18.1'                   

Hope won't went wrong next day.

@JasonGrace2282
Copy link
Member

This seems like something broken with your python installation, as it looks like it cannot import the stdlib module dataclasses. I'm not sure what could cause it, as it seems you have a relatively recent python version?

I'll close this issue for now - feel free to reopen it if the issue pops up again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
installation Everything concerning the installation process
Projects
Status: 🆕 New
Development

No branches or pull requests

2 participants