I am trying to run a Python program, written around 2001. I cant get it to run because a lot of the function s aren't recognised.
My best guess is that this is because the program was written using the scientific python modules based on the now deprecated numerical python, rather than its successor, numpy. I have been able to download the old numerical python, but I can't find old scientific python modules, only later ones based on numpy.
Does anyone know where I can download the old scientific python modules based on the deprecated numerical python?
Thanks
Mark
Here is a link to an old version from 2003.
You might also have to get a different python interpreter as well. Good luck!
Related
I am brand new to FreeCAD and fairly new to python in general.
I have a project going on in which I have a list of several hundred (x,y) coordinates stored in two columns in an Excel doc. These points define a slice of an elevation profile. What I'm needing to do is draw a line/shape in FreeCAD using these points that can then be extruded into an extended version of this shape. Since the data is currently in excel, I'm leaning towards using pandas to access it, but I'm open to other ideas.
The problem I'm having with this line of thinking so far is that I can't figure out a way to access pandas from inside FreeCAD, so I've been attempting to use Winpython(2.7.10) through the Spyder ide to import FreeCAD(0.16) and pandas into the same script. I've tried adding both the Freecad/bin and Freecad/lib folders to my path (using this recommended method https://www.freecadweb.org/wiki/Embedding_FreeCAD/en), but have yet to have any success importing.
The error is: "DLL load failed: The specified procedure could not be found." .... Searching around, I can't seem to find FreeCad.dll or FreeCAD.so anywhere in my install, yet FreeCAD runs normally when used independently.
To summarize: Wanting to run FreeCAD through an external python console in order to access excel data through pandas (which doesn't seem to be available within FreeCAD itself). In doing so, I get an error and FreeCAD isn't accessible. It might be a version compatibility issue, or something more complex.
If you made it here, thank you for taking the time to read through my fairly complex/niche problem. Please feel free to suggest any more elegant alternatives, as I said, I'm new to this and likely haven't come across all possible solutions.
Thank you
I'm not exactly certain what "pandas" is - a quick search didn't reveal anything except the game engine Panda3D and the animal itself...
As for accessing data external to FreeCAD, this is something I've been exploring myself lately. At the moment, some success has been achieved by starting FreeCAD in server mode and having it watch an excel file, then running python script when it changes.
This approach would allow you to parse an Excel file using commonly available python libraries for that purpose.
EDIT:
Having been informed on just what pandas is, it seems odd you can't make it work with FreeCAD. However, there could be a number of causes:
Old version. FreeCAD is undergoing really significant change right now. Ensure you're using the latest stable release (0.17 - Roland), but I'd recommend getting your hands on the latest 0.18-dev release
Incorrect python version - FreeCAD currently is built on Py2, though Py3 builds are possible (I run FreeCAD / Py3 on my linux machine). Ensure you've installed pandas appropriately to match the python version FreeCAD depends upon (Py2, most likely).
Invalid install - If you know pandas imports and works in the python interpreter itself, try importing and running pandas code from the FreeCAD python console.
I'm helping my wife try and navigate IBM SPSS and python. She knows SPSS, and I kinda know python -- We might be able to work together. As it stands, I understand that I can call small snippets of python from within an SPSS syntax. While this is useful for looping and conditional branching based on data, it seems a little fuzzy to me. It almost feels like Inversion of Control, but not really.
I was wondering is it possible to have a python script, external to an spss syntax, that can still use the SPSS libraries in any meaningful way, or do I have to keep my scripts confined to the SPSS syntax and runtime?
Yes, you can run Statistics in external mode from a Python or R program. You might have to add the SPSS Python directory to your Python search path, but then just do
import spss
and run your Python code. The only thing you can't do is Viewer and user interface stuff, because there is no SPSS UI in that mode. By default, you will get output as text (which you can turn off when you get the hang of things). If you want better quality output, you can use OMS to capture output in a wide variety of formats.
Note that you need a compatible version of Python if you don't use the one installed with SPSS. That would be 2.7 for most Statistics versions. The Python installed with Statistics is not registered, but you can install a standard version from Python.org and just add the SPSS Python directory to the search path.
HTH
I'd like to upgrade to python 3.5, but I use legacy python 2.7 packages. Is it easy to run legacy packages in python 3.5? I have been under the impression that this isn't easy, but I did a few searches to see if I'm wrong and didn't come up with much.
I would expect there to be a multiprocessing package that allows standardized hand-offs between 3.5 code and 2.7 packages, allowing them to run independently under their own environments, but being somewhat seamless to the developer.
I'm not talking about converting my own code to 3.5, I'm talking about libraries that I use that won't be updated for or by me.
If you used the newer syntax supported by 2.7, e.g. around exceptions, and/or, better yet, worked with new features imported from __future__, you'll have much easier time converting your code to Python 3 (up to no changes at all). I'd suggest to follow this path first, for it can be trod gradually, without an abrupt jump to Python 3.
I suppose Python processes with different versions can interoperate, because object pickling format is compatible, and you can explicitly use a specific pickling protocol version on both sides to ensure that. I don't think multiprocessing packages on either side would be too useful, though. Consider using e.g. ZeroMQ as a more general solution.
Unfortunately there is no "nice" or automatic way of handling the processing of 2.7 code under 3.5 (that works perfectly).
You mentioned that you are concerned about libraries, not your own code - firstly, you'd hope that if they are under active development, they will be updated. If not, as you stated, then there is a possibility that they were written to be future proof. I've found some good ones are (e.g. google-api-python-client, e.g. https://github.com/google/google-api-python-client/blob/master/setup.py).
Failing that, the only way to upgrade is to fix all the syntax changes yourself. Most common ones I deal with are around 'print' and exception handling.
As we all know, usually Python projects exclusively run on the Python version (2 or 3) that they were made for.
However, when I come across Python projects, for example this one on GitHub, they almost never state the necessary Python version.
How do you know which Python you need to run the project?
Python doesn't support a means to determine this automatically.
You (the author of a python project) can make your python application friendly, as discussed here.
However, if the author didn't do that (and most don't) then you can only try and hope for the best, AFAIK.
I need an editor with python built into it. Currently I use blender so I do not have install python. Blender comes with the python32.dll to use python. is there another editor out there that I can execute python commands without it being installed?
I don't understand the question fully either. Why NOT install python? But if the question is how to be able to edit and run python on machines without installing it, there's Movable Python (http://www.voidspace.org.uk/python/movpy/) with a small fee to purchase and Portable Python (http://www.portablepython.com/wiki/About), free, donation requested. I've used Movable Python and can vouch for it. I've never tried Portable Python.
ViennaMike referenced Movable Python which has a small fee, after I had asked the question, I did more searching and found movable python about the same time he suggested it. I seems to find something different.
http://code.google.com/p/movable-python/
this seems to be a free version of movable python. This is only the IDLE portion of python, but can be used to run *.py files. It is considerably smaller than a normal python installation, and comes in a zip file.
Several people asked about my ability to install an editor but not python. At my High school (I work with the IT dept as one of my classes) I find python helps a lot with some tasks. I am unable to install python due to admin rights (which I will have next year) so anytime I did install python, because of its size on the Network drive, it would be automatically deleted.
Thank you ViennaMike again for finding movable python, unfortunately, it only works with python 2.5, so I may see if there is a way I can get that to 3.2