Having troubles with import trident

72 views
Skip to first unread message

Majid Uzbak

unread,
Feb 11, 2022, 3:54:51 AM2/11/22
to trident-project-users
Hello
We are trying to work with Trident, but we are getting an error, which wont let us to import trident, in python.
The error says: ModuleNotFoundError: No module named 'yt.convenience'
Anybody have had this kind of error too ? How can we fix it?
Best regards

Matthew Turk

unread,
Feb 13, 2022, 9:06:19 AM2/13/22
to Majid Uzbak, trident-project-users
Hi Majid,

That is likely related to a different version of yt being installed,
or yt not being installed at all. Can you verify that you are able to
"import yt" by itself?

-Matt
> --
> You received this message because you are subscribed to the Google Groups "trident-project-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to trident-project-...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/trident-project-users/68ba40fe-2fe3-484f-ad9b-363d4e2ca48bn%40googlegroups.com.

Majid Uzbak

unread,
Feb 13, 2022, 9:29:32 AM2/13/22
to trident-project-users
Hello Matthew
I have tried the yt, with spyder and also jupyter notebook and in both case, it does work.
for example I can load the data and also plot it with yt.ptojectionplot.

I found that the stable version of trident uses yt.loaders instead of yt.convenience.
So I uninstalled that version and installed the development version of the trident, from here using cmd (I am a macOS user):

But in this case, with the spyder I can run "import trident" with no error, but when I am trying to make a simple ray using this:

"ray = trident.make_simple_ray(ds, start_position=ray_start, end_position=ray_end, data_filename="ray.h5", lines=line_list, ftype=('gas'))"

I get this error:

"Traceback (most recent call last):
  File "/Users/majiduzbak/.spyder-py3/temp.py", line 23, in <module>
    ray = trident.make_simple_ray(ds,
AttributeError: module 'trident' has no attribute 'make_simple_ray'"

And jupyter notebook does not run it at all.

With regards.
Majid

Majid Uzbak

unread,
Feb 13, 2022, 9:36:58 AM2/13/22
to trident-project-users
The version of the yt is: 4.1.dev0
I cannot get the vresion of the trident, which can be, because the trident is not installed correctly?

Cameron Hummels

unread,
Feb 13, 2022, 11:11:49 AM2/13/22
to Matthew Turk, Majid Uzbak, trident-project-users
Matt is correct. I have been meaning to put out a new stable version of trident since the new year and haven’t found time. Until I do so, the current fix is to install the development version of yt and trident: https://trident.readthedocs.io/en/latest/installation.html#installing-the-development-version-of-yt-and-trident

Cameron

On Feb 13, 2022, at 6:06 AM, Matthew Turk <matth...@gmail.com> wrote:

Hi Majid,

Majid Uzbak

unread,
Feb 13, 2022, 11:21:27 AM2/13/22
to trident-project-users
Hi Cameron
I am trying to get the development version running, everything runs fine until, I clone the trident and when I enter the command: "pip install -e ."
I get this error: "

error: legacy-install-failure


× Encountered error while trying to install package.

╰─> matplotlib "

I also tried to pip install this package separately, out of luck.

-Majid


Cameron Hummels

unread,
Feb 14, 2022, 9:29:11 AM2/14/22
to Majid Uzbak, trident-project-users
Terrific! I will change things on our end to address this when I’m back.

On Feb 14, 2022, at 5:51 AM, Majid Uzbak <majid...@gmail.com> wrote:


Hi Cameron.
After I changed to ' matplotlib', it is now working fine. 
Thank you for all your help

Regards
Majid

On Mon, Feb 14, 2022 at 9:38 AM Majid Uzbak <majid...@gmail.com> wrote:
I will try this, but I also explained the entire problem on Slack, I assume that Chummels, is you?
With regards.
Majid
Reply all
Reply to author
Forward
0 new messages