0

Fedora 18, x86_64. Okay, so:

I have installed python3 in ~/utils/src/python3/Python-3.3.0/ so that it's available on NFS and I don't have to reinstall it on every machine in the lab.

I want to install numpy. I got the source, it's in ~/utils/src/python3/numpy-1.7.0/ When I run python3 ./setup.py, I get:

file "~/utils/src/python3/Python-3.3.0/Lib/distutils/text_file.py", line 115, in open
self.file=io.open(self.filename, 'r', errors=self.errors)
FileNotFoundError: [Errno 2] No such file or directory: 
'/usr/local/lib/python3.3/config-3.3m/Makefile'

Going up the stack, I get to sysconfig.py, line 435, which seems to generate the path name by calling get_makefile_filename, which is in sysconfig.py, line 251. It accesses globals (python_build, _sys_home, and a bunch of others), and I'm not sure how they're configured.

I tried passing --prefix=~/utils/src/python3/Python-3.3.0 to setup.py, but got nowhere. (And I'm not sure what exactly --prefix does anyways)

Has anyone had luck installing packages with nonstandard python3 installs?

Thanks,

Charles.

Charles McAnany
  • 195
  • 1
  • 2
  • 7

1 Answers1

0

Okay, so here's the thing: distutils.sysconfig uses sys.executable, which is the location of the python executable. If this file is in the python build directory, then it will try to put everything in /lib. This was happening to me because I had a symlink from ~/utils/bin/python3 to ~/utils/src/python3/Python-3.3.0/python. sys.executable returned ~/utils/bin/python3, which was not in python's build directory.

Invoking the command as ~/utils/src/python3/Python-3.3.0/python setup.py got it to work.

I picked an arbitrary prefix (actually /dev/shm) and then copied everything that belonged in site-packages to ~/utils/src/python3/Python-3.3.0/Lib/site-packages/numpy, and it seems to work for now.

Charles McAnany
  • 195
  • 1
  • 2
  • 7