Problems with pip installation (python package manager)

12

I use Mac OS and use HomeBrew as the package manager. I installed python 2.7.10 . Along with this installation was to have occurred with pip . However the following problem occurs:

==> /usr/local/Cellar/python/2.7.10/bin/python -s setup.py --no-user-cfg install --force
File "/usr/local/Cellar/python/2.7.10/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/usr/local/Cellar/python/2.7.10/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1335, in _execute_child raise child_exception
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 9: ordinal not in range(128)

It seems the problem is with the encoding. I made an attempt to edit the file subprocess.py by putting # -*- coding: utf-8 -*- , but without success. I also noticed that the problem is not with the manager brew , because the same happened with easy_install :  File

"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1326, in _execute_child
raise child_exception
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 9: ordinal not in range(128)

I wanted to use /usr/local/lib/python2.7/site-package/ as a directory for python2.7 packages

    
asked by anonymous 06.06.2015 / 15:44

1 answer

1

I tried Ananconda, Homebrew and these just messed up my folder system. I like to control where my files are and I recommend a much more practical and light recipe I learned at MIT.

I use a Mac Book, and after a lot of trial and error, I have discovered that the latest versions of OS should be avoided as much as possible. So I did a total downgrade of my mac (factory setting) from Yosemite to Montain Lion. This is the best way to put all files in place and fix chronic errors. It costs almost one day, but then others win.

This would be the first step of this "recipe", but it is optional depending on the case. In my case, I could not plot any graph because anaconda and homebrew create their folders and environments, it seems, there were different sudo and non-sudo environments that I would take longer and would be more annoying than reinstalling everything.

But for a first try of this recipe try:

1 - At the terminal type: Python
   Confirm: Python 2.7.2

2 - Type in terminal quit() to quit Python

3 - Now type in the terminal: idle &
   This generates a Python IDLE Shell window outside the terminal and leaves the terminal and python independent.

4 - In the Python options, from the main menu, you can configure in General how to open IDLE in Start Up, select Open Text Edit. So typing idle & will open the edit program right away to read or write your code before running it. The shell you can open from the menu of this editor directly.

Now, before step 6, make sure Python is not actually enabled on the terminal by typing quit()

6 - At the terminal type easy_install pip (easy_install is a mac command installer)

7 - And after the successful installation of the pip is confirmed, type in the terminal sudo pip install pylab
pylab is the scientific python package that MIT students use, it includes matlibplot, netoworkx, numPy, etc.

8 - The rest you already know. In Python, use import pylab to use this feature.

    
17.07.2015 / 00:39