Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
46 Views

Import Error while executing part 1 "Exploratory Data Analysis" in the course.

Jump to solution

Course:AI from Data Center to edge(Exploratory_Data_Analysis.ipynb)

ImportError: libprotobuf.so.12: cannot open shared object file: No such file or directory.

I am facing this error while importing cv2.

I have created the tf_training kernel and changed the path but still getting the same problem.

I have referred this solution and followed the steps but it is showing the same error.(https://software.intel.com/en-us/forums/intel-devcloud/topic/843517)

Please help me resolve this issue soon.

Thanks

Tags (1)
0 Kudos

Accepted Solutions
Highlighted
Moderator
46 Views

Hi,

Thanks for sharing the steps.

Could you please check, whether you missed to edit the kernel.json file after step 1 (which is not seen in your steps) .If so, please follow the below steps:

1. Open jupyter terminal and give

cd /home/u*****/.local/share/jupyter/kernels/tf_training

2. Open kernel.json and check if the python path referenced is /glob python or path to your tf_training. If it is /glob python, change the path to

/home/u*****/.conda/envs/tf_training/bin/python

3. Open the terminal and activate tf_training.

source activate tf_training

4.  Check the path of Python by giving the following command: which python. If it references /glob python path, update the PATH by exporting the conda python path.     

export PATH="/home/u*****/.conda/envs/tf_training/bin":$PATH

Also check which python is being used in the jupyter notebook using the below commands.

 import sys
 sys.executable

 

If the issue still persists, please let us know.

Thanks.
 

   

        

 

View solution in original post

0 Kudos
13 Replies
Highlighted
Moderator
46 Views

Hi,

Thanks for reaching out to us.

Could you please share the exact steps you followed.

Also check which python is being used in the jupyter notebook using the below commands and let us know the output.

import sys
sys.executable

 

 

.

0 Kudos
Highlighted
Beginner
46 Views

Hi.I followed these steps

step 1-> conda update conda

step->2 python -m ipykernel install --user --name tf_training --display-name "tf_training"

step->3 conda env create -f environment.yml

step-> 4 Open jupyter notebook and changed the kernel to tf_training.

Then,I ran the program and was getting Import error.

Further steps:

step->1 Opened terminal  and gave:- cd /home/u*****/.local/share/jupyter/kernels/tf_training

step->2 which python

/glob/intel-python/python3/bin//python

step-3 activate tf_training

step->4  export PATH="/home/u*****/.conda/envs/tf_training/bin":$PATH

step->5 which python

/home/u39154/.conda/envs/tf_training/bin/python

The path was changed but I was still getting the same error.

While executing :-

import sys

sys.executable

output:-

'/glob/intel-python/python3/bin/python'

 

0 Kudos
Highlighted
Moderator
47 Views

Hi,

Thanks for sharing the steps.

Could you please check, whether you missed to edit the kernel.json file after step 1 (which is not seen in your steps) .If so, please follow the below steps:

1. Open jupyter terminal and give

cd /home/u*****/.local/share/jupyter/kernels/tf_training

2. Open kernel.json and check if the python path referenced is /glob python or path to your tf_training. If it is /glob python, change the path to

/home/u*****/.conda/envs/tf_training/bin/python

3. Open the terminal and activate tf_training.

source activate tf_training

4.  Check the path of Python by giving the following command: which python. If it references /glob python path, update the PATH by exporting the conda python path.     

export PATH="/home/u*****/.conda/envs/tf_training/bin":$PATH

Also check which python is being used in the jupyter notebook using the below commands.

 import sys
 sys.executable

 

If the issue still persists, please let us know.

Thanks.
 

   

        

 

View solution in original post

0 Kudos
Highlighted
Beginner
46 Views

Ya,thanks for your response.

I am not able to open kernel.json file.when I open kernel.json ,it is showing "Not a directory'.

Steps:-

1. Open jupyter terminal and give-

cd /home/u*****/.local/share/jupyter/kernels/tf_training

output;-u****@s001-n016:~/.local/share/jupyter/kernels/tf_training$ 

2. In order to open kernel.json

u*****@s001-n016:~/.local/share/jupyter/kernels/tf_training$ /kernel.json
bash: /kernel.json: No such file or directory

I am getting "No such file or directory" as output.

 

 

0 Kudos
Highlighted
Moderator
46 Views

Hi,

You can open the kernel.json using the below command:

vi kernel.json

Check if the python path referenced is /glob python or path to your tf_training. If it is /glob python, change the path to

/home/u*****/.conda/envs/tf_training/bin/python

Hope this helps.

Thanks

0 Kudos
Highlighted
Beginner
46 Views

Hi,Thanks for your response.

I am using following method to open kernel.json and change the path.

step 1 

Open jupyter terminal and give-

cd /home/u*****/.local/share/jupyter/kernels/tf_training

step 2 vi kernel.json


Swap file ".kernel.json.swp" already exists!
pen Read-Only, (E)dit anyway, (R)ecover, (Q)uit, (A)bort:

step 3 when I am trying to edit the location ,it is not taking the location in E mode.

In which mode should I open from(O,E,R,A) and how should I save the changed path?

0 Kudos
Highlighted
Moderator
46 Views

Hi,

You can remove the .kernel.json.swp file using the below command

rm .kernel.json.swp

Please follow the below steps to edit and save the file:

Step 1. Open the kernel.json

vi kernel.json

Step 2. Check if the python path referenced is /glob python or path to your tf_training. If it is /glob python, change the path to

/home/u*****/.conda/envs/tf_training/bin/python

Step 3. Save the file 

Press [Esc] to shift to the command mode and press :wq! and hit [Enter] to save the file.

 

If you face any issue please let us know.

Thanks

 

 

0 Kudos
Highlighted
Beginner
46 Views

Thanks for the steps.

I followed all the above steps,I changed and saved the path.

But when I opened the Jupyter Notebook,I was unable to see the tf_training kernel.

And when I tried to access kernel.json again,It was empty.

 

0 Kudos
Highlighted
Moderator
46 Views

Hi,

Could you please add below lines into the kernel.json file and save.

 

{
 "argv": [
  "/home/uxxxxx/.conda/envs/tf_training/bin/python",
  "-m",
  "ipykernel_launcher",
  "-f",
  "{connection_file}"
 ],
 "display_name": "tf_training",
 "language": "python"
}

Please change uxxxxx to your username.

Hope this helps. If you still face the same issue, please create one new environment and try the same from start.

Thanks

0 Kudos
Highlighted
Beginner
46 Views

Thanks for your patience to answer my all my doubts.

 

I have changed the path in kernel.json and export path also I have changed.I am still facing the same error.

I am not able to create the new environment as you said.

step 1 conda env create -f environment.yml

I am getting error:- AttributeError: 'NoneType' object has no attribute 'keys'

--------------------------------------------------------------------------------------------------------

import sys

sys.executable 

output;-'/glob/intel-python/python3/bin/python'

 

 

0 Kudos
Highlighted
Moderator
46 Views

Hi,

Please download the course once again and try the same from start.

You can download the course from below link :

https://software.intel.com/en-us/download/course-ai-from-the-data-center-to-the-edge-an-optimized-pa...

Please remove the already created tf_training environment before starting the course using the below command

rm -r /home/uxxxxx/.conda/envs/tf_training

 

After editing the kernel.json file , please restart the jupyter notebook and then check the python path using below commands

import sys
sys.executable

 

Please let us know if you face further issues.

If you are still facing the python path issue, please share the username . We will contact the concerned team.

 

Thanks

0 Kudos
Highlighted
Beginner
46 Views

I have started executing programs on local jupyter notebook and I am getting most of the outout in that .

I have created the environment as per mentioned in the course.

Thanks a lot for answering my queries and doubts.

Have a nice day.

0 Kudos
Highlighted
Moderator
46 Views

Hi,

Glad to know that your issue got resolved.

We are closing this thread. Please feel free to open a new thread if you face any further issues.

Thanks

0 Kudos