You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can confirm this error on python3.4 using conda (using ubuntu linux). It works correctly using python3.5 (installed via conda), so appears to be something unique to the python3.4 conda build?
A bit more info: the problem seems to be in the version of numpy that is getting loaded by conda. Using ipython, I get the following error:
In [1]: import slycot
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
RuntimeError: module compiled against API version 0xa but this version of numpy is 0x9
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-5cdaeed6bdd3> in <module>()
----> 1 import slycot
/home/ubuntu/miniconda3/envs/python3.4/lib/python3.4/site-packages/slycot/__init__.py in module>()
14
15 # Analysis routines (6/40 wrapped)
---> 16 from .analysis import ab01nd,ab05md,ab05nd,ab07nd,ab08nd, ab09ad, \
17 ab09ax, ab09bd
18
/home/ubuntu/miniconda3/envs/python3.4/lib/python3.4/site-packages/slycot/analysis.py in <module>()
19 # MA 02110-1301, USA.
20
---> 21 from . import _wrapper
22 import warnings
23
ImportError: numpy.core.multiarray failed to import
@TMorville can you give a bit more info on how you installed python-control? Was it via conda, pip or source?
I was able to get python-control and lqr to work (tested using examples/pvtol-lqr) by uninstalling control using
conda uninstall control
and then installing the python-control package from source:
git clone https://github.com/python-control/python-control.git
cd python-control
python setup.py install
This let me use the conda version of slycot (so no FORTRAN compiler required) but the latest version of numpy (so no issues with the version error).
Python is anaconda build, slycot and control was installed with pip. My PATHs are correct and which python yields correct lib. Also I've tried to build control from source as you suggested, but with the same error as I posted above. I've never seen the error related to numpy.
I did a bit more checking and have reproduced this error in an anaconda build on my mac, using the control-0.7.0 install instructions. It looks like the issue that I ran into is that there were missing libraries that caused slycot to fail, which then generated the errors above. Slycot was installed via pip, but looks like the required libraries didn't copy over.
@TMorville: what OS are you using? We may need to redo the slycot builds on python.org to get pip working correctly. (@cwrowley: will need your help with this, since I am not listed as a maintainer for slycot).
@TMorville: OK, I have a possible fix but need some help in trying it out. First, you need to uninstall the current slycot installation that you have installed with pip:
pip uninstall slycot
Now re-install slycot using conda:
conda install -c python-control -c cyclus slycot
This command should install slycot-0.3.0 from the python-control channel and lapack-3.5.0 from the cyclus channel (who has compiled this standard library for osx).
Once you have done this, you should be able to import slycot and also run LQR using control.lqr(). In particular, the file python-control/examples/pvtol-lqr.py from the python-control source distribution ran when I tested this process on my mac using a Python 3.4 anaconda environment.
Let me know if all of that works. If so, you are good to go and I'll document this fix in the (to be created) troubleshooting section of the user manual.
@murrayrm implemented as you suggested. Still does not work I'm afraid.
import slycot
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/username/anaconda/lib/python3.4/site-packages/slycot/__init__.py", line 16, in <module>
from .analysis import ab01nd,ab05md,ab05nd,ab07nd,ab08nd, \
File "/Users/username/anaconda/lib/python3.4/site-packages/slycot/analysis.py", line 21, in <module>
from . import _wrapper
ImportError: dlopen(/Users/username/anaconda/lib/python3.4/site-packages/slycot/_wrapper.so, 2): Library not loaded: /opt/local/lib/libgcc/libgfortran.3.dylib
Referenced from: /Users/username/anaconda/lib/python3.4/site-packages/slycot/_wrapper.so
Reason: image not found
And trying to use lqr() yields
Traceback (most recent call last):
File "/Users/username/anaconda/lib/python3.4/site-packages/control/statefbk.py", line 188, in lqr
from slycot import sb02md
File "/Users/username/anaconda/lib/python3.4/site-packages/slycot/__init__.py", line 16, in <module>
from .analysis import ab01nd,ab05md,ab05nd,ab07nd,ab08nd, \
File "/Users/username/anaconda/lib/python3.4/site-packages/slycot/analysis.py", line 21, in <module>
from . import _wrapper
ImportError: dlopen(/Users/username/anaconda/lib/python3.4/site-packages/slycot/_wrapper.so, 2): Library not loaded: /opt/local/lib/libgcc/libgfortran.3.dylib
Referenced from: /Users/username/anaconda/lib/python3.4/site-packages/slycot/_wrapper.so
Reason: image not found
@murrayrm still no dice. The test env. works fine, but import slycot gives the same error as above, but now just in the test environment.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/username/anaconda/envs/python3.4-slycot-test/lib/python3.4/site-packages/slycot/__init__.py", line 16, in <module>
from .analysis import ab01nd,ab05md,ab05nd,ab07nd,ab08nd, \
File "/Users/username/anaconda/envs/python3.4-slycot-test/lib/python3.4/site-packages/slycot/analysis.py", line 21, in <module>
from . import _wrapper
ImportError: dlopen(/Users/username/anaconda/envs/python3.4-slycot-test/lib/python3.4/site-packages/slycot/_wrapper.so, 2): Library not loaded: /opt/local/lib/libgcc/libgfortran.3.dylib
Referenced from: /Users/username/anaconda/envs/python3.4-slycot-test/lib/python3.4/site-packages/slycot/_wrapper.so
Reason: image not found
@slivingston Tried conda uninstall slycot, and generally reproducing the entire problem without using pip . Also, does not seem to change anything.
Since I found this open issue when googling the same error message, it is useful here to note that the conda-forge installation process for control and slycot (see #115) solved this problem for me, presumably because it uses an older version of LAPACK.
I think this issue is "resolved" from the point of view of python-control, in the sense that it relates to getting a working version of slycot up and running. As @repagh noted above, the issue with lapack as been resolved in Slycot PR #13.
Activity
murrayrm commentedon Dec 24, 2016
I can confirm this error on python3.4 using conda (using ubuntu linux). It works correctly using python3.5 (installed via conda), so appears to be something unique to the python3.4 conda build?
murrayrm commentedon Dec 24, 2016
A bit more info: the problem seems to be in the version of
numpythat is getting loaded byconda. Usingipython, I get the following error:@TMorville can you give a bit more info on how you installed python-control? Was it via conda, pip or source?
I was able to get
python-controlandlqrto work (tested usingexamples/pvtol-lqr) by uninstallingcontrolusingand then installing the
python-controlpackage from source:This let me use the
condaversion ofslycot(so no FORTRAN compiler required) but the latest version ofnumpy(so no issues with the version error).TMorville commentedon Dec 25, 2016
Python is anaconda build, slycot and control was installed with pip. My PATHs are correct and which python yields correct lib. Also I've tried to build control from source as you suggested, but with the same error as I posted above. I've never seen the error related to numpy.
murrayrm commentedon Dec 26, 2016
I did a bit more checking and have reproduced this error in an anaconda build on my mac, using the
control-0.7.0install instructions. It looks like the issue that I ran into is that there were missing libraries that causedslycotto fail, which then generated the errors above.Slycotwas installed via pip, but looks like the required libraries didn't copy over.@TMorville: what OS are you using? We may need to redo the
slycotbuilds onpython.orgto get pip working correctly. (@cwrowley: will need your help with this, since I am not listed as a maintainer forslycot).TMorville commentedon Dec 27, 2016
@murrayrm I'm on OS X, Sierra 10.12.2. Slycot is 0.2.0 and Control is 0.7.0. Let me know if I can do anything else.
murrayrm commentedon Dec 29, 2016
@TMorville: OK, I have a possible fix but need some help in trying it out. First, you need to uninstall the current
slycotinstallation that you have installed with pip:Now re-install slycot using conda:
This command should install
slycot-0.3.0from the python-control channel andlapack-3.5.0from the cyclus channel (who has compiled this standard library for osx).Once you have done this, you should be able to
import slycotand also run LQR usingcontrol.lqr(). In particular, the filepython-control/examples/pvtol-lqr.pyfrom thepython-controlsource distribution ran when I tested this process on my mac using a Python 3.4 anaconda environment.Let me know if all of that works. If so, you are good to go and I'll document this fix in the (to be created) troubleshooting section of the user manual.
TMorville commentedon Dec 29, 2016
@murrayrm implemented as you suggested. Still does not work I'm afraid.
import slycotAnd trying to use
lqr()yieldsmurrayrm commentedon Dec 29, 2016
Strange. Can you try setting up a clean environment and then doing an install. Here are the commands that I used (and that worked on my machine):
Let me know if that generates the same error. If so, I'll have to figure out what to uninstall from my test environment to recreate the problem.
slivingston commentedon Dec 30, 2016
The original path of
slycotshown in the error message of the opening post is in an Anaconda directory.@TMorville Instead of using
pipto remove the package (as in #121 (comment)), consider tryingTMorville commentedon Dec 30, 2016
@murrayrm still no dice. The test env. works fine, but import slycot gives the same error as above, but now just in the test environment.
@slivingston Tried
conda uninstall slycot, and generally reproducing the entire problem without usingpip. Also, does not seem to change anything.repagh commentedon Jun 12, 2017
This relates to the use of a newer LAPACK, from which dgesv has been deprecated and removed. See pull request number 13 on Slycot
herovit commentedon Sep 13, 2017
Since I found this open issue when googling the same error message, it is useful here to note that the conda-forge installation process for control and slycot (see #115) solved this problem for me, presumably because it uses an older version of LAPACK.
slivingston commentedon Sep 15, 2017
thanks @herovit
note that the link in your comment has empty target, so directs back to this issue (rather #115).
murrayrm commentedon Dec 30, 2017
I think this issue is "resolved" from the point of view of python-control, in the sense that it relates to getting a working version of slycot up and running. As @repagh noted above, the issue with lapack as been resolved in Slycot PR #13.