Closed ifmihai closed 10 years ago
wow, thanks for letting me know that brew offers cspice, who knew? You have to find out in what folder cspice is installed, and create a symlink to the PySPICE folder:
cd to_pyspice
ln -s path/to/cspice cspice
then follow the readme.
I'm glad brew offers cspice also of course :)
But then, pySPICE will be installed in where exactly? in anaconda distribution?
oh, yes. but only if the python compiler that is used in the moment for the setup.py install command is the one from anaconda. So you have to adapt the paths correctly before you do the install. Check with
which python
If the path does not mention anaconda, then u r not done yet. After the install is done, you will be able to do:
import spice
and find the usual spice functions (not all, alas) under the spice module namespace. If half of what I say sounds strange to you, I urge you to at least go through the Python tutorial on python.org and for the calculations, go through a numpy tutorial. Don't waste time for understanding the depths of Python installs yet, I only learned that after using Python for years, and it can be frustrating.
Some quirks:
ln -s /usr/local/Cellar/cspice/64 cspice
python setup.py build_ext
workedpython setup.py install
worked also.
(although, i see mentions of macosx-10.5 in there)python import spice
but it throws exception:1 In : import spice
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-895c03879cbe> in <module>()
----> 1 import spice
/Users/ifmichael/github/PySPICE/spice/__init__.py in <module>()
1 # Released under the BSD license, see LICENSE for details
2
----> 3 from misc import *
4 from objects import *
/Users/ifmichael/github/PySPICE/spice/misc.py in <module>()
1 # Released under the BSD license, see LICENSE for details
2
----> 3 from _spice import *
ImportError: dynamic module does not define init function (init_spice)
64
in above path a folder? It has to be for this to work.spicemodule.c
? If not, it did not work properly./cc @rca ?
If my worry is true, you would have to remove brew's cspice (just to be clean) and install the 64-bit cspice folder that you can download from the NAIF SPICE website directly. I have exactly your setup, so I'm convinced that that way works, I am running it now like that.
well, if downloading from NAIF SPICE website works, then great! I try again.
python setup.py build_ext
it throws exception apparently79-117-239-118:PySPICE ifmichael$ python setup.py build_ext
making wrapper
Traceback (most recent call last):
File "setup.py", line 84, in <module>
make_spice_module()
File "setup.py", line 67, in make_spice_module
f.write(mkwrapper.main(CSPICE_SRC))
File "/Users/ifmichael/github/PySPICE/mkwrapper.py", line 1004, in main
if gen_wrapper(curr_prototype, buffer):
File "/Users/ifmichael/github/PySPICE/mkwrapper.py", line 259, in gen_wrapper
param_info = parse_param(param)
File "/Users/ifmichael/github/PySPICE/mkwrapper.py", line 837, in parse_param
raise msg
ValueError: invalid literal for int() with base 10: ''
[EDIT] I started from scratch with PySPICE also. fresh everything.
Confirmed. That's a new problem with version 65, note that this version was released on July 23rd. Workaround: Use version 64 from here, I just reconfirmed that it works with this version: https://www.dropbox.com/s/z62rouwhbt9nc2o/cspice_64.tar.Z
I did fresh everything again.
but in ipython, when import spice
it throws the same exception as in the beginning:
1 In : import spice
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-895c03879cbe> in <module>()
----> 1 import spice
/Users/ifmichael/.Trash/PySPICE/spice/__init__.py in <module>()
1 # Released under the BSD license, see LICENSE for details
2
----> 3 from misc import *
4 from objects import *
/Users/ifmichael/.Trash/PySPICE/spice/misc.py in <module>()
1 # Released under the BSD license, see LICENSE for details
2
----> 3 from _spice import *
ImportError: dynamic module does not define init function (init_spice)
I suspect something must be wrong on my side, if you say it works in your case.
Actually, I see it's not the same exception Somehow it access the trashed PySPICE (!?!)
It was because github I presume, or unpacker or both I deleted trash completely cloned again copied spice 64 from your source and now it works!
I was also unable to properly install Pyspice with cspice 65, but was able to with the previous version that michaelaye provided. I'm running Python 2.7.8 on OSX 10.9.4. Additionally, it's worth noting that the problem seemed to be occurring with spicemodule.c that makewrapper.py was creating. In cspice 65, it would be generated, but would be blank.
I close this because it has lot's of other stuff in the issue that is unrelated. We have a duplicate report in #17 that I keep open.
Im on a mac, mavericks 10.9.4, anaconda latest version, brew latest version
For now, I've installed cspice with brew
but now I'm not sure what to do, as I'm by no means a python or linux expert
Can someone point me in the right direction?