install imageio Python 2.7.14 - python-2.7

I am trying to install the imageio module using pip:
pip install imageio
as this is what https://media.readthedocs.org/pdf/imageio/latest/imageio.pdf recommends.
However, I am getting an error every time saying that install is invalid syntax. I am wondering what is the valid syntax to import this module through PIP, or if possible a download link for imageio that will just allow me to use the command
import imageio
that is common syntax for importing new modules into python

Try to locate pip.exe at path c:\python27\Scripts\ path
open terminal at that path and the execute pip install imageio it should work now.
how to install package can help you understand how we install python packages.

Related

Install Tkinter in virtualenv on Linux without Sudo access

I am using a virtualenv on a Linux machine. I don' have sudo access so I can use pip only.
I tried:
pip install python-tk
But this resulted in this error message
Collecting python-tk
Could not find a version that satisfies the requirement python-tk (from versions: )
No matching distribution found for python-tk
How can I install Tkinter in virtualenv on Linux?
You can't install tkinter using pip because tkinter is an interface to a C++ library called Tk, whereas pip is coded with Python.
Luckily you do not have to worry about the above statement because tkinter comes as a built-in library for the standard Python distribution.
So what you have to do is:
Go to your virtualenv directory: cd to_your_virtualenv_directory
Activate it: source bin/activate
Access your python shell within it: python
Then import tkinter as tk
Note:
Depending on your settings, maybe when you type python you will notice you are prompted to work with Python 2.x instead. In that case, just type this: import Tkinter as Tk. If, however, typing python leads you to use Python 3.x (as I set it on my machine), but you prefer to work with Python 2.x then simply type python2 instead of python.

How to install difflib module in python 2.7 windows 10

Currently, I am facing difficulty installing difflib module in python 2.7 version in windows 10 system.
I want it to perform some text analytics analysis
tried using
apt-get install npm
npm install difflib
and
pip.exe install difflib
Solution for me was to save the difflib.py in the location where your .py file resides and then import it in your file.
install using pip should be a great idea, You can refer to the module related details here:
https://docs.python.org/2.7/library/difflib.html
If you face an issue installing it using pip, then the next way is to get the difflib.py from any working machine and keep it in the project directory itself, so that just importing the module itself will work.
This is the codebase reference from svn of python itself:
https://svn.python.org/projects/python/trunk/Lib/difflib.py

Kivy cannot find PIL module in Mac

OSX 10.10.2, Python 2.7.9, Kivy 1.9
I used sudo pip install Pillow to install Pillow when i get the not found error. I can find PIL in python help('modules') but not in kivy help('modules')
I tried Kivy user group but got no reply yet. Thank you in advance!
Kivy 1.9 package uses it's own Virtual Environment. You have to make sure to install modules into that. Simply do::
kivy -m pip install pillow
Probably kivy is looking for the Pillow package in the wrong place.
You should check where your library is installed and use that path.
The path should be something like "/Library/Python/2.7/site-packages/", look if you have the PIL package in that position.
Then set the PYTHONPATH variable or use
import sys
sys.path.append('path_to_the_PILLOW_package')
and look if "import PIL" raises an ImportError.

Error installing Tweepy for Python (Mac)

I'm working with Python 2.6.6 and have been trying to download tweepy, but whenever I import tweepy in the Python IDLE shell it comes back with a "No module named tweepy" error.
I've downloaded tweepy using
sudo pip install tweepy
And it goes right into /Library/Python/2.7/site-packages with no problems.
Then I cd from that path into tweepy and
python setup.py install
but this error message comes up
/Library/Frameworks/Python.framework/Versions/2.6/Resources/Python.app/Contents/MacOS/Python: can't open file 'python': [Errno 2] No such file or directory
I've gone through the path and everything is correct with Python at the end.
However, when I open up a Python IDLE shell and
import tweepy
the "No module named tweepy" error comes up.
I'd really appreciate any help!
pip is using Python 2.7, as you can tell from the site-packages path, while you are apparently trying to install for use with 2.6. Leaving aside the question of why you're using 2.6, the problem is easy enough to fix - install pip with Python 2.6.
Download get-pip.py, then (assuming your python command points to version 2.6) run:
sudo python get-pip.py
Once it's installed, you should be able to run
sudo pip2.6 install tweepy
and everything should work properly.

How can I tell whether/where python a virtualenv has been set up? (aka installing lxml on bitnami's djangostack)

I'm working on a django application on the bitnami djangostack. I want to use the lxml library, but I haven't been able to install it. Or rather, I haven't been able to install it where django can find it.
I've already used apt-get to install the libxml2, libxslt, and python-dev dependencies. Both of these commands report success*:
sudo pip install lxml
sudo apt-get install python-lxml
easy_install fails with a super-long error message that makes me think it can't find the dependencies. (I've run into this problem before.)
When I open up python or call python manage.py shell and try "import lxml", I get
"ImportError: No module named lxml"
As best I can tell, bitnami has set up a virtual environment for django, and pip and aptitude are installing lxml perfectly -- to the wrong python. Assuming that's all correct, how do I get lxml installed to the right one?
When you use apt-get install you are installing system libraries. BitNami DjangoStack is self-contained and independent. You could upgrade or remove your system libraries with apt-get and it would not be affected. Unfortunately lxml is not included in the stack nor libxslt which is a depency. We will include it in a future version however please find below the steps for manualing installing lxml on top of the python version included in BitNami DjangoStack.
You will need to use the system libraries for libxslt and libxml2. Be sure that you have them installed:
sudo apt-get install libxml2 libxml2-dev libxslt1.1 libxslt1-dev
Download lxml and uncompress it:
wget http://lxml.de/files/lxml-2.3.2.tgz
tar zxvf lxml-2.3.2.tgz
cd lxml-2.3.3
Load the BitNami environment:
. path_to_your_djangostack_installation/scripts/setenv.sh <-- notice the space between the dot and the path to the script.
which python <-- the output should be the python version from BitNami.
Install lxml specifying the path to your system libraries (notice that you should execute this command in the lxml directory):
python setup.py install --with-xslt-config=/usr/bin/xslt-config --with-xml2-config=/usr/bin/xml2-config
Now executing import lxml in the python console should work.
(This was already replied here)
There have been a couple of blog postings on installing this library on shared hosting. http://rhodesmill.org/brandon/2009/installing-lxml-on-webfaction/
How to install lxml for python without administative rights on linux?