PYROMS error

General scientific issues regarding ROMS

Moderators: arango, robertson

Post Reply
Message
Author
lqjwainxl
Posts: 1
Joined: Sun Jan 04, 2015 4:52 pm
Location: Ocean University of China

PYROMS error

#1 Unread post by lqjwainxl »

I have installed pyroms using anaconda3 python 3.7.3 in conda(as mentioned on pyroms github page https://github.com/ESMG/pyroms) and my operating system is Ubuntu 16.04LTS.The installed was successful with no error.But when i try to import module,I have some error as follow:
1、import bathy_smoother error:lpsolve55.so not found. Linear programming method will not be available.
But I found two files named lpsolve*.so,one is lib/python3.7/site-packages/bathy_smoother/lpsolve55.cpython-37m-x86_64-linux-gnu.so and the other is /usr/lib/lp_solve/liblpsolve55.so
2、import pyroms_toolbox The message is:
File "/opt/anaconda3/envs/myenv/lib/python3.7/site-packages/pyroms_toolbox/remapping.py", line 14, in <module>
from pyroms import _remapping
ImportError: cannot import name '_remapping' from 'pyroms' (unknown location)
Thank you !!!
lqjwainxl

User avatar
kate
Posts: 4088
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: PYROMS error

#2 Unread post by kate »

For #1, I get the same error, I'm not using lpsolve, I don't care enough to figure it out.

For #2, I don't get that error. It is finding _remapping.cpython-37m-x86_64-linux-gnu.so
in my $HOME/python/lib/python3.7/site-packages/pyroms which is where I told it to put stuff. Do you have such a _remapping file?

asantana
Posts: 4
Joined: Fri Aug 16, 2019 5:30 pm
Location: SOCIB

Re: PYROMS error

#3 Unread post by asantana »

Error #1 is probably because you did not install the lp-solve library or Pyroms does not find the path to it.
The paths can change depending on how you installed the packages.

I use pyroms inside a JupyterLab (a docker image) and the following commands installed it for me.
"jovyan" is the JupyterLab user, you need to change it for your case.

Code: Select all

#Installig lp-solve
apt-get install lp-solve liblpsolve55-dev -y \
        && conda install -c conda-forge lpsolve55

#cloning pyroms repository
git clone https://github.com/ESMG/pyroms.git

#installiing bathy_smoother from pyroms
cd pyroms/bathy_smoother \
   && python setup.py build \
   && python setup.py install --prefix=/home/jovyan/.local

#Installing pyroms_toolbox
cd ../pyroms_toolbox/ \
   && python setup.py build \
   && python setup.py install --prefix=/home/jovyan/.local

#Installing pyroms
cd ../pyroms/ \
   && python setup.py build \
   && python setup.py install --prefix=/home/jovyan/.local

#Reorganizing libs
cd /home/jovyan/.local/lib/python3.7/site-packages \
   && cp pyroms/*.so . && cp pyroms_toolbox/*.so . && cp bathy_smoother/*.so .

#coping the lpsolve library to the same directory of all pyroms libraries.
cp /opt/conda/lib/python3.7/site-packages/lpsolve55*.so .

Post Reply