HEP-FCC / heppy

[deprecated] A python analysis framework for high energy physics
Other
11 stars 32 forks source link

How to install heppy using python? #75

Open JavierCVilla opened 6 years ago

JavierCVilla commented 6 years ago

I'm trying to install heppy just using the setup.py file and the installation process works but then I cannot import it from python, so I have the impression that it really installs nothing.

I've tried:

python setup.py install --prefix=~/.local

But it only generates a .egg file inside site-packages. Also tried using pip:

pip install .

And it even added nothing to site-packages, so at then from python I get this:

python
>>> import heppy                        
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named heppy

Is there a standard python way to install this module besides running the init.sh script? Or am I doing something wrong?

Such a way would be nice to create a Spack install recipe (package manager tool) in order to build the whole FCC stack with this tool.

cbernet commented 6 years ago

Hi @JavierCVilla , thank you for your report, and sorry for the inconvenience. You did nothing wrong. at some point I experimented with integrating heppy in pip, and got fairly far. but this does not work yet and I am really not sure when I'll be able to work on that. For sure not before Dec 11th. You seem to know about this kind of thing, would you like to contribute? that would be very much appreciated.

JavierCVilla commented 6 years ago

Sure @cbernet I can try to help, but it may require some significant changes in the project structure and I don't know enough about the package and its behaviour to foresee likely side-effects.

Therefore, I would propose to open a PR with the main changes and then start iterating the process.

What do you think ?

cbernet commented 6 years ago

Thank you Javier, I’d propose to wait until next week.

I will come to cern for the meeting next wednesday, and maybe we can spend 1 hour together ? I remember that i was able to install via pip by doing:

pip install heppy

at some point. I had created an heppy package in the pip test zone. maybe we can try to revive that first.

C

Le 30 nov. 2017 à 14:46, Javier Cervantes notifications@github.com a écrit :

Sure @cbernet https://github.com/cbernet I can try to help, but it may require some significant changes in the project structure and I don't know enough about the package and its behaviour to foresee likely side-effects.

Therefore, I would propose to open a PR with the main changes and then start iterating the process.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/HEP-FCC/heppy/issues/75#issuecomment-348192170, or mute the thread https://github.com/notifications/unsubscribe-auth/AD8ku4fBJ1R3FMVsuDHW6Zv32deAIfFzks5s7rG5gaJpZM4QwM5Z.

cbernet commented 6 years ago

I was able to create a wheel, upload it to testpypi, and install it with pip. However, the pip packages should have the following structure:

heppy/ 
   heppy/ 
      stuff... 
   setup.py 

This will require restructuring the package in this way (with the internal heppy package), and change a few environment scripts. But this should be no big deal.

JavierCVilla commented 6 years ago

That's nice! I did exactly the same to install it with:

python setup.py install 

Just moved most of folders to a new heppy folder and it worked.

We can discuss it next Wednesday.