0

Newbie programmer here. This is a variation of this question and this question.

I am running Python 2.7 on Windows 7, and using git bash shell. I am trying to install the numpy package into a virtualenv directory in my work directory. I cannot install it using the $pip install -r requirements.txt or the $pip install numpy commands because of errors caused by its dependencies. Here is a log file for this install failure.

Although I can install numpy directly by downloading the executable binary (.exe) from sourceforge, but it forced me to install it in the c:/Python27/Lib/site-packages directory. I need to install it in my virtualenv work directory, e.g. c:/Users/MyName/Projects/myproject/myvirtualenv.

I need help on how to download the necessary numpy files into a temp directory, and how to use pip or another tool install it into my virtualenv directory.

I researched that I can choose a target directory using the -t option in pip, e.g., "pip install numpy --target=c:/Users/MyName/Projects/myproject/myvirtualenv". But I still can't get over the dependencies errors, so pip doesn't work for me unless I can figure out how to download the numpy files (including all dependencies) into a directory and then install from there.

Thanks for your help!

Community
  • 1
  • 1
Chino Brews
  • 101
  • 4
  • 1
    Have you tried to copy the files from `c:/Python27/Lib/site-packages` to `your_virtualenv_dir/lib`? Also what errors you get with pip? Probably you need mingw or something like that to build Numpy – Salem Jul 27 '14 at 22:16
  • I edited the post to add this link to my log file for the install errors: http://pastebin.com/qg1tBS8x – Chino Brews Jul 27 '14 at 22:26
  • And about copying the files? You can build Numpy in Windows but that will take some work. You will need at least `gcc` (mingw or cygwin), and maybe also Lapack, atlas, etc (not sure if they are required or optional). [Here](http://www.scipy.org/scipylib/building/windows.html) is a guide. – Salem Jul 27 '14 at 22:47
  • Are you sure your virtualenv is activated both for getting the requirements and the build? You may need to install system-wide the build-dependencies of numpy via APT (e.g., blas headers, etc.). – mdurant Jul 27 '14 at 22:55
  • 1
    PS: are you sure you don't want a distribution such as anaconda? – mdurant Jul 27 '14 at 22:56
  • @Salem I copied the files into my virtualenv directory, activated virtualenv, and then was able to start Python and import numpy. So that solved my problem. Thanks! Pip doesn't recognize they are loaded (pip freeze), but that does not affect me. – Chino Brews Jul 28 '14 at 04:16
  • @mdurant virtualenv was activated for the requirements and the install, so that was not it. Installing system-wide dependencies or doing my own build is *way* beyond my capabilities at this point, so I was hoping for a walkthrough. But I have my problem solved for now, and I thank you the referral to Anaconda -- I had never heard of that distribution before. That is now my backup plan. – Chino Brews Jul 28 '14 at 04:19

0 Answers0