3

I need to mount by phone (Huawei Honor 6) to the notebook.
This is the python code, what I wrote : (python phonedirectory.py)

import os

os.getcwd()
os.chdir("/media/")
os.system("killall gvfs-gphoto2-volume-monitor")
os.system("killall gvfs-mtp-volume-monitor")

dir = os.path.dirname("karthik/")

if not os.path.exists(dir):
    os.system("sudo mkdir karthik")

os.getcwd()

os.system("sudo chmod 777 karthik")

os.system("sudo mtpfs -o allow_other /media/karthik")

os.system("ls")

print('LIST OF FILES:')

os.system("ls /media/karthik/SD\ card/Bluetooth")

print('TOTAL NUMBER OF FILES:')

os.system("ls /media/karthik/SD\ card/Bluetooth | wc -l")

os.system("sudo umount karthik")

os.system("sudo rmdir karthik")

This is the error what I got :

Listing raw device(s)
mtpfs: symbol lookup error: /usr/local/lib/libmtp.so.9: undefined symbol: usb_init

till this command os.system("sudo chmod 777 karthik") it works fine.. After that, I am getting the error..

Executing this :

mtp-detect | grep idVendor
mtp-detect | grep idProduct

Results in this :

karthik@dkarnik2-Vostro-3558:~$ mtp-detect | grep idVendor
mtp-detect: symbol lookup error: /usr/local/lib/libmtp.so.9: undefined symbol: usb_init
karthik@dkarnik2-Vostro-3558:~$ mtp-detect | grep idProduct
mtp-detect: symbol lookup error: /usr/local/lib/libmtp.so.9: undefined symbol: usb_init

executing mtp-detect gives me this :

libmtp version: 1.1.6

Listing raw device(s)
mtp-detect: symbol lookup error: /usr/local/lib/libmtp.so.9: undefined symbol: usb_init

I am using ubuntu 14.04

Someone please tell me how to resolve that error..

Karthik
  • 275
  • 1
  • 3
  • 14

2 Answers2

0

Looks like your system misses some library, maybe libusb or something similar?

I'm not 100% about this, try this:

sudo apt-get intsall libusb-1.0-0 libusb-1.0-0-dev
Pedru
  • 1,295
  • 12
  • 29
  • I have updated my question. Hope you can tell me exactly what is missing. – Karthik Apr 13 '16 at 08:24
  • `libusb-1.0-0 is already the newest version.` `libusb-1.0-0-dev is already the newest version.` `libusb-1.0-0-dev set to manually installed.` `0 upgraded, 0 newly installed, 0 to remove and 647 not upgraded.` – Karthik Apr 13 '16 at 09:20
  • Have you installed libmtp (or mtp-tools) with apt? – Pedru Apr 13 '16 at 09:27
  • mtp-tools is installed.. while trying to install libmtp, i get this: karthik@dkarnik2-Vostro-3558:~$ sudo apt-get install libmtp `Reading package lists... Done` `Building dependency tree ` `Reading state information... Done` `E: Unable to locate package libmtp` – Karthik Apr 13 '16 at 09:30
  • Sorry I just wanted to ask: where does your mtplib come from? have you installed it with apt or did you install it otherwise? I ask because in your question the error says '/usr/local/lib/libmtp.so.9', that's not the directory of the library if you install it with apt. If not with apt: try to install the mtp-tools package. – Pedru Apr 13 '16 at 09:37
  • I don't remember what way i installed it.. Should i uninstall it and install back again using apt ? – Karthik Apr 13 '16 at 11:09
0

I solved it by just using this command mv /usr/local/lib/libmtp.so.9 /usr/local/lib/libmtp.so.9_backUp and then try using mtp-detect. Reason of this stupidity could be /usr/local/lib/libmtp.so.9 this library might not be compatible with your version. Instead of removing we better keep it's backup so that if that doesn't work you can rollback this workaround.

Harneet Singh
  • 1,270
  • 2
  • 12
  • 22