nrn icon indicating copy to clipboard operation
nrn copied to clipboard

NEURON no longer visible to pip in 8.2.4+ in Windows

Open thedannymarsh opened this issue 10 months ago • 4 comments

Context

Overview of the issue

Previous version of NEURON had their windows installation visible to pip, allowing python modules to check for the presence of NEURON on install

(base) C:\Users\dpm42>pip show neuron
Name: NEURON
Version: 8.2.3
Summary: NEURON bindings for python
Home-page: UNKNOWN
Author: UNKNOWN
Author-email: UNKNOWN
License: UNKNOWN
Location: c:\nrn\lib\python
Requires:
Required-by:

Now the following occurs in 8.2.4:

(base) C:\Users\dpm42>pip show neuron
WARNING: Package(s) not found: neuron

NEURON setup

  • Version: 8.2.4
  • Installation method Windows exe installer
  • OS + Version: Windows 10

thedannymarsh avatar Apr 24 '24 17:04 thedannymarsh

Thanks for the issue @thedannymarsh !

Tagging @nrnhines and @JCGoran. I think this could be anlso added as a test in our CI.

pramodk avatar Apr 24 '24 20:04 pramodk

First. I was completely unaware that there was a pip show neuron or that it ever worked :) I see that the issue is also with the present version 9 neuron master. One reason why I would expect it not to work (and the puzzle is why it ever did) is that on windows, NEURON is not installed with pip and the neuron module is not in python site-packages but in c:\nrn\lib\python and the module is found via the PYTHONPATH environment variable (defined when the setup.exe installs c:/nrn and sets various registry variables)

I'm going to speculate that the installer needs to do one more magic incantation so that pip is aware that the neuron module exists (via PYTHONPATH).

nrnhines avatar Apr 25 '24 00:04 nrnhines

I think even if PYTHONPATH is modified, pip show neuron still wouldn't work because pip would not be able to find the metadata associated with the package, i.e. the [PACKAGE]-[VERSION].dist-info directory is missing (even though python -c 'import neuron;print(neuron.__file__)' will point to the correct __init__.py file), so the real fix would be to create the [PACKAGE]-[VERSION].dist-info directory (maybe via a special CMake target) and ship it with the installer.

JCGoran avatar May 08 '24 11:05 JCGoran

@JCGoran : Just in case, do you know any relevant change in 8.2.4 that cause this behavior? (based on the ticket, I assume this is working 8.2.3).

By the way, if you just want windows machine to test, at BBP we have this windows server where one can install neuron and experiement.

pramodk avatar May 28 '24 15:05 pramodk