meganz / sdk

MEGA C++ SDK
BSD 2-Clause "Simplified" License
1.33k stars 509 forks source link

Cannot import MegaApi [python3.4] #266

Open dellarte opened 8 years ago

dellarte commented 8 years ago

Hi,

I've followed the instructions for building sdk with python binding (--with-python3). But whenever i try to run the megacli.py example, python says it can't import MegaApi.

I think it's a python3 related error because it works with python 2.7

Here is my configuratino for build :

configure: Configured to build Mega SDK:

  SDK version:      2.6.0
  Host setup:       armv7l-unknown-linux-gnueabihf
  Install prefix:   /usr/local
  Compiler:         g++
  CXXFLAGS:         -g -O2 -fPIC
  gcc hardening:    no
  debug:            no
  static:           no
  sync subsystem    yes
  MEGA API          yes
  example apps:     yes

  inotify:          yes
  posix threads:    yes

  Python bindings:  yes
  Python3 bindings: yes
  PHP bindings:     no
  Java bindings:    no

  OpenSSL:            -lssl -lcrypto
  Crypto++:           -lcryptopp
  Sodium:
  Zlib:               -lz
  SQLite3:            -lsqlite3
  c-ares:             -lcares
  cURL:              -lcurl
  FreeImage:          -lfreeimage
  Readline:           -lreadline
  Termcap:            -ltermcap

[EDIT]

I've just moved megacli.py from sdk/example/python/ to /usr/local/lib/python3.4/dist-packages/mega/ and it seem to work.... My question is How can i execute my python from anywhere except there...?

Thank you

plutec commented 5 years ago

I'm having the same problem and I don't found any way to fix it.

plutec commented 5 years ago

Aparently It is a problem related with virtualenv. I need to do more checks.

kmkmjhyiiiu commented 5 years ago

@plutec Any luck? i tried with both, python2.7 and python3.7 but no luck.