Error installing package with pip - python

I'm trying to install a charting tool (matplotlib-v1.4.2) for python 3.4 in Windows 7, so far all my trails doesn't seem to do the job.
Attempts:
I've downloaded pip from GitHub
python -m pip install matplotlib on Command Prompt[DOS] - No Use
There's a similar question posted here, tried these suggestions too but I get the following error
'$' is not reconginized as an internal or external command.
I'm sure I'm missing something, your step by step guidance on this regard would be much appreciated.

The $ refers to the beginning of a shell prompt, you shouldn't actually include it in your command :)
So rather than (from the example question you posted)
$ pip install requests
you actually type
pip install requests
In any case, you can download matplotlib .exe files from here for use in Windows. Make sure you get the correct bitness (32bit vs 64bit) and the correct Python version.

$ in the example signifies the linux prompt, which in windows is usually >
You can install the library by either using pip install, or using this link http://matplotlib.org/downloads.html
Additionally, most python packages for windows can be easily installed by using the installers from this site http://www.lfd.uci.edu/~gohlke/pythonlibs/

Related

What is the difference between installing a package in my Windows CMD and in VS Code terminal?

I am doing this project where i need to install a package called Twint.
I want to install this package and use it's commands in my VS Code.
What happends when i for example type this in my Windows CMD?
pip3 install --user --upgrade git+https://github.com/twintproject/twint.git#origin/master#egg=twint
Because i can't type this in my VS code terminal, where i usually install packages with pip.
It will return an error that says ERROR: Cannot find command 'git' - do you have 'git' installed and in your PATH?''
Now if i run this in my Windows Command it seems that i can't directly import the package in VS code?
Can anyone help me out with this confusion, where does the files get stored and how do i create good habbits around installing packages?
Hope someone understands what im struggeling with here.
Best
It is often the case that computers have more than one version of python installed and that editors like VS code use a different version than pip uses on the command line. pip installs packages where the version of python it is linked to expects them to be, but VScode doesn't know to look there.
It sounds like you have git installed where pip installs things, so you can upgrade from the command line without issue, but there's no installation of git where VScode is looking, so there's nothing to upgrade.
You either need to find where pip installs things and add it to the $PATH VScode uses, or try running a variation of python -m pip install --user git (specifying a specific url, or other things, as needed) from within VScode, which will ensure the package gets installed in a place that VScode looks for packages.
Download and Install git in your windows from here:
https://git-scm.com/download/win
Then add its installation bin path to your windows's environment path. Then you will find the git command at the command prompt globally.
This may solve you problem.

Install module in python locally

I have a very basic question. I want to install a new module on my computer in order to use it in Python (via Spyder). When I install the package via pip everything seems to work fine. When I want to import the package in my script it says that there is no module by that name (see scrennshot below)
Any suggestions what might be the problem?
Thanks a lot :)
screenshot of this problem
You're using pip3 to install.
Try installing using pip install nibabel.
Failing that, I would refer you to the following question:
Which pip is with which python?
This is a common pitfall of using different versions of Python and pip.
I think
/Applications/Spyder.app/Contents/MacOS/python -m pip install nibabel
or
/Applications/Spyder.app/Contents/MacOS/python -m pip3 install nibabel
will solve your problem
Thanks for asking the question.
Have tried conda install
Since we are in anaconda dev env.
If you are using windows
Windows: Click Start, search, or select Anaconda Prompt from the menu
and use that terminal
please find the reference
https://docs.anaconda.com/anaconda/install/verify-install/

getting python pyobcd installed

I'm a little lost on how to get pyodbc installed in my computer.
I have python 3.6.1
The link
http://support.esri.com/en/technical-article/000011656
pointed me to another link
https://github.com/mkleehammer/pyodbc
Which is vague.
I'm used to downloading and running an exe for install.
This link is unclear and says all I have to do is:
"pip install pyodbc"
What exactly do I need to do to get this working?
Since you have not mentioned which OS you are using,
I will assume that you are on windows (as you have mentioned that you are used to install using .exe).
Firstly you need to know what a pip is:
pip is basically a package manager for python packages used to install 3 rd party packages which do not bundle along with the python distribution.
On linux pip comes pre installed also if you are using python version 3.4 onwards or python 2.7.9 you will be having pip pre installed on your system.
All you have to do it to open the command prompt issue the command
pip install package-name(pyobdc here)
it will do the job.
If you do not find pip in your distribution you can refer this link
How do I install pip on Windows?
open cmd in your computer and type
pip install pyobdc
Hello there and welcome to python programming. Basically python comes with its package installer so either you can go to any interpreter that you are using and type pip install pyobdc or use the command prompt in windows and type in pip install pyobdc. This would install your module and just remember to put import pyobdc at the top of the code if you want to use this package. Further information can be found on here

How to install pip in a new python installation

I recently installed python 2.7.2 on my Mac running OSX 10.6.8. Previously, I had version 2.6. I set my path in .bash_profile as follows:
export PATH=/usr/local/bin:$PATH
export PATH=/usr/local/share/python:$PATH
so that when I run python it will refer to my new installation. It does.
I would also like to use pip with my new installation, but the problem is that I already have the current version of pip installed at
/usr/local/bin/pip.
I tried to re-install pip with:
easy_install pip
But, of course this does not put pip in the desired new directory
/usr/local/share/python/pip
but simply refers to the existing version in /usr/local/bin/pip.
Can someone tell me how to fix this?
I would like to then use pip to install NumPy and SciPy in the correct directory (I was having trouble getting the SciPy installation to work with my old version of python, hence the new install).
If you'd like, you can visit the website where I found instructions for installing python 2.7, creating/updating my .bash_profile, installing pip, and NumPy and SciPy. Might provide some insight, or I'm happy to give more details if needed. Thanks!
http://www.thisisthegreenroom.com/2011/installing-python-numpy-scipy-matplotlib-and-ipython-on-lion/#python
Install distribute as per the instructions at http://pypi.python.org/pypi/distribute .
Make sure you specify the full path to the python executable (/usr/local/share/python/python or smth in your case).
$ curl -O https://svn.apache.org/repos/asf/oodt/tools/oodtsite.publisher/trunk/distribute_setup.py
$ /usr/local/share/python/python distribute_setup.py
Then you should have /usr/local/share/python/easy_install.
After that, run:
$ /usr/local/share/python/easy_install pip
Then you should have /usr/local/share/python/pip.
Depending on the ordering of things in your PATH, either your old, or the newly installed pip is executed when you execute the pip command, so you either might have to adapt your PATH, or specify the full path to /usr/local/share/python/pip when installing eggs.
(shameless plug:
In any case, you might consider using virtualenv for installing packages into a "project" specific isolated environment, as opposed to installing them globally.)
I needed to uninstall brew's python.
Then, I was left with python v2.7.6
Next to install, pip I ran
sudo easy_install pip
installed fine and working
I had a similar issue, try this:
$ python -m pip install --upgrade --force-reinstall pip
This will force reinstall pip with whatever version of python you use including installing the binary.
A few days ago I had a friend who was starting Python Programming and needed help with the same issue: installing pip. There are debates over which one to choose between easy_install and pip and it seems everybody is heading the pip direction. Either way, installing either of them can be frustrating.
You can use this simple tutorial : installing pip package manager the easy way
Here are what you should keep in mind as you follow the above guide:
If you already have an older version installed, uninstall it or totally remove the python installation
Once that is cleared, download an install Python.
After that, download ez_setup.py file and save it to your desktop - easily accessible from the command line
Now run it from the command line and it will install easy_install for you after which,
You can use it to install pip.
Once again, you can do this or use the above link to find a simple step-by-step guide on how to get it installed on your computer.
Good luck.
Just so that people knew, ATM we can install PIP by downloading get-pip.py from the page with docs and run it like this:
c:\python27\python.exe get-pip.py
BTW, Python 3.4 comes with PIP pre-installed.
One of the command line options lets you choose where to install to.
--install-dir (-d) install package to DIR
So something like - # easy_install pip -d /usr/local/share/python
(Please correct me if I'm wrong.)
Just wanted to say that I found a way to get around my problem. I don't know that I can explain it perfectly, since I am not very good at understanding what I am doing with this stuff just yet! But, the problem seems to have been with my PATH. I removed the PATH that I posted in my original question, and then used easy_install pip. It went straight to python 2.7.2 (my new version) with no problem. I then successfully used pip to install NumPy and SciPy in the correct location, and they both work. Thanks to ErikAllik and FakeRainBrigand for taking the time to look into it!

how to install matplotlib in python 3 with os windows

from this site
http://matplotlib.sourceforge.net/users/installing.html#installing-from-source
tell us that the requirement is python 2.4 or later but not python3.
Now im working with python3 and i need some plot form matplotlib.
So how to solve it?
I'm sorry, but at the current time it's not supported.
If you feel brave, you can try with the Py3k SVN branch which reportedly works with a simple example. Be aware that there has been no update in the last 8 months on this though.
Of course, you'd be more than welcome to contribute to the porting to Python 3 if you could.
You could try the unofficial versions. Check this site:
http://www.lfd.uci.edu/~gohlke/pythonlibs/
Looking at the docs at the link it says the following is a dependency:
Python (>= 2.7 or >= 3.4)
You can download a version of Python that will work at:
https://www.python.org/downloads/windows/
I would go with the most recent release and a 64 bit version as certain libraries for data analysis do not run on the 32 bit version of Python.
The version of Python you download will come with pip which you can then use to install any libraries you need to do your work.
Make sure you have set your environment variables if you want to run your programs from the command line or bash terminal.
I installed matplotlib through the bash terminal with:
pip install matplotlib
Let me know if that helps.
To install matplotlib on windows, first, you have to install pip first to install pip on windows go to website
https://pip.pypa.io/en/stable/installing/#do-i-need-to-install-pip
Download get-pip.py, being careful to save it as a .py file rather than .txt. Then, run it from the command prompt:
python get-pip.py
if pip is already installed, install matplotlib by writing in command prompt:
python -mpip install -U pip
python -mpip install -U matplotlib

Categories