Is there a way to set where python pip builds a module? And keep that build?

Viewed 25

My pip command (On apple m1) is

env OPENBLAS=/usr/local/opt/appl/contrib-appleclang/OpenBLAS-0.3.18-ser CC='/usr/bin/clang' CFLAGS='-Wno-error=implicit-function-declaration -Wno-error=strict-prototypes -fvisibility=default -mmacosx-version-min=10.12 -fPIC -pipe' CXX='/usr/bin/clang++' CXXFLAGS='-stdlib=libc++ -Wno-error=implicit-function-declaration -Wno-error=strict-prototypes -fvisibility=default -mmacosx-version-min=10.12 -fPIC -pipe' F90='/usr/local/gfortran/bin/gfortran' /usr/local/opt/appl/contrib-appleclang/Python-3.9.6-sersh/bin/python3 -vvv -m pip install --cache-dir=/Users/home/research/cary/projects/svnpkgs --no-binary :all: --no-use-pep517 scipy==1.7.2

In the output I see

cwd: /private/var/folders/zz/zyxvpxvq6csfxvn_n0000yyw0007qq/T/pip-install-xj7c16et/scipy_675d2f67970e4d598db970286e95680a/

Can I set that directory?

Then when I try going to that directory, it is gone

$ ls /private/var/folders/zz/zyxvpxvq6csfxvn_n0000yyw0007qq/T/p ip-install-xj7c16et/scipy_675d2f67970e4d598db970286e95680a/ ls: /private/var/folders/zz/zyxvpxvq6csfxvn_n0000yyw0007qq/T/pip-install-xj7c16et/scipy_675d2f67970e4d598db970286e95680a/: No such file or directory

Is there a way to keep it around?

1 Answers

Yes, you can use --no-clean to keep the temporary directories.

However, it sounds like you really want pip wheel, which will build a (re)installable .whl of your package. It accepts most same arguments as pip install.

Related