-
Notifications
You must be signed in to change notification settings - Fork 15
PySPICE fails to install #6
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
Comments
what do you mean by "cspice is compiling 64 bit as well' ? Are you compiling your own cspice? I am asking because usually NAIF delivers usable binaries in its distribution files? |
Hi there! I'm bumping into exactly the same problem described above. I'm running the 64bit Linux SPICE (http://naif.jpl.nasa.gov/naif/toolkit_C_PC_Linux_GCC_64bit.html) and python 2.7. I also tried Apollo117's Python3 fork, but again got the same error. Any advice? |
Hi Apodemus, Firstly, apologies to Michael Aye, for some reason I never saw your email Anyway, I fixed the missing init function error, but this was a couple of I think the line hardcoded a path to a shared object library previously generated by CSpice Hope that helps. Fergal On 6 August 2014 05:48, apodemus [email protected] wrote:
|
Hi Fergal The manual build did the trick. So simple - should have done that straight away! Thanks! |
Have the same thing happening. Can not do the manual install as python mkwrapper.py /myPathTo/PySPICE-master/cspice > spicemodule.c fails with File "mkwrapper.py", line 1077, in I had pyspice working on several machines under linux, but with mint 17 it now fails. cheers |
Quick solution for N0065: |
thanks, that worked fine. Although some funky permission issues: /usr/local/lib/python2.7/dist-packages/spice/ and _spice.so had reading permissions |
I have the same problem.
seems to give problems, producing in turn that
message. That open bracket/space/closed bracket raises an exception in mkwrapper.py. Eliminating the space doesn't seem to take the problem away. This does not happen in linux 32b AFAIK, as other colleagues installed it correctly, but I haven't had the time to install it on a VM and test it myself. |
Quick solution for N0065: |
@drbitboy thanks for this fix. |
I have problems after installing PySPICE for linux suse 32 bit to use SPICE in the 32 bit version. |
Please specify "appears in the python library". Do you mean "import spice" On Mon, Mar 16, 2015 at 8:47 AM, antonio19812 [email protected]
|
This is the screenshot. |
This wrapper of SPICE is not really maintained. I'd checkout SpiceyPy by Andrew Annex if I were you: https://github.com/AndrewAnnex/SpiceyPy |
Do this at a shell prompt: python -c 'import spice;spice.tkvrsn("toolkit")' please and paste the result in a response here. |
whoops that should be:
|
This is what I got on the shell prompt: antonio@linux-zrhc:~> python -c 'import spice;print(spice.tkvrsn("toolkit"))' If you will help me it would be great... |
I'll do my best try this command:
and post the results again. I don't know where your _spice.so file will be; for me it is in
under the top of the PySPICE/ area, but it is also in
|
the result is : |
you have to figure out what "path/to/" is. |
and how can I do it? i am getting confused !!! |
there is a file called _spice.so, it has been installed on your system, the "path/to/" is the directory where it resides. You need to figure out what that directory is. e.g. try
? |
It is exactly in the site-packages directory!! I found it before reading your post but I could not enter here!! |
I used "path/to/" as a placeholder for you to replace. what was the result of the nm ... grep command? |
here is the result : 00002ee8 t __frame_dummy_init_array_entry |
Actually, if you need the GETFOV function, you might indeed be better of with SpiceyPy, because our PySpice implementation does not yet encompass all available SPICE functions. @johnnycakes79 could confirm, if GETFOV works with SpiceyPy. I have a github version of PySpice that has GETFOV working as well, and maybe Brian's version works as well, but I don't remember if we ever merged it into here? |
Actually I have to use various function from Spice, not GETFOV but GETFOV can help me to understand some key elements of spice and the kernels..I did not know SpiceyPy, I have been told only about PySpice. |
Your PySPICE did not build correctly, something is missing.
If you want to do a google hangout I can watch and coach you through it. |
This is what I did.. then I put the Cspice uncompressed folder in the PySPICE-master folder that is obtained by uncompressing the PySpice-master.zip ..and then I followed the instructions of the readme file.. |
hmm, that should have worked. try using my PySPICE (https://github.com/drbitboy/PySPICE), put in cspice, then rm -R ./build |
I will try those lines. The kernel is the main part if I want to start using the routines... |
the line : find . | sort gives in the terminal as output all the possible files in the python workspace (the name for Eclipse of the directory where I save my python projects and the files to read). Of course the Spicey package is not in the workspace directory but I added it in the PYTHONPATH and then in python with the line import SpiceyPy as sp sp.furnsh('example.ti') python can not find the kernel. Sorry for the question but the lines : kernels/ should be executed in the SpiceyPy-master directory ? |
Executing the line: antonio@linux-zrhc:~> find / kernels the directory has not been found |
I was setting up a hypothetical (and leaving out a lot of details that I think of as obvious) where the top directory (not /, but something like /home/antonio/getfovtestingdirectory/) has two sub-directories in it, kernels/ and src/, the kernels/ sub-dir has example.ti in it, and the src/ sub-dir has test_getfov.py in it. it was just a hypothetical to make the point that the single string argument to the .furnsh call needed the same full path to example.ti, e.g. (../kernels/example.ti) in it that you would need if you were browsing, using more, the the contents of example.ti from the src/ sub-dir:
the listing of files (kernels/, kernels/example.ti, src/, etc. - btw, they should all be prefixed with a ./) was the output of the 'find | sort' command in the sample directory & file structure I created. |
I did not understand, it is just my fault. The problem is my lack of knowledge about Linux stuff and that makes me confused also with the other elements. I have worked with python in and its packages in windows for 4 months with results and no problems. The situations is worse now in Linux for me. So I need the full path to the kernel example.ti The problem is how can I find it? executing the 'find | sort' instruction I did not see the kernels directory in the list. It is surely my fault, no doubt about it |
Try this: |
okay, you are young and probably only heard the Ancient Songs of DOS from dinosaurs like me. When in Linux (actually Unix(tm)), the term "path" refers to a directory (equivalent of "folder" in Windows terminology) or to a file. When traversing directory trees, there are two types of paths, absolute and relative:
An absolute path to a file is good because it will work no matter what your CWD is; an absolute path is brittle because it will fail to work if the path down the directory tree it embodies is changed. A relative path to a file is good because it allows you to move an entire sub-directory tree around without having to re-code absolute paths, and the file will normally only be accessed from certain CWDs in that tree; a relative path will sometimes fail if you are not in the CWD from which it was designed to work. Special for a directory tree: ../ is the directory above your CWD, ../../ is two directories above, etc. That is a very brief and incomplete definition of path but it should get you started; you should probably look something up that is more thorough and/or in your native language (and I am not acting superior there; your English is much better than my Italian!). Ciao, ragazz'! |
Funny story: I once deleted the .. directory using a GUI file manager, in an early version of AIX, as root. Within minutes I could not ls or do many other normal shell operations. Then our network manager comes in and asks me why my system was trying do delete files from the NFS servers (unsuccessfully; user root becomes user nobody with almost no permissions in certain cases). When he said that, the light came on and I hit the power switch. |
Oh my god your script works!!!! I have to undersrtand..._I will not sleep until I will have understood everything :))) I will offer you an italian pizza, a true one!! |
I also tried the examples from other functions, the problem is always the same, the routines could work but Python can not load the kernels...so I have to find where they are LOL |
A true pizza? I am going to start looking for conferences I can attend in Italy! |
Are the examples the SpiceyPy tests?
|
Are you using a metakernel to load your kernels? If so could you post it here. |
not for nothing, but i find putting the meta-kernel into the Python source is a nice hack that keeps things like tests more self-contained (anything with external kernels is always going to be messy, but one less file would be nice).
For some tests of text kernels (e.g. IKs, FKs) it should be possible to put the kernel pool variables into the Python source:
|
So ary for answering so late, I nhad unexpected problem with the connection at home, and I could not answer today while working. I will answer now to all the questions |
First answer for @drbitboy : the examples I am referring to are the ones in the documentation of each spice routine. I have no tried the SpiceyPy tests.Should I? |
For @drbitboy and @johnnycakes79 : I try to give a detailed explanation of the situation at the moment. import SpiceyPy as sp I can access to all the routines and writing sp. I obtained the list of all the functions with their short explanation. The SpiceyPy package is installed in the Site-Packages directory, under the Python 2.7 interpreter that is the one I am currently using. Thanks to @drbitboy and @johnnycakes79 I noticed the spicey tests in the folder "test" of the directory SpiceyPy-master and by terminal I executed both. antonio@linux-zrhc:~/Programs/SpiceyPy-master/test> python gettestkernels.py Downloading: vg200022.tsc Done writing test meta kernel. All the kernels showed are downloaded in the "test" folder and not in my current working directory, there is also a test meta-kernel file called : testKernels.txt and it has this structure : \begindata This is the only metakernel I can find, answering to @johnnycakes79 . I also executed the second test called test_wrapper.py and thi is the output : antonio@linux-zrhc: all that said, what should I do?? what should I put in my working directory to access all the standard kernels?? |
pytest is a generic Python testing framework. You need to install it on your system. if you are debian-based, this might work: sudo apt-get install python-pytest or if RedHat/CentOS: yum install python-pytest ? |
I am working with OpenSuse 13.2 that should be close to RedHat if I am not wrong, so I will try that one... |
AndrewAnnex wrote:
Yes, we wrote a similar script for PySPICE some time ago (January, 2013). |
sorry I was wrong the Yum line is not the one for opensuse, I have installed pytest with: pip -U pytest and it was succesfully installed Now i try again the test_wrapper.py |
I executed this line : linux-zrhc:/home/antonio/Programs/SpiceyPy-master/test # python test_wrapper.py and there was no output just the command line linux-zrhc:/home/antonio/Programs/SpiceyPy-master/test # what does it mean? |
CHDIR (cd) to the top of the SpiceyPy directory tree and do this:
|
I have done it..I post the giant result : linux-zrhc:/home/antonio/Programs/SpiceyPy-master/test # cd.. Downloading: vg200022.tsc Done writing test meta kernel. test/testKernels.txt . |
try it again. i suspect a minor hiccup. |
The output is exactly the same. I wonder if it my fault , if I have done something wrong before.. |
Guys, as much as this help is appreciated, this is now a SpiceyPy install/use help and therefore not related to this Github issue at all. I suggest to move to Gitter? |
I agree with @michaelaye. Also @antonio19812 you should seek more local support from your ESAC supervisor... To me it seems he or she has really thrown you in the deep end and while your initiative is to be recognised you shouldn't have to spend so much of your short traineeship debugging install problems! |
Actually what I am trying to do , @johnnycakes79 , is to access the standard kernels because I would like to practice with Spice using the examples in the documentations , so that I can try various kind of input and see the output and so on..but for my project I talked with my supervisor and I have been told that the kernels I need are available only in the Planetary Archive and I downloaded them. So at the moment I think that I have everything to go on with my project, but at the same time it could be useful for me to have a complete configuration of SpiceyPy. No problem for me to move to Gitter for my problem. |
Just to thank drbitboy: I was having exactly the same problem as antonio19812 and your fix solved me. |
I'm having some trouble getting PySpice installed on my machine.
It compiles without warning:
$ CSPICE_SRC=/home/fmullall/apps/cspice/
$ export CSPICE_SRC
$ python setup.py build_ext
running build_ext
building '_spice' extension
creating build
creating build/temp.linux-x86_64-2.7
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/home/fmullall/apps/cspice/include -I/usr/include/python2.7 -c pyspice.c -o build/temp.linux-x86_64-2.7/pyspice.o
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/home/fmullall/apps/cspice/include -I/usr/include/python2.7 -c spicemodule.c -o build/temp.linux-x86_64-2.7/spicemodule.o
creating build/lib.linux-x86_64-2.7
gcc -pthread -shared build/temp.linux-x86_64-2.7/pyspice.o build/temp.linux-x86_64-2.7/spicemodule.o -L/home/fmullall/apps/cspice/lib -L/usr/lib64 -lcspice -lpython2.7 -o build/lib.linux-x86_64-2.7/_spice.so
and installs without incident:
$ python setup.py install --prefix=~/.local/
running install
running build
running build_py
creating build/lib.linux-x86_64-2.7/spice
copying spice/objects.py -> build/lib.linux-x86_64-2.7/spice
copying spice/init.py -> build/lib.linux-x86_64-2.7/spice
copying spice/misc.py -> build/lib.linux-x86_64-2.7/spice
running build_ext
running install_lib
copying build/lib.linux-x86_64-2.7/_spice.so -> /home/fmullall/.local//lib64/python2.7/site-packages
running install_egg_info
Removing /home/fmullall/.local//lib64/python2.7/site-packages/Spice-1.0-py2.7.egg-info
Writing /home/fmullall/.local//lib64/python2.7/site-packages/Spice-1.0-py2.7.egg-info
But when I run it, I get an error message:
$ PYTHONPATH=$PYTHONPATH:/home/fmullall/.local/lib64/python2.7/site-packages/
$ python -c 'import spice'
Traceback (most recent call last):
File "", line 1, in
File "spice/init.py", line 3, in
from misc import *
File "spice/misc.py", line 3, in
from _spice import *
ImportError: dynamic module does not define init function (init_spice)
The readme files suggests this might be a 32/64 bit problem, but cspice
is compiling 64 bit as well, as best I can tell. Any ideas what I'm doing wrong?
The text was updated successfully, but these errors were encountered: