radiasoft / jupyter.radiasoft.org

RadiaSoft public Jupyter Server announcements and global configuration
https://jupyter.radiasoft.org
Apache License 2.0
4 stars 0 forks source link

Python Compatibility Issue #24

Closed jseldred closed 6 years ago

jseldred commented 6 years ago

This morning I encountered a new set of warnings and errors.

The set imports at the beginning of the synergia file I am running generate warnings: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88

Another error raised: ImportWarning: Not importing directory '/home/vagrant/.pyenv/versions/py2/lib/synergia': missing __init__.py I decided to use 'touch' to create an empty __init__.py file in the directory that it was expected, and this error message went away.

After progressing past the __init__.py error message, I encounter: AttributeError: 'module' object has no attribute 'utils' which would be the first line in which the synergia imports are used. In this case the import is supposed to come from the line: from rssynergia.base_diagnostics import utils

I think may be related to Python 2 / Python 3 compatibility issues because that seems to be a common thread when I google-troubleshoot the errors messages.

How should I proceed?

Thank you.

robnagler commented 6 years ago

We are just ignoring the numpy error, because as you note, it's a known error without a solution. It doesn't seem to affect anything.

For the synergia import error, how are you running python? I don't see that error either in a notebook or on the command line on the jupyter server.

jseldred commented 6 years ago

I am running synergia through command line synergia IRCS_SC_WB.py or mpiexec -n 16 synergia IRCS_SC_WB.py

The lines of code that are run before the error interrupts:

import sys, os
import numpy as np
import matplotlib as mpl
mpl.use('pdf')
import matplotlib.pyplot as plt
import random
import scipy
from scipy.optimize import newton
from scipy import constants
try:
    import tables
except ImportError:
    get_ipython().system(' pip install tables')
from mpi4py import MPI

from rssynergia.base_diagnostics import utils
from rssynergia.base_diagnostics import read_bunch
from rssynergia.base_diagnostics import workflow
from rssynergia.base_diagnostics import lfplot
from rssynergia.base_diagnostics import latticework
from rssynergia.base_diagnostics import basic_calcs
from rssynergia.base_diagnostics import pltbunch
from rssynergia.base_diagnostics import elliptic_sp
from rssynergia.base_diagnostics import singleparticle
from rssynergia.base_diagnostics import options
from rssynergia.base_diagnostics import diagplot
from rssynergia.standard import standard_beam6d
from rssynergia.elliptic import elliptic_beam6d
import synergia
import synergia_workflow

from SC_test_options import opts

comm = synergia.utils.Commxx()
robnagler commented 6 years ago

I'm not seeing the error. Perhaps try to restart your server.

Contact me offline, and perhaps we can debug over Skype or Hangouts.

jseldred commented 6 years ago

The restart worked, I'm not seeing the problem anymore.

I thought I had ruled that out because I restarted yesterday morning, but it has apparently worked.

robnagler commented 6 years ago

Great, thanks for letting us know!