Manim cannot import external modules
- Ngôn ngữ chính
- Python
- Star
- 93.8k
- Fork
- 7.7k
- Chỉ số merge pull request
- Chỉ số pull request đang chờ
Mô tả
I'm trying to import a module called eulers_method in my manim script called anim_engine, however, manim cannot find the eulers_method module
```
(env) ⬢[slaavn@toolbox manim]$ manim anim_engine.py Simulation -pl
Traceback (most recent call last):
File "/var/home/slaavn/Programs/manim/env/bin/manim", line 10, in
sys.exit(main())
File "/var/home/slaavn/Programs/manim/env/lib64/python3.8/site-packages/manimlib/__init__.py", line 9, in main
config = manimlib.config.get_configuration(args)
File "/var/home/slaavn/Programs/manim/env/lib64/python3.8/site-packages/manimlib/config.py", line 155, in get_configuration
module = get_module(args.file)
File "/var/home/slaavn/Programs/manim/env/lib64/python3.8/site-packages/manimlib/config.py", line 150, in get_module
spec.loader.exec_module(module)
File "", line 783, in exec_module
File "", line 219, in _call_with_frames_removed
File "anim_engine.py", line 12, in
from eulers_method.py import *
ModuleNotFoundError: No module named 'eulers_method'
```
if I run ls in my current dir, you can see both files are in the same directory
```
(env) ⬢[slaavn@toolbox manim]$ ls
:w __pycache__ anim_engine.py double_pend.py eulers_method.py media time.npy
'\' angles.npy anim_pend.py env manim_phys.py position.npy trial.py
```
And if I run os.getcwd() from the file it matches the directory I called manim from
Output of os.getcwd()
`/var/home/slaavn/Programs/manim`
Output of pwd
```
(env) ⬢[slaavn@toolbox manim]$ pwd
/var/home/slaavn/Programs/manim
```
I also tried to run os.getcwd() from config.py and get the same output
I thought the problem might have been my manim installation, because it was a system installation. I uninstalled manim and reinstalled it using `--no-cache-dir` flag for pip, but I got the same error. I then tried to install it in a virtual environment, and as you can see from above, I encountered the same error.
As for other things I have tried that have failed:
- Changing the import of eulers_method to be before the manimlib imports
- Importing from eulers_method.py instead of eulers_method
- Downgrading from python3.8 to python3.7
I have no clue as to what's going on at this point
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Đánh giá
Issue này chưa được đánh giá.