[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Python #YFB-256906] Re: trouble getting drilsdown into unidata-workshop conda env



Worked for me just now, both installing to an existing environment, and adding to the environment.yml and creating a new environment from scratch.

The error message indicates that it encountered a problem when trying to import drilsdown (a bad header in a .pyc file, a cached version of the parsed python code).

The simple, brute force solution would be to nuke it and try again:

conda env remove -n unidata-workshop
conda env create -f environment.yml

Ryan

On Thu, Feb 1, 2018 at 2:58 AM, Mapes, Brian Earle <address@hidden> wrote:
Folks, I wanted to have my class get drilsdown into their "unidata-workshop" environment. I know, we should rename the environment as my course number. But we are trying to work from success and then adapt, and are still playing close to the base.Â

Here is the error: Â


1. I added ipywidgets and drilsdown to the environment.yml file as shown here.Â
 Â- ipywidgets
ÂÂ - pip:
ÂÂ Â - python-awips
ÂÂ Â - mpldatacursor
ÂÂ Â - drilsdown
I executed conda env update -f environment.yml
It appeared to install both new packages. No problems.Â

2. The beloved incantation
source activate unidata-workshopÂ

3. I set the necessary path
(unidata-workshop) bash-3.2$ export IDV_HOME=/Applications/IDV_5.4u1/Â

4. jupyter notebook

5. In a notebook code cell,Â
%reload_ext drilsdown

gets this error

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-2-06399fbebf41> in <module>()
----> 1 get_ipython().run_line_magic('reload_ext', 'drilsdown')

âgibberish
//anaconda/envs/unidata-workshop/lib/python3.6/importlib/_bootstrap_external.py in _validate_bytecode_header(data, source_stats, name, path)

ImportError: bad magic number in 'drilsdown': b'\x03\xf3\r\n'





--
Ryan May, Ph.D.
Software Engineer
UCAR/Unidata
Boulder, CO