3

I am having some troubles with pipon the Raspberry. These are the information about the OS:

piName@raspberry ~ $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 7 (wheezy)"
NAME="Raspbian GNU/Linux"
VERSION_ID="7"
VERSION="7 (wheezy)"
ID=raspbian
ID_LIKE=debian
ANSI_COLOR="1;31"
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

piName@raspberry ~ $ uname -a                                                   
Linux piname 4.1.19+ #858 Tue Mar 15 15:52:03 GMT 2016 armv6l GNU/Linux

My Python version associated with pip is 2.7.3, although I have also Python3 installed.

First when I list the outdated pip packages I get the following warning (sorry for the verbosity):

pip list --outdate
DEPRECATION: The default format will switch to columns in the future. 
You can use --format=(legacy|columns) (or define a format=(legacy|columns) 
in your pip.conf under the [list] section) to disable this warning.
    /usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages
/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been 
made, but the SNI (Subject Name Indication) extension to TLS is not 
available on this platform. This may cause the server to present an 
incorrect TLS certificate, which can cause validation failures. You can 
upgrade to a newer version of Python to solve this. For more information, 
see https://urllib3.readthedocs.io/en/latest
/security.html#snimissingwarning.
      SNIMissingWarning
    /usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages
/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object 
is not available. This prevents urllib3 from configuring SSL appropriately 
and may cause certain SSL connections to fail. You can upgrade to a newer 
version of Python to solve this. For more information, see 
https://urllib3.readthedocs.io/en/latest
/security.html#insecureplatformwarning.
      InsecurePlatformWarning

Some packages can be upgraded, some others cannot. For example pip install --upgrade scipy gives errors and one of this is the following

    Failed building wheel for scipy
  Running setup.py clean for scipy
  Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-pmGCTQ/scipy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" clean --all:

  `setup.py clean` is not supported, use one of the following instead:

    - `git clean -xdf` (cleans all files)
    - `git clean -Xdf` (cleans all versioned files, doesn't touch
                        files that aren't checked into the git repo)

  Add `--force` to your command to use it anyway if you must (unsupported)`enter code here`

Note that wheel is installed.

Also I have errors trying to upgrade numpy.

Does anyone know how to solve these issues?

Milliways
  • 62,573
  • 32
  • 113
  • 225
Francesco Boi
  • 593
  • 2
  • 7
  • 20

1 Answers1

3

Three Suggestions

  1. Use Virtualenv for development and custom applications, System python is for installed programs
    • System python is better suited for system utilities which are built against the packaged python and expect the versions to match the dependencies specified in `apt.
    • By upgrading anything using pip outside of apt you risk breaking the dependencies.
    • Avoid using pip to upgrade or install system wide packages, use apt instead
  2. As a standard course I would try to update pip itself.
    • Create a virtualenv virtualenv ~/myvenv && source ~/myvenv/bin/activate
    • Execute pip install --upgrade pip
    • Install scipy from scratch pip install scipy
  3. If you require Python3, you must do so explicitly
    • Install pip3 so it is available in virtualenv's apt-get install python3-pip
    • Create a virtualenv using python3 explicitly virtualenv -P python3 ~/myvenv3
    • Use pip3 to install packaged (in a python3 virtualenv, sometimes pip->pip3)

It is generally not recommended to use pip to manage system wide python packages, because the system bundled python is used to run installed utilities and sysadmin programs that are installed from apt which will depend and are built against the version of python bundled with the OS.

You may have issues when for example, you install a program from apt which depends on a library/package also bundled in apt , but you have gone and updated that outside of apt using pip, it may break an installed program or cause your system to fail to function.

The typical use is to install pip and then use virtualenv to create sand-boxed environments for development and custom applications

Francesco Boi
  • 593
  • 2
  • 7
  • 20
crasic
  • 3,033
  • 1
  • 11
  • 20