import mysql.connector error from the debian shell

0

I have a script that imports mysql.connector that works correctly from the idle, but when I try to execute them from the shell of the s.o. always throws me the error:

  

Traceback (most recent call last):

     

File "/home/pi/Projects/rasSerial.py", line 10, in < module >

     
    

import mysql.connector

  
     

ImportError: No module named mysql.connector

I run the script with its absolute path, I have tried to add the path of mysql with sys.path.append but there is no way.

The variable PYTHONPATH is not set with the correct values for the library to find me, if that was the solution.

Anyway, any idea is appreciated.

The environment is Raspbian, with Phyton 3.5.3 Server version: 10.1.23-MariaDB-9 + deb9u1 Raspbian 9.0

    
asked by rosu54 11.05.2018 в 22:54
source

1 answer

0

Finally looking in the English forum I found that it is because of the version that was executed in the shell. Launching the script with "phyton3.5" everything has worked.

    
answered by 17.05.2018 в 17:54