neuronsimulator / nrn

NEURON Simulator
http://nrn.readthedocs.io
Other
389 stars 115 forks source link

NEURON no longer visible to pip in 8.2.4+ in Windows #2854

Open thedannymarsh opened 4 months ago

thedannymarsh commented 4 months ago

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

pramodk commented 4 months ago

Thanks for the issue @thedannymarsh !

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

nrnhines commented 4 months ago

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).

JCGoran commented 4 months ago

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.

pramodk commented 3 months ago

@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.