-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Different environments, depending on path of execution #116
Comments
I would print out your python path in both environments:
You might have a different version of Numpy than the one used to compile Javabridge. |
sys.path yields the same in both cases: as for numpy:
'
' |
It could very well be that Javabridge was compiled against Numpy 1.12.1 and Python is importing 1.13.1 or vice versa. I would try uninstalling Javabridge and reinstalling it. |
Numpy 1.13.1 came with javabridge. I pip uninstalled it (seeing no other dependencies were affected), then updated the remainig numpy 1.12.1 to 1.13.1 using conda, thereby also updating a few dependencies. after building javabridge from source (pip installation doesn't work as I am working with mac and it wouldn't find the JVM), I only have one numpy version in my environment, but the described issue remains the same. |
I just tested on an ubuntu machine and saw that the issue doesn't come up there. Its environment has the same numpy version 1.13.1. Here I could test with javabridge installed from source as well as pip installed. Both options work. |
I don't have a Mac to test on currently. I know there's some code that is specific to that platform. If I recall, there are issues regarding which version of Java is used on the Mac. |
Hi,
When I call functions using the javabridge from terminal using nosetests, the behaviour is different to the execution of my code directly, as a module. In particular, I am calling the exact same function that uses
'
'
in the nosetest-case, the field METER exists, but not in the direct case (or from ipython). When calling units.field_names, different lists are returned (see below for a comparison). I find this curious and expect that the reason may be that I somehow end up in different environments of whatever kind (I am definitely in the same conda environment). It is fixable by using METRE instead of METER, NM instead of NANOMETER, etc.
A more pressing, but probably connected issue is that writing to file using
'
'
works when calling nosetests, but when called directly from ipython or execution of the code in module mode, the execution hangs during saveBytes(..) (the image being a 2D np.uint16 array)
printing bioformats.JARS yields the exact same result in either execution mode.
I am stuck here and can't think of how to proceed. Any help would be appreciated.
this is somewhat connected to issue #113, I am still trying to write ome.tiff files.
list of fields of units using ipython:
['RADIAN', 'VOLT', 'HERTZ', 'METRE', 'INCH', 'WATT', 'PASCAL', 'KELVIN', 'SECOND', 'YOTTAHZ', 'ZETTAHZ', 'EXAHZ', 'PETAHZ', 'TERAHZ', 'GIGAHZ', 'MEGAHZ', 'KHZ', 'HHZ', 'DAHZ', 'HZ', 'DHZ', 'CHZ', 'MHZ', 'MICROHZ', 'NHZ', 'PHZ', 'FHZ', 'AHZ', 'ZHZ', 'YHZ', 'YOTTAM', 'ZETTAM', 'EXAM', 'PETAM', 'TERAM', 'GIGAM', 'MEGAM', 'KM', 'HM', 'DAM', 'M', 'DM', 'CM', 'MM', 'MICROM', 'NM', 'PM', 'FM', 'AM', 'ZM', 'YM', 'ANGSTROM', 'THOU', 'LI', 'IN', 'FT', 'YD', 'MI', 'UA', 'LY', 'PC', 'PT', 'PIXEL', 'REFERENCEFRAME', 'YOTTAW', 'ZETTAW', 'EXAW', 'PETAW', 'TERAW', 'GIGAW', 'MEGAW', 'KW', 'HW', 'DAW', 'W', 'DW', 'CW', 'MW', 'MICROW', 'NW', 'PW', 'FW', 'AW', 'ZW', 'YW', 'YOTTAPA', 'ZETTAPA', 'EXAPA', 'PETAPA', 'TERAPA', 'GIGAPA', 'MEGAPA', 'KPA', 'HPA', 'DAPA', 'PA', 'DPA', 'CPA', 'MPA', 'MICROPA', 'NPA', 'PPA', 'FPA', 'APA', 'ZPA', 'YPA', 'BAR', 'MEGABAR', 'KBAR', 'DBAR', 'CBAR', 'MBAR', 'ATM', 'PSI', 'TORR', 'MTORR', 'MMHG', 'DEGREEC', 'K', 'DEGREER', 'DEGREEF', 'YOTTAS', 'ZETTAS', 'EXAS', 'PETAS', 'TERAS', 'GIGAS', 'MEGAS', 'KS', 'HS', 'DAS', 'S', 'DS', 'CS', 'MS', 'MICROS', 'NS', 'PS', 'FS', 'AS', 'ZS', 'YS', 'MIN', 'H', 'D', 'YOTTAV', 'ZETTAV', 'EXAV', 'PETAV', 'TERAV', 'GIGAV', 'MEGAV', 'KV', 'HV', 'DAV', 'V', 'DV', 'CV', 'MV', 'MICROV', 'NV', 'PV', 'FV', 'AV', 'ZV', 'YV', 'DEG', 'RAD', 'GON']
list of fields in units using nosetests:
['RADIAN', 'VOLT', 'HERTZ', 'METRE', 'INCH', 'WATT', 'PASCAL', 'KELVIN', 'SECOND', 'YOTTAHERTZ', 'ZETTAHERTZ', 'EXAHERTZ', 'PETAHERTZ', 'TERAHERTZ', 'GIGAHERTZ', 'MEGAHERTZ', 'KILOHERTZ', 'HECTOHERTZ', 'DECAHERTZ', 'DECIHERTZ', 'CENTIHERTZ', 'MILLIHERTZ', 'MICROHERTZ', 'NANOHERTZ', 'PICOHERTZ', 'FEMTOHERTZ', 'ATTOHERTZ', 'ZEPTOHERTZ', 'YOCTOHERTZ', 'YOTTAHZ', 'ZETTAHZ', 'EXAHZ', 'PETAHZ', 'TERAHZ', 'GIGAHZ', 'MEGAHZ', 'KHZ', 'HHZ', 'DAHZ', 'HZ', 'DHZ', 'CHZ', 'MHZ', 'MICROHZ', 'NHZ', 'PHZ', 'FHZ', 'AHZ', 'ZHZ', 'YHZ', 'YOTTAMETRE', 'ZETTAMETRE', 'EXAMETRE', 'PETAMETRE', 'TERAMETRE', 'GIGAMETRE', 'MEGAMETRE', 'KILOMETRE', 'HECTOMETRE', 'DECAMETRE', 'DECIMETRE', 'CENTIMETRE', 'MILLIMETRE', 'MICROMETRE', 'NANOMETRE', 'PICOMETRE', 'FEMTOMETRE', 'ATTOMETRE', 'ZEPTOMETRE', 'YOCTOMETRE', 'YOTTAMETER', 'ZETTAMETER', 'EXAMETER', 'PETAMETER', 'TERAMETER', 'GIGAMETER', 'MEGAMETER', 'KILOMETER', 'HECTOMETER', 'DECAMETER', 'METER', 'DECIMETER', 'CENTIMETER', 'MILLIMETER', 'MICROMETER', 'NANOMETER', 'PICOMETER', 'FEMTOMETER', 'ATTOMETER', 'ZEPTOMETER', 'YOCTOMETER', 'ANGSTROM', 'THOU', 'LINE', 'FOOT', 'YARD', 'MILE', 'ASTRONOMICALUNIT', 'LIGHTYEAR', 'PARSEC', 'POINT', 'PIXEL', 'REFERENCEFRAME', 'YOTTAM', 'ZETTAM', 'EXAM', 'PETAM', 'TERAM', 'GIGAM', 'MEGAM', 'KM', 'HM', 'DAM', 'M', 'DM', 'CM', 'MM', 'MICROM', 'NM', 'PM', 'FM', 'AM', 'ZM', 'YM', 'LI', 'IN', 'FT', 'YD', 'MI', 'UA', 'LY', 'PC', 'PT', 'YOTTAWATT', 'ZETTAWATT', 'EXAWATT', 'PETAWATT', 'TERAWATT', 'GIGAWATT', 'MEGAWATT', 'KILOWATT', 'HECTOWATT', 'DECAWATT', 'DECIWATT', 'CENTIWATT', 'MILLIWATT', 'MICROWATT', 'NANOWATT', 'PICOWATT', 'FEMTOWATT', 'ATTOWATT', 'ZEPTOWATT', 'YOCTOWATT', 'YOTTAW', 'ZETTAW', 'EXAW', 'PETAW', 'TERAW', 'GIGAW', 'MEGAW', 'KW', 'HW', 'DAW', 'W', 'DW', 'CW', 'MW', 'MICROW', 'NW', 'PW', 'FW', 'AW', 'ZW', 'YW', 'YOTTAPASCAL', 'ZETTAPASCAL', 'EXAPASCAL', 'PETAPASCAL', 'TERAPASCAL', 'GIGAPASCAL', 'MEGAPASCAL', 'KILOPASCAL', 'HECTOPASCAL', 'DECAPASCAL', 'DECIPASCAL', 'CENTIPASCAL', 'MILLIPASCAL', 'MICROPASCAL', 'NANOPASCAL', 'PICOPASCAL', 'FEMTOPASCAL', 'ATTOPASCAL', 'ZEPTOPASCAL', 'YOCTOPASCAL', 'BAR', 'MEGABAR', 'KILOBAR', 'DECIBAR', 'CENTIBAR', 'MILLIBAR', 'ATMOSPHERE', 'PSI', 'TORR', 'MILLITORR', 'MMHG', 'YOTTAPA', 'ZETTAPA', 'EXAPA', 'PETAPA', 'TERAPA', 'GIGAPA', 'MEGAPA', 'KPA', 'HPA', 'DAPA', 'PA', 'DPA', 'CPA', 'MPA', 'MICROPA', 'NPA', 'PPA', 'FPA', 'APA', 'ZPA', 'YPA', 'KBAR', 'DBAR', 'CBAR', 'MBAR', 'ATM', 'MTORR', 'CELSIUS', 'RANKINE', 'FAHRENHEIT', 'DEGREEC', 'K', 'DEGREER', 'DEGREEF', 'YOTTASECOND', 'ZETTASECOND', 'EXASECOND', 'PETASECOND', 'TERASECOND', 'GIGASECOND', 'MEGASECOND', 'KILOSECOND', 'HECTOSECOND', 'DECASECOND', 'DECISECOND', 'CENTISECOND', 'MILLISECOND', 'MICROSECOND', 'NANOSECOND', 'PICOSECOND', 'FEMTOSECOND', 'ATTOSECOND', 'ZEPTOSECOND', 'YOCTOSECOND', 'MINUTE', 'HOUR', 'DAY', 'YOTTAS', 'ZETTAS', 'EXAS', 'PETAS', 'TERAS', 'GIGAS', 'MEGAS', 'KS', 'HS', 'DAS', 'S', 'DS', 'CS', 'MS', 'MICROS', 'NS', 'PS', 'FS', 'AS', 'ZS', 'YS', 'MIN', 'H', 'D', 'YOTTAVOLT', 'ZETTAVOLT', 'EXAVOLT', 'PETAVOLT', 'TERAVOLT', 'GIGAVOLT', 'MEGAVOLT', 'KILOVOLT', 'HECTOVOLT', 'DECAVOLT', 'DECIVOLT', 'CENTIVOLT', 'MILLIVOLT', 'MICROVOLT', 'NANOVOLT', 'PICOVOLT', 'FEMTOVOLT', 'ATTOVOLT', 'ZEPTOVOLT', 'YOCTOVOLT', 'YOTTAV', 'ZETTAV', 'EXAV', 'PETAV', 'TERAV', 'GIGAV', 'MEGAV', 'KV', 'HV', 'DAV', 'V', 'DV', 'CV', 'MV', 'MICROV', 'NV', 'PV', 'FV', 'AV', 'ZV', 'YV', 'DEGREE', 'GRADIAN', 'DEG', 'RAD', 'GON']
The text was updated successfully, but these errors were encountered: