Using pip3-installed python 3 packages when apt-installed packages exist too?

Spread the love
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  

I have numpy 1.8.2 installed in /usr/lib/python3/dist-packages (via apt), and the newest version (1.9.2) installed in /usr/local/lib/python3.4/dist-packages (via pip). Both paths are in sys.path (in that order), but only the older apt version is getting imported in python3.

➜ ~ sudo pip3 install –upgrade numpy
[sudo] password for naught101:
Real name of requirement numpy is numpy
Requirement already up-to-date: numpy in /usr/local/lib/python3.4/dist-packages
Cleaning up…
➜ ~ ipython3
Python 3.4.0 (default, Apr 11 2014, 13:05:11)
Type “copyright”, “credits” or “license” for more information.

IPython 1.2.1 — An enhanced Interactive Python.
? -> Introduction and overview of IPython’s features.
%quickref -> Quick reference.
help -> Python’s own help system.
object? -> Details about ‘object’, use ‘object??’ for extra details.

In [1]: import numpy

In [2]: numpy.version
Out[2]: <module ‘numpy.version’ from ‘/usr/lib/python3/dist-packages/numpy/version.py’>

In [3]:
KeyboardInterrupt

In [3]: numpy.version.version
Out[3]: ‘1.8.2’

In [5]: import sys

In [6]: sys.path
Out[6]:
[”,
‘/usr/local/bin’,
‘/usr/lib/python3/dist-packages’,
‘/usr/lib/python3.4’,
‘/usr/lib/python3.4/plat-x86_64-linux-gnu’,
‘/usr/lib/python3.4/lib-dynload’,
‘/usr/local/lib/python3.4/dist-packages’,
‘/usr/lib/python3.4/dist-packages’,
‘/usr/lib/python3/dist-packages/IPython/extensions’]

(python3 does the same thing as ipython3 here)

How can I get python3 to use the newer version?

I can’t just uninstall the apt version, because other packages depend on it.

X ITM Cloud News

Marisa

Leave a Reply

Next Post

UFW is not working in an LXC container

Sun Aug 2 , 2020
Spread the love          I’ve created an LXC container on Ubuntu Server 14.04.1 using the default template. I log into it, and run the following commands: sudo apt-get update sudo apt-get install ufw sudo ufw allow 22 At this point, I get the following error: ERROR: initcaps [Errno 2] modprobe: ERROR: ../libkmod/libkmod.c:556 […]
X- ITM

Cloud Computing – Consultancy – Development – Hosting – APIs – Legacy Systems

X-ITM Technology helps our customers across the entire enterprise technology stack with differentiated industry solutions. We modernize IT, optimize data architectures, and make everything secure, scalable and orchestrated across public, private and hybrid clouds.

This image has an empty alt attribute; its file name is x-itmdc.jpg

The enterprise technology stack includes ITO; Cloud and Security Services; Applications and Industry IP; Data, Analytics and Engineering Services; and Advisory.

Watch an animation of  X-ITM‘s Enterprise Technology Stack

We combine years of experience running mission-critical systems with the latest digital innovations to deliver better business outcomes and new levels of performance, competitiveness and experiences for our customers and their stakeholders.

X-ITM invests in three key drivers of growth: People, Customers and Operational Execution.

The company’s global scale, talent and innovation platforms serve 6,000 private and public-sector clients in 70 countries.

X-ITM’s extensive partner network helps drive collaboration and leverage technology independence. The company has established more than 200 industry-leading global Partner Network relationships, including 15 strategic partners: Amazon Web Services, AT&T, Dell Technologies, Google Cloud, HCL, HP, HPE, IBM, Micro Focus, Microsoft, Oracle, PwC, SAP, ServiceNow and VMware

.

X ITM