Deeplabcut: HDFStore requires PyTables, "No module named 'tables'" problem importing (Switching environment for Jupyter Notebook)

Created on 20 Sep 2018  路  8Comments  路  Source: DeepLabCut/DeepLabCut

Describe the bug
Running Step2_ConvertingLabels2DataFrame_demo.ipynb on Ubuntu 16.04 produces above error

To Reproduce
Steps to reproduce the behavior:

  1. git clone https://github.com/AlexEMG/DeepLabCut.git
  2. cd deeplabcut/conda-files
  3. conda env create -f dlcdependencieswTF1.2.yml
  4. source activate DLCdependencies
  5. jupyter notebook
  6. run Step2_ConvertingLabels2DataFrame_demo.ipynb

Expected behavior
The tutorial https://github.com/AlexEMG/DeepLabCut/blob/master/docs/demo-guide.md suggests it is possible to just run the code from step 3.

Desktop (please complete the following information):

  • OS: Ubuntu 16.04, CPU-based installation
  • Browser: Firefox
  • Version: 4.10.0-33-generic

Most helpful comment

Ok, I found a solution:
`

source activate DLCdependencies

pip3 install --upgrade pip jupyter ipython

ipython kernel install --user --name=py3DLC

switch to kernel py3DLC inside jupyter

`

All 8 comments

This is quite strange, as line 56 in the yml file contains: - tables==3.4.4
Can anybody else reproduce this?

Anyway, I guess you can fix it by typing: pip install tables

Thank you for your response. Pip install tables says tables already installed inside that environment. I checked for that

Hmm... it鈥檚 possible the environment is corrupt somehow, you could try to just rebuild and re-enter (Also, be sure you are indeed inside the environment, it should say the environment name in the top right corner)

I see, it is the good old bug with jupyter loading the wrong kernel. When I run ipython and print sys.executable, I get the correct environment, but when I print sys.executable from jupyter I get the wrong one. I think I have solved this issue like 100 times now, but I don't remember how. It always involves doing some magic combination of pip install ipykernel and similar operations

Ok, I found a solution:
`

source activate DLCdependencies

pip3 install --upgrade pip jupyter ipython

ipython kernel install --user --name=py3DLC

switch to kernel py3DLC inside jupyter

`

Yes, a jupyter notebook (does not a priori) use the environment even when started from this environment in the terminal. Here is more information on this: https://stackoverflow.com/questions/37085665/in-which-conda-environment-is-jupyter-executing

I had this problem when using my own data inside of ipython.
I seemed to be able to fix it with:
!conda install -c conda-forge pytables

maceng4's solution worked for me to get past the pytables error. Now on to float division by zero, ffmpeg opencv error.

Was this page helpful?
0 / 5 - 0 ratings