How do I 'force' python to use a specific version of a module?

Stuart

I'm new to python so I apologize if this has been answered elsewhere with tags I haven't thought of.

I'm trying to update numpy from the 1.6 version I have now to 1.8. I've installed numpy in my python site-packages when I call numpy it calls the old 1.6 version. I've tried looking for the root to numpy 1.6 so I can remove it but that leads to :-

import numpy
print numpy.__version__
print numpy.__file__
>>>
1.6.2
V:\Brian.140\Python.2.7.3\lib\site-packages\numpy\__init__.pyc

I've added the folder containing the module to the system path using:-

sys.path.append('C:/Python27/Lib/site-packages')

and I know this works as I can call other modules in this location with no errors, for example:-

import wx
import Bio

and

import nose

produce no errors. Why is this happening and how can I tell python which version of numpy to use?

Stuart

This is a very messy solution and probably shouldn't be encouraged but I found that if I remove the location of the old version of numpy from the system path I can call the version I want. The specific lines were:-

import sys
sys.path.append('C:/Python27/Lib/site-packages')
sys.path.remove('V:\\\Brian.140\\\Python.2.7.3\\\Lib\\\site-packages')
import numpy

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Yii generates a jQuery version 1.71. how do i force yii to use a specific jquery version

From Dev

How do I set up my Dockerfile to use cpanm to install a specific version of a Perl module?

From Dev

How do I use aptitude to downgrade/force version of a package?

From Dev

How do I force "bundle install" to use the installed version of Ruby?

From Java

How do I tell Gradle to use specific JDK version?

From Dev

How do i use subprocesses to force python to release memory?

From Dev

How can I force Caliburn.Micro.Xamarin.Forms to use a specific version of Xamarin.Forms?

From Dev

How do I install a specific patch number version of Python?

From Dev

How do I force Maven to use maven-install-plugin version 2.5?

From Dev

How to force gradle to use a specific appcompat-v7 version?

From Dev

How to Force Visual Studio to Use a Specific Version of DNX

From Dev

How do I force dnsmasq to use a specific DNS server without affecting the host systems DNS settings?

From Dev

How do i use force index with QueryDSL?

From Dev

How to force a specific version of dependency?

From Dev

Force SublimeREPL to use specific version of Ruby

From Dev

How can I force the use of a specific binary when running a script

From Dev

How do I force LF in a Windows git sandbox for a specific file?

From Dev

How do i force java methods to run specific implementations

From Dev

How do I configure IntelliJ to use a specific rbenv version for Rake as an external tool?

From Dev

How do I force my code to use 32-bit Python in a virtual environment?

From Dev

How do I upgrade the SQLite version used by Python's SQLite3 module on Mac?

From Dev

How do I migrate to a newer Python version and still use packages in the old version?

From Dev

how do I use different version of java

From Dev

Python / pip, how do I install a specific version of a git repository from github (what is the correct url)?

From Dev

Python / pip, how do I install a specific version of a git repository from github (what is the correct url)?

From Dev

How do I force ASP.NET app to use HTTPS?

From Dev

How do I force youtube to not use HTML5 in chrome?

From Dev

How do I force compiler to use aggregate init instead of constructor

From Dev

How do I use the bluetooth module in conjunction with the multiprocessing module?

Related Related

  1. 1

    Yii generates a jQuery version 1.71. how do i force yii to use a specific jquery version

  2. 2

    How do I set up my Dockerfile to use cpanm to install a specific version of a Perl module?

  3. 3

    How do I use aptitude to downgrade/force version of a package?

  4. 4

    How do I force "bundle install" to use the installed version of Ruby?

  5. 5

    How do I tell Gradle to use specific JDK version?

  6. 6

    How do i use subprocesses to force python to release memory?

  7. 7

    How can I force Caliburn.Micro.Xamarin.Forms to use a specific version of Xamarin.Forms?

  8. 8

    How do I install a specific patch number version of Python?

  9. 9

    How do I force Maven to use maven-install-plugin version 2.5?

  10. 10

    How to force gradle to use a specific appcompat-v7 version?

  11. 11

    How to Force Visual Studio to Use a Specific Version of DNX

  12. 12

    How do I force dnsmasq to use a specific DNS server without affecting the host systems DNS settings?

  13. 13

    How do i use force index with QueryDSL?

  14. 14

    How to force a specific version of dependency?

  15. 15

    Force SublimeREPL to use specific version of Ruby

  16. 16

    How can I force the use of a specific binary when running a script

  17. 17

    How do I force LF in a Windows git sandbox for a specific file?

  18. 18

    How do i force java methods to run specific implementations

  19. 19

    How do I configure IntelliJ to use a specific rbenv version for Rake as an external tool?

  20. 20

    How do I force my code to use 32-bit Python in a virtual environment?

  21. 21

    How do I upgrade the SQLite version used by Python's SQLite3 module on Mac?

  22. 22

    How do I migrate to a newer Python version and still use packages in the old version?

  23. 23

    how do I use different version of java

  24. 24

    Python / pip, how do I install a specific version of a git repository from github (what is the correct url)?

  25. 25

    Python / pip, how do I install a specific version of a git repository from github (what is the correct url)?

  26. 26

    How do I force ASP.NET app to use HTTPS?

  27. 27

    How do I force youtube to not use HTML5 in chrome?

  28. 28

    How do I force compiler to use aggregate init instead of constructor

  29. 29

    How do I use the bluetooth module in conjunction with the multiprocessing module?

HotTag

Archive