how to install packages in python 3.3.1 - python

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.

Related

how to install numpy and pandas in python 2.7.9 version

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]

pip doesn't work for me (I have python 3.9.7 installed) (Windows)

So, I have python 3.9.7 installed.
When I installed it, pip had also been installed.
I checked if python is installed (Windows) using "python --version".
The Problem: When I try the same with pip; "pip --version",
an error occurs saying that the program can't be executed (command prompt)
Does anyone know why?
You can try to reinstall pip. This my solve the issue. Use can either install it over command window with 'py -m ensurepip --upgrade' oder download the 'get-pip.py' file (check https://pip.pypa.io/en/stable/installation/).
Try this first
Did you added python to PATH? This is also important. Check https://datatofish.com/add-python-to-windows-path/ to do so
Make sure that the python version is the version of your intent.
Windows python installer sometimes defaults to py for newer python installations.
python --version
Then try to install for example openpyxl package, with admin access, if required
python -m pip install openpyxl
Have you already tried pip3?
pip3 install openpyxl

how to install python3.5 completely and remove python2.7 on Mac?

I have installed python3.5 with commands:
sudo apt-get install python3.5
after
pip install matplotlib
pip install numpy
pip install scikit-learn
It works but only on python2.7.6 installed by default. When I type "python",it show me the interactive shell of python2.7.6. I can use python3.5 by type "python3",but i can't import some library i install such as numpy, scikit-learn, matplotlib but it works in 2.7.6.
How to use all my libraries i install with python3.5 instead of 2.7.6?
pip3 will ensure you're installing packages for python3 if there's confusion with a Python 2.x installed on the same machine.
I figure out the best way to deal with it i think. I download Anaconda from this link (https://www.continuum.io/downloads). Anaconda integrates many academic libraries by default so I choose to download anaconda with the Python 3 version and all libraries going with. So now I can use it in PyCharm.
So creating a new project, I just have to choose the rep of python in my anaconda folder.
Thanks guys.

How can I install NumPy on Windows using 'pip install'?

I want to install NumPy using the pip install numpy command, but I get the following error:
RuntimeError: Broken toolchain: cannot link a simple C program
I'm using Windows 7 32 bit, Python 2.7.9, pip 6.1.1 and some MSVC compiler. I think it uses the compiler from Visual C++ 2010 Express, but actually I'm not sure which one, because I have several Visual Studio installations.
I know that there are prebuilt packages for Windows, but is there some way to do it just by typing pip install numpy?
I think that there could be other packages which must be compiled before usage, so it's not only about NumPy. I want to solve the problem with my compiler, so I could easily install any other similar package without necessity to search for prebuilt packages (and hope that there are some at all).
Check the installation of Python 2.7, and then install/reinstall pip which is described here. Then a open command line windows and write:
pip install numpy
Or
pip install scipy
If already installed, try this:
pip install -U numpy
Installing extension modules can be an issue with pip. This is why Conda exists. Conda is an open-source BSD-licensed cross-platform package manager. It can easily install NumPy.
Two options:
Install Anaconda here
Install Miniconda here and then go to a command line and type conda install numpy (make sure your PATH includes the location Conda was installed to).
Frustratingly, the NumPy package published to PyPI won't install on most Windows computers: Windows wheel package (.whl) on Pypi #5479
Instead:
Download the NumPy wheel for your Python version from Archived: Unofficial Windows Binaries for Python Extension Packages, NumPy
Install it from the command line:
pip install numpy-1.10.2+mkl-cp35-none-win_amd64.whl
As of March 2016, pip install numpy works on Windows without a Fortran compiler. See here.
pip install scipy still tries to use a compiler.
July 2018: mojoken reports pip install scipy working on Windows without a Fortran compiler.
py -m pip install numpy
Worked for me!
Install miniconda (here)
After installed, open Anaconda Prompt (search this in Start Menu)
Write:
pip install numpy
After installed, test:
import numpy as np
First go through page Download Python to download Python 3.6.1 or 2.7.13 either of your choice. I preferred to use Python 2.7 or 3.4.4.
Now after installation, go to the folder name python27 or python34, and click on the script. Now here open the command prompt by left clicking and Run as administrator.
After the command prompt appears, write "pip install numpy" there. This will install the latest version of NumPy and installing it will show a success comment. That's all.
Similarly, Matplotlib can be installed by just typing "pip install matplotlip". And now if you want to download SciPy, then just write "pip install scipy" and if it doesn't work then you need to download Python SciPy from SciPy: Scientific Library for Python and install it.
I had the same problem.
I decided in a very unexpected way. I just opened the command line as an administrator. And then typed:
pip install numpy

Installing Numpy on 64bit Windows 8.1 with Python 2.7

I am trying to install Numpy on Python 2.7 and I am using Windows 8.1. When I run Numpy from this link it says, "Python 2.7 required, which was not found in the registry ". How can resolve this issue, I already installed Python 2.7?
For Windows, you should check out Chris Gohlke's page:
http://www.lfd.uci.edu/~gohlke/pythonlibs
He has some Numpy builds there for Python 2.7.
You can first install wheel using pip.
pip install wheel
Then download the .whl file for Numpy from Chris Gohlke's page.
Then go to the directory where you downloaded the package.whl file in cmd and do the following
pip install package_you_downloaded.whl
I experienced a similar broken toolchain error while installing Numpy. You can check it here.
I changed to anaconda a while ago and in my mind its the best and most dynamic package manager for all platforms.
http://docs.continuum.io/anaconda/install.html
correct command after installing pip is:
python -m pip install numpy
You should use pip to install Numpy and any other librarys
check this for how to install pip
after installing, go to your command line and enter
pip install numpy

Categories