pycuda icon indicating copy to clipboard operation
pycuda copied to clipboard

Installation into custom directory doesn't work when using setup.py

Open Flamefire opened this issue 3 years ago • 1 comments

The documentation for PyCUDA tells to call make install after configure.py which then uses python setup.py

When installation into another directory than the base python installation folder is required, the created module cannot be imported in Python 3.8+ (at least) Reason is that python setup.py creates an egg folder and a pth file, the latter is ignored, when outside of "site directories" so python doesn't search the egg folder and hence does not find pycuda.

A (common) use case are HPC modules, where Python is one module in one folder and (most) python libraries are separate modules each in an own folder. PYTHONPATH is then used to let python find that.

A solution is to simply use pip to install pycuda which creates a "proper" module installation

Flamefire avatar Mar 18 '21 09:03 Flamefire

Is this what you have in mind? https://github.com/inducer/aksetup/pull/1

inducer avatar Mar 18 '21 17:03 inducer