I am trying to install Pandas for Python 3.4 for a Django project, however I get the error Unable to find vcvarsall.bat.
How can I install Pandas on Python 3.4 in Windows?
The easiest way to install Pandas, like almost every other package for Python, is with pip.
Many packages (including Pandas) require a compiler, and a bunch of third-party DLLs, and many Windows users don't know how to deal with that. That's exactly why the "wheel" format was created: so packages can upload pre-built binaries.
Not every project has pre-built binary wheels for Windows yet. But you can look at Christoph Gohlke's site and find wheels for all of the most popular ones. Just follow the instructions on that page to download the wheel file and install it with pip.
But in the case of Pandas, you don't have to do that. They have wheels on their download page, and uploaded to PyPI. And the documentation tells you to use these. (Well, it first suggests you use Anaconda/Miniconda, but if you want a stock Python, use pip and the packages on PyPI.)
Be aware that different versions of Python will need different version of Visual C++. I use Python 3.4 and it worked with Visual C++ 10. Most of what I read recommended version 8, which probably works with 2.7, but didn't work with 3.4
A very simple way of doing it would be to use pip, as suggested by abernert.
The command to be entered is :
pip install pandas
You will find pip in the scripts folder in your python folder. (eg. c:\python34\Scripts).
numpy will also be installed during this process.
I know this is late, but I'll just leave this here, since it is very similar.
Related
I just got a new computer, and I was installing some Python libraries. When I tried to install numpy, I got a message on the console saying numpy was already downloaded. I went into the library folder, and not only was numpy there, but scipy, matplotlib, and a bunch of other libraries as well. How is this possible, considering this computer is brand new? I had installed Python the previous evening, so does installing Python automatically install these libraries as well?
It depends on which Python package you install.
On any desktop oriented Linux distribution, installing the Python package will only install Python. And in practice, it is generally already installed.
On Windows (and perhaps OS X), you need to pick a Python bundle somewhere. Perhaps did you choose Anaconda, which AFAIK installs a lot of common Python libraries (as opposed to its light version Miniconda).
Python does not ship with these libraries unless you are using a pre-packaged distribution such as Anaconda.
If you copied your data from your previous computer to this one, you may have copied the python installation (and thereby the libraries you had installed before) in your appdata folder.
Another possibility is that you have install Anaconda, which is targeted especially at scientific things, and comes with numpy, scipy and some other things preinstalled.
Although this is not the place for these types of questions, yes, there is no need to install libraries, as most of the times when you download Python in a distribution, such as Anaconda, they are also included.
I have a windows 7 machine with python 2.7 and I am trying to install pyzmq following these steps. I built libzmq got the binaries and copied them from libzmq\bin\Win32\Debug\v140\dynamic\ to libzmq\lib\ so the next step will work(compiler will have access to /lib and /includes from the same parent folder). But, on this step:
$ python setup.py configure --zmq=../libzmq
I installed pyzmq and libzmq on the same parent folder, as in the installation description related to pyzmq, libzmq is here: ../libzmq
But when I need to configure the pyzmq, I get this error:
I have VS Community 2015 installed and everything seems fine.
ZMQ usually provides sln files that will build from Microsoft Visual Studio. You will have to dig around a little to find it. You are better off trying to get that to work then going directly from the python setup.py that you are currently attempting. Note that you also need libsodium to be built and installed. Thankfully, they also provide Microsoft sln files.
In any case, you are probably better using one of the Python wheels like those from Christoph http://www.lfd.uci.edu/~gohlke/pythonlibs/
Just do
pip install <wheel file>
and you should be good.
Good luck!
I am trying to install numpy for python 2.7, I've downloaded the zip, unzipped it and was expecting a Windows download file (.exe), but there isn't one.
Which of these files do I use to install it?
I tried running the setup.py file but don't seem to be getting anywhere.
Thanks!!!
There is .exe file in SourceForge. This is this link below:
http://sourceforge.net/projects/numpy/files/NumPy/1.9.1/numpy-1.9.1-win32-superpack-python2.7.exe/download
Python on Windows, including rather complex science/math/statistics package builds? It should just work? Seriously, use a third-party distribution! There are plenty and they only exist as of the hassle you were observing.
While the other two answers are "okay", it would recommend another approach. Especially for the common Windows user the following approach is easy to maintain and easy to reproduce.
Let me quote from the SciPy website:
For most users, especially on Windows and Mac, the easiest way to
install the packages of the SciPy stack is to download one of these
Python distributions, which includes all the key packages:
[a list of Python distributions]
As you can see, people having experience with this topic tend to recommend using a third-party Python distribution.
I have so far used ActivePython, but Anaconda also appears to be a well-maintained project.
Whichever you take: it comes as a nice Windows installer and will give you a seamless Python experience.
You can find a very well maintained list of Python Libraries (including numpy) for Windows at this Homepage: http://www.lfd.uci.edu/~gohlke/pythonlibs/
Wasted a lot of time trying to install on Windows from various binaries and installers, which all seemed to install a broken version, until I found that this worked: navigate to the python install directory and do python .\site-packages\pip install numpy
What are the relative merits of installing python packages on windows using pip as opposed to using packaged installers (exe/msi)?
For starters, some just wouldn't work for me (MySQLdb being the major culprit).
My new rule:
Try pip or easy_install
If that doesn't work, browse this library of python .msi/.exe installers for Windows.
If neither works for you, post a question on StackOverflow. You really have no benefit weighing the merits of one or the other; just get what you need in the manner that provides the least friction, and move on to more interesting things.
Native installers are used mainly when a package contains C extensions that need to be compiled. As you have to use the same compiler used to build Python itself and configure environment properly it's not something that many users see themselves doing. To avoid these problems they instead choose native installer. However, installing by running exe/msi installer directly doesn't allow to choose which Python instance to install a package in so you can't install in virtualenv. This seems like a major drawback of using native installers but only because many people are not aware of the fact that it is possible to use native installer to install in virtualenv - see Can I install Python windows packages into virtualenvs? (Unfortunately in this case you can't use pip as it doesn't handle installing binary packages).
To summarize:
If a package has no C extensions use pip
If a package has C extensions and
you can find native installer or binary egg use easy_install with native installer/binary egg
you can't find native installer nor binary egg use pip to compile C extensions and install package
I recently began learning Python, and I am a bit confused about how packages are distributed and installed.
I understand that the official way of installing packages is distutils: you download the source tarball, unpack it, and run: python setup.py install, then the module will automagically install itself
I also know about setuptools which comes with easy_install helper script. It uses eggs for distribution, and from what I understand, is built on top of distutils and does the same thing as above, plus it takes care of any dependencies required, all fetched from PyPi
Then there is also pip, which I'm still not sure how it differ from the others.
Finally, as I am on a windows machine, a lot of packages also offers binary builds through a windows installer, especially the ones that requires compiling C/Fortran code, which otherwise would be a nightmare to manually compile on windows (assumes you have MSVC or MinGW/Cygwin dev environment with all necessary libraries setup.. nonetheless try to build numpy or scipy yourself and you will understand!)
So can someone help me make sense of all this, and explain the differences, pros/cons of each method. I'd like to know how each keeps track of packages (Windows Registry, config files, ..). In particular, how would you manage all your third-party libraries (be able to list installed packages, disable/uninstall, etc..)
I use pip, and not on Windows, so I can't provide comparison with the Windows-installer option, just some information about pip:
Pip is built on top of setuptools, and requires it to be installed.
Pip is a replacement (improvement) for setuptools' easy_install. It does everything easy_install does, plus a lot more (make sure all desired distributions can be downloaded before actually installing any of them to avoid broken installs, list installed distributions and versions, uninstall, search PyPI, install from a requirements file listing multiple distributions and versions...).
Pip currently does not support installing any form of precompiled or binary distributions, so any distributions with extensions requiring compilation can only be installed if you have the appropriate compiler available. Supporting installation from Windows binary installers is on the roadmap, but it's not clear when it will happen.
Until recently, pip's Windows support was flaky and untested. Thanks to a lot of work from Dave Abrahams, pip trunk now passes all its tests on Windows (and there's a continuous integration server helping us ensure it stays that way), but a release has not yet been made including that work. So more reliable Windows support should be coming with the next release.
All the standard Python package installation mechanisms store all metadata about installed distributions in a file or files next to the actual installed package(s). Distutils uses a distribution_name-X.X-pyX.X.egg-info file, pip uses a similarly-named directory with multiple metadata files in it. Easy_install puts all the installed Python code for a distribution inside its own zipfile or directory, and places an EGG-INFO directory inside that directory with metadata in it. If you import a Python package from the interactive prompt, check the value of package.__file__; you should find the metadata for that package's distribution nearby.
Info about installed distributions is only stored in any kind of global registry by OS-specific packaging tools such as Windows installers, Apt, or RPM. The standard Python packaging tools don't modify or pay attention to these listings.
Pip (or, in my opinion, any Python packaging tool) is best used with virtualenv, which allows you to create isolated per-project Python mini-environments into which you can install packages without affecting your overall system. Every new virtualenv automatically comes with pip installed in it.
A couple other projects you may want to be aware of as well (yes, there's more!):
distribute is a fork of setuptools which has some additional bugfixes and features.
distutils2 is intended to be the "next generation" of Python packaging. It is (hopefully) adopting the best features of distutils/setuptools/distribute/pip. It is being developed independently and is not ready for use yet, but eventually should replace distutils in the Python standard library and become the de facto Python packaging solution.
Hope all that helped clarify something! Good luck.
I use windows and python. It is somewhat frustrating, because pip doesn't always work to install things. Python is moving to pip, so I still use it. Pip is nice, because you can uninstall items and use
pip freeze > requirements.txt
pip install -r requirements.txt
Another reason I like pip is for virtual environments like venv with python 3.4. I have found venv a lot easier to use on windows than virtualenv.
If you cannot install a package you have to find the binary for it. http://www.lfd.uci.edu/~gohlke/pythonlibs/
I have found these binaries to be very useful.
Pip is trying to make something called a wheel for binary installations.
pip install wheel
wheel convert path\to\binary.exe
pip install converted_wheel.whl
You will also have to do this for any required libraries that do not install and are required for that package.