sys-bio / tellurium

Python Environment for Modeling and Simulating Biological Systems
http://tellurium.analogmachine.org/
Apache License 2.0
109 stars 36 forks source link

Tellurium not possible to install #562

Closed jurquiza closed 1 year ago

jurquiza commented 2 years ago

I have been using tellurium for a long time as package installed inside docker container. In my old imaged it works fine however it can no longer be installed. there are too many issues with the dependencies. I also tried to install it using conda and it does not work. I like using jupyterlab as a user interface and will be great if that will be a possibility in future updates

luciansmith commented 1 year ago

We have a new version of roadrunner out that I hope was the cause of your dependency troubles. If you can try again and report back if you are still having issues, we'd love to be able to help you further. Thanks for reporting this, and apologies for the delay in getting back to you!

robert1smith commented 1 year ago

Hi Lucian, I was about to post about this and saw you commented last week. I'm running Mac OSX 12.6.3 and cannot get Tellurium to work on Anaconda. Installed a fresh Anaconda today and tried to setup Tellurium and Roadrunner in a new environment (tried both Python 3.8 and 3.6), but when using "import tellurium" the module is not recognised... if I run a script via IPython I get a segment failure during roadrunner simulation. Any tips/ideas to solve this would be appreciated!

luciansmith commented 1 year ago

I can at least say that we're no longer providing new versions of roadrunner for Python 3.6, so you'll definitely need Python 3.8 or later.

I have not seen a situation where installing tellurium works, but 'import tellurium' doesn't. It sounds to me like different versions of Python are being run: one where you install it, and a different one where you run it. At least it seems to be the case that different 'site-packages' directories are being invoked in the two situations.

The IPython problem seems to not have that problem--it seems to think that Tellurium is actually installed (so 'import tellurium' works), assuming your script invokes tellurium and roadrunner, and not just roadrunner. The most likely problem there is that roadrunner is incompatible with the version of numpy you have with that version of Python.

When I was working with Dr. Sauro on his Mac, one of the problems seemed to be that he had old Python 2.7 installations on his computer. It might be useful to try 'which python' from the command line and see if the same is true for you.

Another issue is that sometimes numpy comes pre-installed with Python itself, and if you try to update it as a user, you end up with two versions of numpy instead of just one. The same seemed to be true of roadunner, for some reason.

So, with all that, here's what I recommend: uninstall numpy, then uninstall it again to make sure, then uninstall roadrunner then uninstall it again to make sure. Then install roadrunner, which should pull in numpy as well:

pip uninstall numpy pip uninstall numpy pip uninstall libroadrunner pip uninstall libroadrunner pip install libroadrunner==2.3.1

Then if the last line doesn't work:

pip install libroadrunner==2.2.2

Do let us know whether this works or not!

robert1smith commented 1 year ago

Thanks for the answer Lucian - that appears to have fixed the issue when calling Python scripts from the command line. Do you know what the easiest way is to get Tellurium/libRoadRunner installed into an Anaconda environment? Admittedly the latest Anaconda environment seems to be running older versions of things like Numpy so not sure it would be too useful... but I find notebooks sometimes easier to work in. Thanks!

jurquiza commented 1 year ago

I still need to test this. I have been a bit busy with finishing a paper. I have an old docker container that is working just fine at the momenent but i need to see how it behaves in a more up-to-date one. Ill be back

luciansmith commented 1 year ago

I'm glad it's working somewhat!

I'm not as familiar with Anaconda environments as I could be, but I believe it is possible to upgrade packages in that environment from that environment. So you run python, then run those same commands (pip uninstall/pip install) from the python prompt. Sometimes you need to put an exclamation mark before the pip, so:

!pip uninstall numpy !pip uninstall numpy !pip uninstall libroadrunner !pip uninstall libroadrunner !pip install libroadrunner==2.3.1

I do know that in the past, it was generally recommended to not mix anaconda and pip, since they used different sources, and it was easy to get things into incompatible states. But sometimes they work anyway?

robert1smith commented 1 year ago

Hi both, thanks for the comments and feedback. For now, I am happy I can run scripts again and get some output, so I will continue without the Anaconda environment. I am sure it used to work there though, and given it is a useful tool, it might be worth exploring the Anaconda links in future. Thanks for your help!