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

No module named opensim #217

Open
W4Guru opened this issue Jan 28, 2020 · 6 comments
Open

No module named opensim #217

W4Guru opened this issue Jan 28, 2020 · 6 comments

Comments

@W4Guru
Copy link

W4Guru commented Jan 28, 2020

Hello everyone,

How can run the Python scripts in OpenSim when they use the command "import opensim as osim"? ScriptingShell Window reply "ImportError: No module named opensim".

I'm running OpenSim 4.1. and already installed python 3.7.6. I can use the commands and scripts in Python (and Anaconda), after running the setup.py but it do not fix the issue in OpenSim. I think it's not that hard, but I can't figure it out alone :-/

Best regards

@kidzik
Copy link
Member

kidzik commented Jan 28, 2020

For now, we've only tested osim-rl with OpenSim 4.0 conda binaries posted here https://anaconda.org/kidzik/opensim
Reproducing steps from here might be the easiest way to go.

@W4Guru
Copy link
Author

W4Guru commented Jan 31, 2020

Finally!
Many thanks for your reply! It was a basic misunderstanding of how the workflow really works. The main problem was not the installation of the opensim package but the slight differences running python scripts in OpenSim. The command “import opensim as osim” doesn’t work instead use org.opensim as osim although it is not necessary because the packages are already included.

However, one problem remains. Is there a possibility to use the command printToXML? I get the error “org.opensim.modeling.Model object has not attribute PrintToXML”. In a python environment this command is no problem.

Best regards

@kidzik
Copy link
Member

kidzik commented Jan 31, 2020

Sounds great! Exporting to xml is not a part of osim-rl package but indeed it might be available in OpenSim. I don't know if it's exposed in the python interface though -- to get the most up-to-date advice please follow up on OpenSim forum

@AffDk
Copy link

AffDk commented Apr 8, 2021

Hi,

I had an already installed Anaconda (navigator version 1.9.12) on my computer and followed the instruction to installed osim-rl from the following website:

http://osim-rl.stanford.edu/docs/quickstart/

The installation went through smoothly, at least I did not see any warning or error message.
After that when I open Anaconda navigator, I can see osim-rl is added to the available environments.
when I choose osim-rl environment, it gives me two possibilities ("open terminal" and "open with python"),

if I choose "open terminal"

I run "activate opensim-rl" as instructed by the website that this must be done every time
I also run "python -c "import opensim" " and apparently this one is fine too. At least, it does not generate any error or warning message.

but when I choose "open with python" and run "from osim.env import L2RunEnv" I face an error message as mentioned in this thread.

Traceback (most recent call last):
File "", line 1, in
ModuleNotFoundError: No module named 'osim'

I followed the conversation in this thread and tried

import org.opensim as osim

I received a similar error "No module named 'org'"

Any suggestion here?

Best regards,
Afshin

@zsundayjj
Copy link

I also met the same problem. Have you solved it? Could you tell me how it was resolved.

@AffDk
Copy link

AffDk commented May 29, 2023

Hi, No. This was my sideline activity for a long time ago. I stopped working on it.

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