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

update genesis documentation about minimum Python version supported. #337

Open
fbaptista opened this issue Dec 26, 2024 · 9 comments
Open

Comments

@fbaptista
Copy link

pymeshlab is not able to install on Python 3.9, so this Python version is not supported.

Originally posted by @fbaptista in #52 (comment)

@zhouxian
Copy link
Collaborator

On linux it works fine with python 3.9 (this is the version we have been using for development)

which os are u referrring to?

@fbaptista
Copy link
Author

macOS / ARM.
See Issue #52 resolution for more details

@ai-bits
Copy link

ai-bits commented Dec 26, 2024

So @fbaptista you're saying 3.10 is minimum for pymeshlab?

I think on the MBP M3 torchaudio would run into problems with >3.10.
From my experience below, 3.10 is the only choice on the Mac??

Clean env install:
Genesis (from repo)
and PyTorch (conda install pytorch torchvision torchaudio pytorch-cuda=12.4 -c pytorch -c nvidia on Ubuntu 24.04 and Windows 11 latest)
install on a Python 3.10.16 env on an M3 MBP and a Xeon 256GB / Nvidia 2x RTX 4000.

But even the Hello https://genesis-world.readthedocs.io/en/latest/user_guide/getting_started/hello_genesis.html example fails on line 1 on all 3 platforms!

python py/genesis-hello.py
Traceback (most recent call last):
File "/home/gy/dl/LinuxSetup/py/genesis-hello.py", line 1, in
import genesis as gs
File "/home/gy/dl/Genesis/genesis/init.py", line 274, in
from .engine.scene import Scene
File "/home/gy/dl/Genesis/genesis/engine/scene.py", line 5, in
from genesis.engine.entities import Emitter
File "/home/gy/dl/Genesis/genesis/engine/entities/init.py", line 1, in
from .avatar_entity import AvatarEntity
File "/home/gy/dl/Genesis/genesis/engine/entities/avatar_entity/init.py", line 1, in
from .avatar_entity import AvatarEntity
File "/home/gy/dl/Genesis/genesis/engine/entities/avatar_entity/avatar_entity.py", line 3, in
from ..rigid_entity import RigidEntity
File "/home/gy/dl/Genesis/genesis/engine/entities/rigid_entity/init.py", line 1, in
from .rigid_entity import RigidEntity
File "/home/gy/dl/Genesis/genesis/engine/entities/rigid_entity/rigid_entity.py", line 8, in
from genesis.utils import mesh as mu
File "/home/gy/dl/Genesis/genesis/utils/mesh.py", line 12, in
import tetgen
File "/home/gy/anaconda3/envs/genesis/lib/python3.10/site-packages/tetgen/init.py", line 2, in
from tetgen import _tetgen
File "tetgen/cython/tetgen/_tetgen.pyx", line 1, in init tetgen._tetgen
ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject

Thx
G.

@fbaptista
Copy link
Author

I can confirm that it works as expected with macOSARM + Python 3.12

I can make some tests on 3.10 if needed

@ai-bits
Copy link

ai-bits commented Dec 26, 2024

Thanks for helping!
Wondering what was wrong on all 3 platforms on 3.10.16
(File "tetgen/cython/tetgen/_tetgen.pyx", line 1, in init tetgen._tetgen ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject)
I began with the recommended platform (Ubuntu), removed the env and reinstalled based on 3.12.8 and latest repo and PyTorch.
Same error.

You are right re 3.12 and Genesis and PyTorch.
Both installed contrary to what I had anticipated from the failed 3.13.1 trial messages.
The 3.13.1 install seems to have confused versions saying Python >=3.10, <3.11.0a0 was needed for torchvision. Guess the alpha version screwed up the comparison.

Any idea how to deal with the ValueError?
Should I move to a different thread, because this has nothing to do any more with your 3.9 problem?
Thx
G.

Here is the 3.13.1 comment:
`Could not solve for environment specs

The following packages are incompatible
├─ pin-1 is installable and it requires
│ └─ python 3.13.* , which can be installed;
└─ torchvision is not installable because there are no viable options
├─ torchvision [0.11.3|0.13.0|...|0.20.1] would require
│ └─ python >=3.10,<3.11.0a0 , which conflicts with any installable versions previously reported;
├─ torchvision [0.11.3|0.13.0|...|0.20.0] would require
│ └─ python >=3.8,<3.9.0a0 , which conflicts with any installable versions p
...`

@fbaptista
Copy link
Author

Yes, this seems to be a different issue, the problem on Python 3.9 + macOS ARM is that we can't even install pymeshlab dependency.

You rissue can be due to mismatch between the NumPy version used to compile the Cython extension and the version currently installed in your Python environment ...

maybe updating or reinstalling the package?
pip install --upgrade numpy

@ai-bits
Copy link

ai-bits commented Dec 27, 2024

Thanks again for chiming in!
Your suspicion / intuition is not far from what I found. See docs Python -V must be >=3.9 AND <3.13 and install PyTorch before Genesis fixes numpy ver problems

@Felix-Zhenghao
Copy link

Same issue. On macOS 14, pymeshlab can't be installed when using python 3.9. Problem solved when using python 3.10.

@ai-bits
Copy link

ai-bits commented Dec 29, 2024

@zhouxian just agreed on my above thread to change the docs to Python >=3.10 and <3.13 to account for your pymeshlab problem and torchvision had with 3.13.1 in my first attempt.
Hope he will also change suggested install order to PyTorch, THEN Genesis so torch won't overwrite Genesis' 1.26 numpy with the incompatible v2.

BTW: I had misunderstood some 3.13.1 complaint re torchvision and @fbaptista told me here that I CAN use 3.12 (Anaconda env in my case) and I`m not limited to 3.10. Newer is often better. ;-)
Cheers
G.

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

4 participants