Code Monkey home page Code Monkey logo

Comments (11)

mccoys avatar mccoys commented on May 24, 2024

Hi

You seem to have run the happi.Open command in your bash terminal. However, this is a python command.

You first need to install the happi package: in a bash terminal, type make happi from the original Smilei directory. This has to be done only once in your machine. You should see a message saying a smilei.pth file was added somewhere. Otherwise, it means something is wrong with your python installation.

Then, open a python prompt using the python command, or any other, such as ipython which I recommend. In this prompt, you have to import happi then you may run command happi.Open as you did above.

from smilei.

mccoys avatar mccoys commented on May 24, 2024

I would like to add that the resolution to your problem is already explicit in the documentation.

If the doc is not clear for you, please explain what it lacks.

from smilei.

bitalm avatar bitalm commented on May 24, 2024

Dear @mccoys ,

Thanks for your e-mail and sorry that I did not look to the documentation.
I tried to install happy, by typing make happi in the shell but I could not,
I tried to execute Diagnostics.py file as follows, but seems still error exists:
(maybe it is due to my system, I use devtoolset -3 for GCC 4.9, but python is with GCC 4.8.5)

execfile("/home/work/Smilei-master/scripts/Diagnostics.py")
S = happi.Open("/home/work/Smilei-master")
Traceback (most recent call last):
File "", line 1, in
NameError: name 'happi' is not defined

ALL The Best

from smilei.

iltommi avatar iltommi commented on May 24, 2024

You need to type make happi in the smilei follder.

cd  /home/work/Smilei-master
make happi

what the above lines return?

from smilei.

iltommi avatar iltommi commented on May 24, 2024

However it seems that point 2 in https://smileipic.github.io/Smilei/installation.html#install-the-happi-module is no more valid for the latest release.

@mccoys can you confirm?

from smilei.

bitalm avatar bitalm commented on May 24, 2024

Dear @iltommi @mccoys ,

Thanks and sorry.
I used the previous version of Smilei and there was no happi folder, I compiled the new version and now I can use happi, ^_~

All The Best

from smilei.

mccoys avatar mccoys commented on May 24, 2024

@iltommi the Diagnostics.py technique should still work

@bitalm indeed the module happi is new and you need the newest version of smilei :)

from smilei.

iltommi avatar iltommi commented on May 24, 2024

I get this error when trying to directly import happi

In [1]: execfile("happi/__init__.py")
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-1-d13963d2b9f6> in <module>()
----> 1 execfile("happi/__init__.py")

/Users/tommaso/local/src/smilei/happi/__init__.py in <module>()
----> 1 from ._core import Open
      2 from ._Utils import multiPlot, Units

ValueError: Attempted relative import in non-package

from smilei.

mccoys avatar mccoys commented on May 24, 2024

@iltommi but this is not the right file to import. You must import scripts/Diagnostics.py

from smilei.

bitalm avatar bitalm commented on May 24, 2024

Dear @mccoys and @iltommi ,

Also I think I need h5py, when I run the
S = happi.Open("/home/work/Smilei-master/tst2d_4_laser_wake")
I receive as:
Traceback (most recent call last):
File "", line 1, in
File "/home/work/Smilei-master/happi/_core.py", line 512, in Open
return SmileiSimulation(*args, **kwargs)
File "/home/work/Smilei-master/happi/_core.py", line 538, in init
import h5py
ImportError: No module named h5py

All The Best

from smilei.

bitalm avatar bitalm commented on May 24, 2024

Dear @mccoys and @iltommi

I could solve the issue of h5py using anaconda python I guess,
Thanks :)
All The Best

from smilei.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.