Closed jhillairet closed 5 years ago
I suspect the problem is that you are installing the python module from the head of the git repository which is likely to be incompatible with the MDSplus libraries that you currently have installed on your system. You should instead use the python sources found in /usr/local/mdsplus/mdsobjects/python which should be compatible with the installed libaries:
$ pip install /usr/local/mdsplus/mdsobjects/python
OK, I understand. Seems by the way that python and ipython doesn't see the same path or environment variable...
My goal was however to use the latest MDSplus libraries, since the one installed on /usr/local is rather old. (The real reason behind is that I got some error from MDSplus when looking to the CEA mdsplus server, I just would like to see if it is still the same situation with latest MDSplus version...). How can I do that ?
The best solution is to have the system manager update MDSplus on the system. The second best solution would be to try it on another system which has a more recent version of MDSplus installed. If you don't have either of those options then you will either need to attempt to build MDSplus from sources or manually download recent MDSplus installers from the MDSplus web site and try to install them to another directory or use tools to extract the contents of the installers and define environment variables to point to the libraries etc.
Edit: Interesting, when I first came across this error, it was the mdsdcl error. When I regenerated the error to ask about it here, it changed to a mdsshr error, and I didn't notice. My apologies for the confusion below. Let me know if I should repost my error as a new issue or maybe it's related enough. Thanks.
Hello, I'm also having a very similar problem. As of today, I installed a fresh Ubuntu 18.04 build onto my laptop (wanted a clean upgrade from ubuntu 16), and I am getting (I think) the exact same mdsdcl error as jhillairet. To make sure none of the other programs/libraries/etc were causing the problem, I wiped my computer again and immediately reproduced the error with the following steps:
$ sudo apt-get install python-pip
$ cd ~/Downloads/mdsplus-alpha/mdsobjects/python
$ pip install .
Processing /home/john/Downloads/mdsplus-alpha/mdsobjects/python
Installing collected packages: mdsplus
Running setup.py install for mdsplus ... done
Successfully installed mdsplus-1.0
$ sudo apt-get install python-numpy
$ python
Python 2.7.15rc1 (default, Nov 12 2018, 14:31:15)
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import MDSplus
and immediately get:
Issues loading MdsShr, trying find_library
Issues loading MdsShr, trying find_library
Issues loading MdsShr, trying find_library
Issues loading MdsShr, trying find_library
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/john/.local/lib/python2.7/site-packages/MDSplus/__init__.py", line 86, in <module>
load()
File "/home/john/.local/lib/python2.7/site-packages/MDSplus/__init__.py", line 82, in load
loadmod_full(mod,gbls)
File "/home/john/.local/lib/python2.7/site-packages/MDSplus/__init__.py", line 75, in loadmod_full
mod=_mimport(name)
File "/home/john/.local/lib/python2.7/site-packages/MDSplus/__init__.py", line 44, in _mimport
return __import__(name, globals())
File "/home/john/.local/lib/python2.7/site-packages/MDSplus/mdsdata.py", line 35, in <module>
_dsc=_mimport('descriptor')
File "/home/john/.local/lib/python2.7/site-packages/MDSplus/mdsdata.py", line 30, in _mimport
return __import__(name, globals())
File "/home/john/.local/lib/python2.7/site-packages/MDSplus/descriptor.py", line 39, in <module>
_MdsShr=_ver.load_library('MdsShr')
File "/home/john/.local/lib/python2.7/site-packages/MDSplus/version.py", line 76, in load_library
raise Exception("Could not find library: %s"%(name,))
Exception: Could not find library: MdsShr'
As suggested here, I also tried editing sources.list, adding the key, updating, and $ sudo apt-get install mdsplus-python
, but this resulted in the same error as above.
tfredian, to be honest, I'm not quite following your latest post.
Does anyone have any suggestions? Thank you.
If you installed the mdsplus-python via apt-get I assume it installed several other mdsplus packages such as mdsplus-kernel, mdsplus-kernel-bin etc.. The required shared libraries should have been installed in /usr/local/mdsplus/lib64. Your post referred to some ~/Downloads/mdsplus-alpha/mdsobjects/python drectory which may be incompatible with the installed mdsplus. I don't know if you specified stable or alpha in your sources.list but in any event after installing the mdsplus-python package the matching python code should be in /usr/local/mdsplus/mdsobjects/python and that should be used with pip using 'pip install /usr/local/mdsplus/mdsobjects/python'. After doing the install you will need to log out and log back in to get the environment variables correct or just do: 'source /etc/profile' to get the needed environment variables.
can we close this issue: If kept open for future references, should we add a FAQ report under http://www.mdsplus.org/index.php?title=Documentation:FAQ In general should we consider this for other help_wanted tagged issues
Hello,
I have a anaconda (conda 4.3.11) Python 2 distribution (2.7.13 64bits), in which I wanted to install the latest version of MDSplus python binding.
I've cloned the git repository, and installed the python package into my conda environment as :
pip install ~/mdsplus/mdsobjects/python
. Installation works, at least seems to:however, starting python and importing MDSplus leads to the following error:
interestingly, the error is not the same when using python instead of ipython :
Do you any suggestion on how to solve that ?