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

Install on Google Colab #52

Closed
hmok opened this issue Apr 6, 2019 · 9 comments
Closed

Install on Google Colab #52

hmok opened this issue Apr 6, 2019 · 9 comments
Labels
question Further information is requested

Comments

@hmok
Copy link

hmok commented Apr 6, 2019

Hello Romain,

I have been trying to install them and use them to get some simulation with OpenSim. I am not sure if I installed them properly esp. in a google notebook.

I managed to install ezc3d with some difficulty on Google Colab. (I guess the same idea can be done on Jupyter notebook); However, after trying your pyomeca, I get the following error (see the notebook please) :

_Could not find a version that satisfies the requirement ezc3d (from pyomeca==2018.3+2.g3584e40) (from versions: )

No matching distribution found for ezc3d (from pyomeca==2018.3+2.g3584e40)_

I am wonder if you could help me fix this and install it. I do appreciate it.
Cheers,
Hossein

@pariterre
Copy link
Member

pariterre commented Apr 6, 2019

Hi @hmok !

I am the main coder of ezc3d and co-coder with @romainmartinez on pyomeca. I was interested on why you struggled to install ezc3d? If anything can be done in order to help installing it, please let me know! The easiest way is to open an issue on github in ezc3d :)

For your specific problem, I tried installing everything in google colab and all seems fine. Here the command I used:

!wget -c https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
!chmod +x Miniconda3-latest-Linux-x86_64.sh
!bash ./Miniconda3-latest-Linux-x86_64.sh -b -f -p /usr/local
!conda install -y --prefix /usr/local -c pyomeca -c conda-forge pyomeca

import sys
sys.path.append('/usr/local/lib/python3.7/site-packages/')

Please note that if python version changes in miniconda, you will need to change the python version in the sys.path.append command.

Afterwards, ezc3d and pyomeca (even though I doubt you explicitly need to import ezc3d) can be imported by:

import ezc3d
import pyomeca

Here is the Google Colab example I've made:
https://colab.research.google.com/drive/1VFTHMYVIR-azN1mtsWdrxzA2OlrcW9cJ

Enjoy!

@hmok
Copy link
Author

hmok commented Apr 7, 2019

Hi @pariterre ,

Thank you for the nice note above and great work by the way! Keep up please!
I had difficulty findings what you kindly shared with me. Thanks for creating the Google Colab notebook as well. It works now perfectly. I am quite new to Python so I am slow, sorry for simple questions.

I am wondering if you could install OpenSim on Google Colab as well. I have tried it but haven't had success yet.

I will explore your pyomeca more!

Thanks again.
Hossein

@pariterre
Copy link
Member

Hi there!

You can download it via conda again, but so far I am not sure there is an official channel. So you will have to choose. As up today, it seems the 2 most up-to-date is ours (pyomeca) and kzts, the latter slightly more recent. Assuming you are using the kzts channel, just run the following command to install opensim:

!conda install -y --prefix /usr/local -c kzts opensim

Afterward, you should be able to access opensim resources via the import opensim as osim command (please note that the as osim is not required. It only creates an alias so in your code you call opensim commands by using this alias (for example: osim.model() instead of opensim.model())

Regards

@hmok
Copy link
Author

hmok commented Apr 7, 2019

Hello again!

That is great. I have been trying many ways but this is so easy and I did it. Thanks a lot here is what I did:

!wget -c https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
!chmod +x Miniconda3-latest-Linux-x86_64.sh
!bash ./Miniconda3-latest-Linux-x86_64.sh -b -f -p /usr/local
!conda install -y --prefix /usr/local -c kzts opensim

import sys
sys.path.append('/usr/local/lib/python3.7/site-packages/')

import opensim as osim

The it works. Wow.

May I please ask you what you meant by two ways of installing it. Can we install OpenSim via pyomeca as well?

Thanks a lot and have a wonderful day!
Cheers,
Hossein

@pariterre
Copy link
Member

Yep, we also host our build of Opensim. You can install it from our channel using this command

!conda install -y --prefix /usr/local -c pyomeca opensim

I am not sure which one is most up-to-date though. This is not impossible that the one on our channel includes some changes I've made into OpenSim but were not merged yet into the main repo (mainly on StaticOptimization). @romainmartinez can you confirm?

Regards!

@romainmartinez
Copy link
Member

Hi there,

As far as I know, opensim has been build on three channels:

  • mrtnz: uploaded 10 days and 19 hours ago from this repo with this pull-request merged
  • pyomeca: uploaded 1 month and 30 days ago from this repo
  • kzts: uploaded 23 days and 3 hours ago. I don't know the source code so I don't recommend this one as OpenSim as had a lot of changes in the last year.

@hmok
Copy link
Author

hmok commented Apr 9, 2019

That is great! Thanks for the list and details. I just tried to install all three options. I could only install properly kzts. I will go ahead with kzts one for now but I will try them later again!

@pariterre
Copy link
Member

Yep, I confirm the bug, the one on pyomeca fails due an error with simbody interface. @romainmartinez, should I have a look?

@romainmartinez romainmartinez added the question Further information is requested label Jul 25, 2019
@romainmartinez
Copy link
Member

Since this problem is not related to pyomeca, I'll close this issue. Feel free to reach us on the pyosim repo if you still have trouble installing pyosim.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants