0

The default version of python (ie, one that opens on typing "python" in command line) is 2.6 on my server. I also have 2.7 installed. How do I import a module, in this case numpy, in python2.7? When I try to import right now, it gives me an error -

ImportError: No module named numpy

Is there any workaround, apart from downloading the package and doing a build install?

2
  • you have to copile numpy separately for python2.7 you can use pip for that. "/path/to/python2.7/bin/pip install numpy". If this doesn't work follow this - scipy.org/install.html or stackoverflow.com/questions/20497339/… Commented Jun 25, 2014 at 11:55
  • Thanks! I just did what you said. Commented Jun 26, 2014 at 7:32

1 Answer 1

0

I agree with the comment above. You will have to compile it separately. I once tried a hack of importing and modifying the sys.path however I ran into issues with the .so files.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.