how to install numpy and pandas in python 2.7.9 version using command line.
please help with complete installing process.
I have tried in windows 10 OS , but it's not installed . Showing syntax error.
I have used command in python 2.7.9 as below
pip install numpy / python -m pip install numpy
pip install pandas / python -m pip install pandas
make sure you havent opened python interpreter like so
open command prompt then run the command
also make sure environment variables are set
First I recommend you upgrade Python Package otherwise try to find which NumPy version supports python 2.7.9 then install like this pip install numpy==1.9.2
[https://stackoverflow.com/questions/28947345/which-numpy-library-is-compatible-with-python-2-7-9]
Related
I installed Ubuntu 20.04, and python3 (3.8) is installed by default.
To install python3.9, I executed:
sudo apt install python3.9
Thus, I have two versions of Python at my laptop: 3.8 and 3.9.
I'm trying to launch the simple script:
import numpy
With Python 3.8 it works correctly. But, when I interp my script by Python 3.9 the error occurs:
How to solve this problem?
I've already tried to update numpy using pip, nothing has happened.
pip3 install numpy --upgrade
Likely what is happening here is, because you have 2 versions of python installed, your pip3 command is only installing things for one of the versions, 3.8 in this case.
Specifying the python version you want to run your command with will help solve this issue.
For example,
python3.9 -m pip install numpy
or
python3.8 -m pip install numpy
You can install a package for a specific version of Python with
python3.9 -m pip install numpy
For a more consistent python environment look at python venv or a container.
I am trying to pip install pandas in a virtual environment but I am having an error I really do not understand.
I am guessing it has something to do with the Double requirement given but I really do not know where to go from here.
I met the same error on Python3.4.
And the root cause of this error is that
"pandas 0.21-0.22 no longer supports Python 3.4"
See more about this issue:
https://github.com/pandas-dev/pandas/issues/20775
Problem with installing pandas for Python 3.4
You get the error "Double requirement given: numpy ..."
The reason for this error is that pandas 0.21-0.22 no longer supports Python 3.4, and thus no longer distributes binary wheels for Python 3.4. Therefore, pip tries to install pandas from source, and this is what now started to fail with Pip version 10.
You can check your python version.
$ python --version
Python 3.4.3
Solution: Install python 3.5
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get install python3.5
After you install python 3.5, you can install pandas successfully in a virtual environment(with Python 3.5).
Is this a clean & fresh new venv? If not, one thing to try is making a new venv, then first installing numpy and after that pandas.
BTW: I'd suggest switching to Python 3.
the latest version of pandas have some issue with python3.4, if you have python3.4 you can install 0.20.3 version of pandas
pip3 install pandas==0.20.3
You don't have to install via pip, you can install via your system's repositories see here.
I am new to Python and I have to use Python 3.3.1 version instead of latest one...
pip install numpy
it returns
SyntaxError: invalid syntax
I tried using the way i installed on python 3.6 but seems to be not working here..
I don't know how to install packages like numpy, pandas, scipy, sci-kit learn, matplotlib etc... in the Python 3.3.1, could you please help..?
Do i need to install pip separately... ?
Thanks in advance.
If you are in window try with:-
Open CMD and
python -m pip install numpy
If this is not working try with this
just type it as your python programe and run it
import pip
pip.main(["install","numpy"])
In my windows 10 machine, the pip.exe is in C:\Python36\Scripts folder. So I install required packages by either using command C:\Python36\Scripts\pip install package_name or first cd C:\Python36\Scripts and then pip install package_name. So far it worked me in different versions of pythons installed.
As suggested by ostue, please make sure that pip is installed with the python distribution.
I have a remote machine with python 2.6 as the default package on the machine. I installed numpy using yum install numpy.
I then installed python 2.7 using the instructions available python 2.7 install link in the directory /usr/src/. I then put this alias
alias python=/usr/src/Python-2.7.8/python
in ~/.bashrc.
So numpy is already installed on the machine but python 2.7 can't pick it up? Should I uninstall it? How do I install it for version 2.7.
The commands would be vary helpful.
Could I pip install to a specific version? I tried this command but it is incorrect.
pip-2.7 install numpy
Thanks
you can do
pythonx.y -m pip install numpy
to install numpy on python version x.y
After an hour search, I have found no answer.
My Mac came with Python 2.7, but I have decided to upgrade to python 3.4.
I installed python 3.4 from python.org.
I can now use python 3.4 from terminal.
Pip still tries to download python 2.7 packages - numpy for 2.7 is "up to date".
When I try to --upgrade a package, for example numpy, I get "no permission" error. With sudo appended, the output is trash.
How can I let pip know that I am interested in packages for python 3.4?
Requirement already up-to-date: numpy in /Library/Python/2.7/site-packages
That's the problem. I want numpy to be up-to-date with Python 3.4.
You should be able to call a specific pip for your install, although it depends on which version you are running:
Starting at version 0.8:
pip-3.4 install numpy
and starting at version 1.5:
pip3.4 install numpy
If you don't have these, you should be able to just download pip and reinstall it, just be sure to call python 3.4 when you run the installer.
I would suggest to install a package manager such as macports brew and install the updated python version from them. After the latest version of python is setup use pip to install the version of numpy
In mac ports , you are able to select the default system python without messing with the path your self.
I would use Homebrew:
brew install python3
This should install Python3.4.1. Then to get pip:
curl -O https://raw.github.com/pypa/pip/master/contrib/get-pip.py
sudo python3 get-pip.py
# Upgrade just in case...
pip3 install -U pip
Then use:
pip3 install numpy
And to run Python, use:
python3
(I only have one Python 3 installation, if you have multiple you'll need to be more specific with the version number)