iFindStuff - installing necessary modules requests and six

Posted on
Tue Aug 18, 2015 5:59 am
Chameleon offline
Posts: 611
Joined: Oct 04, 2014

iFindStuff - installing necessary modules requests and six

Preparing python 2.6 for iFindStuff

People who've had problems getting started with iFindStuff in the Alpha phase have one thing in common. They haven't got two well known python libraries installed that iFindStuff uses to manage web and compatibility features. So in order to use the Plugin you have to have these packages installed in python 2.6.

iFindStuff uses two external libraries which are present in python 2.7 but not in python 2.6. Because of this and the fact that indigo uses python 2.6 you may have to install these into the right place for iFindStuff to work. The following gives you step by step instructions for doing this. You must do this BEFORE you run iFindStuff


    requests.py manages the http:// communications on the web

    six.py provides compatibility functionality for iFindStuff and saves a lot of additional coding

In order to use iFindStuff the easiest option is to install these libraries as part of python 2.6 for use with indigo. Not many people are that happy using the Apple Terminal programme to complete installs but the process is fairly simple and will work almost without any intervention.

To install the request and six under the python 2.6 version we need to tell Terminal exactly where we want the package installed otherwise it will install requests and six under python 2.7 which is the default python version for most Mac systems.

Easy install is a standard programme on MAC OS that we can use to install python libraries. As of version 0.6a11, Easy_Install installs itself under two names: easy_install and easy_install-N.N, where N.N is the Python version used to install it. Thus, if you install EasyInstall for both Python 2.6 and 2.7, you can use the easy_install-2.6 or easy_install-2.7 scripts to install packages for Python 2.6 or 2.7, respectively.

So to prepare your system for iFindStuff you need to do the following:

    Open a Terminal window by clicking on Terminal in the /Applications/Utilities directory

When the $ prompt appears you can start installing the packages you need with the following commands:

    Type sudo easy_install-2.6 pip followed by return

When you enter this command you may be prompted for your system password. Type in your password and press return

Now you can install the packages in the following manner:

    Type sudo easy_install-2.6 pip requests followed by return

    Type sudo easy_install-2.6 pip six followed by return

Entering your password if prompted

You can test if your installation has worked properly by doing the following:

    Type python2.6 following by return at the $ prompt

    You will be presented with the python login prompt >>>

    Now type import requests and the system should simply return with the >>> prompt again and no errors

    Now type import six and the system should return with the >>> prompt for the final time

If you get an error saying that the package requests or six doesn’t exist then something hasn’t worked properly. Send me a screen grab of the error and I’ll try to help you sort it out.

Once you’ve done that you’re ready to start installing and running iFindStuff.

Have fun

Mike

Posted on
Tue Dec 01, 2015 10:18 am
rlust offline
Posts: 90
Joined: Jan 12, 2009
Location: Ohio

Re: iFindStuff - installing necessary modules requests and s

I have filled your procedure and have error trying to import requests and six

Here are my errors

import requests
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named requests
>>> import six
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named six

Here is the install string

iMacOffice:~ rc$ sudo easy_install-2.6 pip requests
Searching for pip
Best match: pip 7.1.2
Processing pip-7.1.2-py2.6.egg
pip 7.1.2 is already the active version in easy-install.pth
Installing pip script to /usr/local/bin
Installing pip2.6 script to /usr/local/bin
Installing pip2 script to /usr/local/bin

Using /Library/Python/2.6/site-packages/pip-7.1.2-py2.6.egg
Processing dependencies for pip
Finished processing dependencies for pip
Processing requests
Running setup.py -q bdist_egg --dist-dir /Users/rc/requests/egg-dist-tmp-l_7TXi
requests 2.7.0 is already the active version in easy-install.pth

Installed /Library/Python/2.6/site-packages/requests-2.7.0-py2.6.egg
Processing dependencies for requests==2.7.0
Finished processing dependencies for requests==2.7.0
iMacOffice:~ rc$ sudo easy_install-2.6 pip
Searching for pip
Best match: pip 7.1.2
Processing pip-7.1.2-py2.6.egg
pip 7.1.2 is already the active version in easy-install.pth
Installing pip script to /usr/local/bin
Installing pip2.6 script to /usr/local/bin
Installing pip2 script to /usr/local/bin

Using /Library/Python/2.6/site-packages/pip-7.1.2-py2.6.egg
Processing dependencies for pip
Finished processing dependencies for pip
iMacOffice:~ rc$ sudo easy_install-2.6 pip requests
Searching for pip
Best match: pip 7.1.2
Processing pip-7.1.2-py2.6.egg
pip 7.1.2 is already the active version in easy-install.pth
Installing pip script to /usr/local/bin
Installing pip2.6 script to /usr/local/bin
Installing pip2 script to /usr/local/bin

Using /Library/Python/2.6/site-packages/pip-7.1.2-py2.6.egg
Processing dependencies for pip
Finished processing dependencies for pip
Processing requests
Running setup.py -q bdist_egg --dist-dir /Users/rc/requests/egg-dist-tmp-X3lShL
requests 2.7.0 is already the active version in easy-install.pth

Installed /Library/Python/2.6/site-packages/requests-2.7.0-py2.6.egg
Processing dependencies for requests==2.7.0
Finished processing dependencies for requests==2.7.0
iMacOffice:~ rc$ sudo easy_install-2.6 pip six
Searching for pip
Best match: pip 7.1.2
Processing pip-7.1.2-py2.6.egg
pip 7.1.2 is already the active version in easy-install.pth
Installing pip script to /usr/local/bin
Installing pip2.6 script to /usr/local/bin
Installing pip2 script to /usr/local/bin

Using /Library/Python/2.6/site-packages/pip-7.1.2-py2.6.egg
Processing dependencies for pip
Finished processing dependencies for pip
Searching for six
Best match: six 1.10.0
Processing six-1.10.0-py2.6.egg
six 1.10.0 is already the active version in easy-install.pth

Using /Library/Python/2.6/site-packages/six-1.10.0-py2.6.egg
Processing dependencies for six
Finished processing dependencies for six
iMacOffice:~ rc$ python2.6
Python 2.6.9 (unknown, May 7 2014, 20:19:17)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import requests
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named requests
>>>
Thanks!!

Posted on
Tue Dec 01, 2015 10:45 am
Chameleon offline
Posts: 611
Joined: Oct 04, 2014

Re: iFindStuff - installing necessary modules requests and s

Hi

I know it's annoying the way that python works on a Mac. I think that you've switched around the install and pip commands accidentally but as you already have pip2.6 installed (that's the hard bit!) I suggest that you try this in your terminal window.

Code: Select all
MacMini$>sudo pip2.6 install requests
Password [enter your admin password and type return]

This should install requests in the correct python instance for indigo which is python 2.6. The pip2.6 (no spaces) is important because that's what determines which version of python is upgraded.

You can repeat exactly the same for six.

Now you can check if it's worked!

First run the right install for python and try to import the modules using the python2.6 (no spaces again) command

Code: Select all
MacMini$>python2.6
Python 2.6.9 (unknown, Sep  9 2014, 15:05:12)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import requests
>>>
>>> import six
>>>

No errors means success.

Let me know if this doesn't work and I'll think again. There have been one or two problems with user installs but we've resolved them in the end. Once these are installed the plugin should work just fine. I'm told that once this is done most users find the actual plugin easy to use :D

Regards

Mike

Posted on
Tue Dec 01, 2015 4:10 pm
rlust offline
Posts: 90
Joined: Jan 12, 2009
Location: Ohio

Re: iFindStuff - installing necessary modules requests and s

Well I tried your idea:
Here is the results of the pip2.6 install request

Requirement already satisfied (use --upgrade to upgrade): requests in /Library/Python/2.6/site-packages/requests-2.7.0-py2.6.egg

iMacOffice:~ rc$ pip2.6 install six
Requirement already satisfied (use --upgrade to upgrade): six in /Library/Python/2.6/site-packages/six-1.10.0-py2.6.egg

>>> import six
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named six

same for requests

Thanks for your help!!

Posted on
Wed Dec 02, 2015 3:17 am
Chameleon offline
Posts: 611
Joined: Oct 04, 2014

Re: iFindStuff - installing necessary modules requests and s

rlust wrote:
Well I tried your idea:
Here is the results of the pip2.6 install request

Requirement already satisfied (use --upgrade to upgrade): requests in /Library/Python/2.6/site-packages/requests-2.7.0-py2.6.egg

iMacOffice:~ rc$ pip2.6 install six
Requirement already satisfied (use --upgrade to upgrade): six in /Library/Python/2.6/site-packages/six-1.10.0-py2.6.egg

>>> import six
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named six

same for requests

Thanks for your help!!



Very odd - it seems to be ready. Hmmmm. Hate to ask but did you enter: python2.6 to run python before running the import commands? It's important because the Mac defaults to 2.7. One way to find out is to give iFindStuff a go and see if it works.

Let me think about ways of checking your system to make sure it's all installed.

Regards

Mike

Posted on
Fri Jan 29, 2016 4:32 am
lindehoff offline
Posts: 79
Joined: Aug 08, 2015

Re: iFindStuff - installing necessary modules requests and s

Hi
I have the sam problem:
Code: Select all
sudo pip2.6 install requests
The directory '/Users/jacob/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/jacob/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied (use --upgrade to upgrade): requests in /Library/Python/2.6/site-packages/requests-2.9.1-py2.6.egg
/Library/Python/2.6/site-packages/pip-7.1.2-py2.6.egg/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
You are using pip version 7.1.2, however version 8.0.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.


Python2.6
Code: Select all
python2.6
Python 2.6.9 (unknown, Aug 26 2015, 21:06:20)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.56)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import requests
>>> Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named requests

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest