I'm quit new in using python. The current version I'm using is 2.7. I need to employ function mncontour in minuit which requires the installation of natgrid as additional toolkit for matplotlib. I downloaded natgrid 0.2.1 with a file named setup.py in it. I ran this setup.py through python shell without reaching any error. But it seems that the installation was not succeed. Anyone has any idea how the installation can be done? Many thanks.
Liang
Could you please provide some more information on this topic.
what operating system you are working with ( some offer more support than others for python)
have you installed python headers, and a C/C++ compiler in your environment? ( numerical libraries might require native code to speed up the computation)
Have you tried a package manager for python ( such as easy or pip)? Both work on both windows and unixes, and usually download and install all the needed packages to make your module working.
A piece of the setup's output before setup.py finished would help us help you greatly.
Python for Windows [Nt - 7] is compiled with either cygwin or mingw, thus you not only need the python environment, but also said compiler, and python headers. If you want a more point and click install, then there's this professor at this university who maintains a good and up to date repository of scientific python modules, that depend on native extensions ( among which numpy, scipy, matplotlib).
http://www.lfd.uci.edu/~gohlke/pythonlibs/
Manuals to setup mingw and python :
https://docs.python.org/2/using/windows.html
MingW can be downloaded from here:
http://www.mingw.org/
Best option for installing natgrid is from conda
conda install -c jochym natgrid=0.2
Related
I am currently attempting to install a third-party package (gnuradio, to be specific) into the Canopy version of Python on an Ubuntu computer. I currently have the entire package stored in my filesystem as a folder with subfolders and python files; however, I have been able to find no information as to how to make the transition into a functionally installed and recognized package. How can I do so?
You shouldn't use third party pythons on Ubuntu, unless you very exactly know what you're doing (you don't). Ubuntu keeps your python up-to-date and uses the package manager to install pack
So, setting up a recent version of python is just
sudo apt-get install python
So if you still want to integrate GNU Radio into your canopy installation, you will need to get the development headers of exactly their version of python, and specify that you want to only use them etc, and build GNU Radio from source. I do not recommend doing that.
In my opinion, you should probably rather install GNU Radio either from source against the python and libraries on your main OS rather than canopy's happy little installation folder, or use the gnuradio package that Ubuntu has.
I recommend using pybombs to install GNU Radio from source. You'll get the latest and greatest, in a safe install prefix, and easy access to bleeding edge SDR device drivers.
(1) Python packaging is inconsistent, but in general, it suffices to type python setup.py install from the package's top directory (see https://docs.python.org/2/install/#the-new-standard-distutils)
(2) How to be sure that you are installing into Canopy Python rather than your system Python? See https://support.enthought.com/entries/23389761-Installing-packages-into-Canopy-Python-from-the-command-line (tl;dr open a Canopy Terminal window from the Canopy Tools menu.)
EDIT: Marcus Müller has clarified below that gnuradio is not a python package, so this general advice is true but irrelevant. See his answer below.
I am new to Python and I want to install VLFeat on Ubuntu (13.04).
I am using Eclipse 3.8. For Python, I have installed the PyDev extension on Eclipse.
I have installed Numpy, but I don't know how to install VLFeat. I tried to use their website, but I can't get anything for Python. I have downloaded packages, but I don't know how to install them.
The Menpo Project provides a wrapper around VLFeat: it's called cyvlfeat.
To install cyvlfeat, we strongly suggest you use conda:
conda install -c menlo cyvlfeat
If you don't want to use conda, your
mileage will vary. In particular, you must satisfy the
linking/compilation requirements for the package, which include the
vlfeat dynamic library.
In other words, the nice thing about installing with conda is that it will install (and link) VLFeat dependencies as well.
It may not include all functionalities of VLFeat. Current State as of March 2017:
fisher
fisher
generic
set_simd_enabled, get_simd_enabled, cpu_has_avx, cpu_has_sse3, cpu_has_sse2
get_num_cpus,
get_max_threads, set_num_threads, get_thread_limit
hog
hog
kmeans
kmeans
kmeans_quantize
ikmeans, ikmeans_push
hikmeans, hikmeans_push
sift
dsift
sift
Relevant reading
Dev blog by Simmi Mourya. This includes descriptions and usage examples.
More alternatives:
vlfeat-ctypes: minimal VLFeat interface for python
pyvlfeat fork by jchazalon: A high-level Python wrapper around a subset of the VLFeat library [more recently updated than the original]
Note about the IDE
Installing python packages should be independent of the IDE (Eclipse + PyDev, in the OP case), as long as the interpreter and libraries paths are correctly set up.
Note about conda
It is not required to install the Anaconda distribution in order to use conda. The much lighter Miniconda is enough.
Assuming you are getting VLFeat from the Python Package Index, the instructions are
Download distribution, extract it, get to command prompt and type:
$ python setup.py install
I need to support some software that is using an old Python version (2.4). So I have downloaded and compiled Python 2.4 and installed it in a virtualenv. So far, all OK and normal procedure.
But the software is trying to import an rpm module. And I cannot find a source for that module (it is not part of the standard Python library, afaict).
Typically, once the virtualenv is enabled (source env/bin/activate) I can install required software using easy_install. But easy_install rpm is failing to find anything. There is a pyrpm module, but it is not the same thing (it installs a module called "pyrpm"). And google searches are useless, as they all link to articles on how to build rpms...
If I were using the system python (on Ubuntu) I could install the python-rpm package. But that is for Python 2.7. How do I install the equivalent for Python 2.4?
[My impression is that the rpm libraries, used by many Linux systems, include a Python library, which is packaged as python-dev by the distro. But I can't see how to access that for an arbitrary python version.]
I AM NOT LOOKING FOR AN RPM THAT CONTAINS PYTHON 2.4. I AM LOOKING FOR A MODULE NAMED rpm THAT IS USED BY SOFTWARE WRITTEN FOR PYTHON 2.4.
It's right there, in the python-rpm RPM package:
http://rpmfind.net/linux/rpm2html/search.php?query=python-rpm
You will probably want to download the package contents, extract them, and then use
python setup.py install
From your active environment.
Of course, as it's pre compiled, you might have trouble getting the C extension to run.
I'm not familiar enough with RPM's to know whether you can get the source from there.
No guarantees the package will work with your python version though.
there's no simple way to do this; the python library is part of the system rpm package and interfaces to C code, so is closely tied to the rpm package installed on your machine.
instead, it's much simpler to install an old OS in a VM (eg CentOS 5) that uses Python 2.4. then everything is consistent and works.
the sources for the rpm module can be found here: http://www.rpm.org/wiki/Download
After you download the wanted version read and follow the INSTALL instructions in order to compile it on your target OS. Afterwards make sure you add the correct path to the 'site-packages' folder the installation chose into your PYTHONPATH environment variable.
To test start your python interpreter and run 'import rpm'
HTH,
Ran
I have two installations of Python 2.7.2 -- from MacPorts and Enthought -- on my Mac. I use the Enthought Python as the primary one; however, the MacPorts distribution has several additional packages like pymacs, rope etc., which I would like to make available to the Enthought Python. (I'm actually trying to use Emacs w/ Enthought Python, but also make use of the MacPorts-installed Rope, Pymacs for code completion in Emacs).
Is there a clean way to make the MacPorts packages available to the Enthought Python without breaking anything?
It's risky trying to combine the two distributions, as you are likely to get conflicts (especially for C-extensions linked to slightly different versions of shared libraries). This is a common cause of problems with EPD:
https://support.enthought.com/entries/22094157-OS-X-Conflict-with-installed-packages-in-earlier-Python-installation
The recommended way to install new packages in EPD is with the enpkg tool. You can find out more about enpkg with enpkg --help or in this article:
https://support.enthought.com/entries/22415022-Using-enpkg-to-update-EPD-packages
If your package isn't available through enpkg (in your case it looks like rope is while pymacs is not, assuming you have an appropriate subscription), EPD is a very standard python distribution, and you can install packages in it through normal means such as pip or by grabbing the source and running python setup.py install. See:
https://support.enthought.com/entries/22914233-Using-non-EPD-package-installers-such-as-pip
It would be cleaner to install the additional packages once more for the Enthought Python. Trying to reuse packages from another installation seems neither clean nor safe to me.
I'm trying to compile and use the PyGRIB module. There is no binary distribution of the module, so I have compiled using Cygwin. I would really like to be able to use the module in my windows python installation -- I already have numpy, matplotlib, and a development environment setup for my windows installation. How do I do this?
It looks like the Cygwin install creates the following two files:
pygrib-1.9.3-py2.6.egg-info
pygrib.dll
in my c:\cygwin\lib\python2.6\site-packages directory.
I have tried copying these to: C:\Python27\Lib\site-packages but that doesn't seem to do the trick.
If I can't do this, can I get IPython in Cygwin? I haven't seen it in the setup utility.
Honestly, the easiest way to compile on windows when using python is to just use the free visual studios distribution. I've installed many different packages that way and never had an issue. Normally, the installation will place the path variable on your path, but you will need to verify that.
You need to make sure to use 2008 though, and not 2010.
You can retrieve it from here:
http://msdn.microsoft.com/en-us/express/future/bb421473
Do note, if you go this way, it will mean you will have to reinstall any other compiled python binary packages (numpy, scipy, etc)
That said, I notice you are downloading a 2.6egg to a 2.7 distro. Off the top of my head, I'm not certain that 2.6 and 2.7 were compiled using the same compiler, but I believe they were. In any event, that could be your problem, either the package doesn't support 2.7, or 2.6 doesn't compile with the same compiler as 2.7.