mega.py icon indicating copy to clipboard operation
mega.py copied to clipboard

import error from mega import Mega ImportError: cannot import name 'Mega' from 'mega'

Open Nksama opened this issue 4 years ago • 15 comments

from mega import Mega

ImportError: cannot import name 'Mega' from 'mega'

does anyone know how to fix this

Nksama avatar Jun 11 '21 11:06 Nksama

Have you installed this lib? e.g.

python3 -m pip install mega.py && python3 -c "from mega import Mega"

adaamz avatar Jun 12 '21 14:06 adaamz

yes

Nksama avatar Jun 13 '21 05:06 Nksama

and what is output for this?

adaamz avatar Jun 13 '21 10:06 adaamz

same

Nksama avatar Jun 13 '21 12:06 Nksama

nope i have a different output

raceback (most recent call last):
  File "D:\env\upload.py", line 1, in <module>
    from mega import Mega
  File "C:\Users\HP\AppData\Roaming\Python\Python39\site-packages\mega\__init__.py", line 1, in <module>
    from .mega import Mega  # noqa
  File "C:\Users\HP\AppData\Roaming\Python\Python39\site-packages\mega\mega.py", line 8, in <module>
    from Crypto.Cipher import AES
ModuleNotFoundError: No module named 'Crypto'

Nksama avatar Jun 13 '21 12:06 Nksama

if i tried to install pycrypto

D:\env>pip install pycrypto
Defaulting to user installation because normal site-packages is not writeable
Collecting pycrypto
  Using cached pycrypto-2.6.1.tar.gz (446 kB)
Using legacy 'setup.py install' for pycrypto, since package 'wheel' is not installed.
Installing collected packages: pycrypto
    Running setup.py install for pycrypto ... error
    ERROR: Command errored out with exit status 1:
     command: 'c:\program files\python39\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\HP\\AppData\\Local\\Temp\\pip-install-1vrqy3v9\\pycrypto_59b0ecffdd5a4946a71289a4ebf87110\\setup.py'"'"'; __file__='"'"'C:\\Users\\HP\\AppData\\Local\\Temp\\pip-install-1vrqy3v9\\pycrypto_59b0ecffdd5a4946a71289a4ebf87110\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\HP\AppData\Local\Temp\pip-record-ax5xvq3a\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\HP\AppData\Roaming\Python\Python39\Include\pycrypto'
         cwd: C:\Users\HP\AppData\Local\Temp\pip-install-1vrqy3v9\pycrypto_59b0ecffdd5a4946a71289a4ebf87110\
    Complete output (153 lines):
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.9
    creating build\lib.win-amd64-3.9\Crypto
    copying lib\Crypto\pct_warnings.py -> build\lib.win-amd64-3.9\Crypto
    copying lib\Crypto\__init__.py -> build\lib.win-amd64-3.9\Crypto
    creating build\lib.win-amd64-3.9\Crypto\Hash
    copying lib\Crypto\Hash\hashalgo.py -> build\lib.win-amd64-3.9\Crypto\Hash
    copying lib\Crypto\Hash\HMAC.py -> build\lib.win-amd64-3.9\Crypto\Hash
    copying lib\Crypto\Hash\MD2.py -> build\lib.win-amd64-3.9\Crypto\Hash
    copying lib\Crypto\Hash\MD4.py -> build\lib.win-amd64-3.9\Crypto\Hash
    copying lib\Crypto\Hash\MD5.py -> build\lib.win-amd64-3.9\Crypto\Hash
    copying lib\Crypto\Hash\RIPEMD.py -> build\lib.win-amd64-3.9\Crypto\Hash
    copying lib\Crypto\Hash\SHA.py -> build\lib.win-amd64-3.9\Crypto\Hash
    copying lib\Crypto\Hash\SHA224.py -> build\lib.win-amd64-3.9\Crypto\Hash
    copying lib\Crypto\Hash\SHA256.py -> build\lib.win-amd64-3.9\Crypto\Hash
    copying lib\Crypto\Hash\SHA384.py -> build\lib.win-amd64-3.9\Crypto\Hash
    copying lib\Crypto\Hash\SHA512.py -> build\lib.win-amd64-3.9\Crypto\Hash
    copying lib\Crypto\Hash\__init__.py -> build\lib.win-amd64-3.9\Crypto\Hash
    creating build\lib.win-amd64-3.9\Crypto\Cipher
    copying lib\Crypto\Cipher\AES.py -> build\lib.win-amd64-3.9\Crypto\Cipher
    copying lib\Crypto\Cipher\ARC2.py -> build\lib.win-amd64-3.9\Crypto\Cipher
    copying lib\Crypto\Cipher\ARC4.py -> build\lib.win-amd64-3.9\Crypto\Cipher
    copying lib\Crypto\Cipher\blockalgo.py -> build\lib.win-amd64-3.9\Crypto\Cipher
    copying lib\Crypto\Cipher\Blowfish.py -> build\lib.win-amd64-3.9\Crypto\Cipher
    copying lib\Crypto\Cipher\CAST.py -> build\lib.win-amd64-3.9\Crypto\Cipher
    copying lib\Crypto\Cipher\DES.py -> build\lib.win-amd64-3.9\Crypto\Cipher
    copying lib\Crypto\Cipher\DES3.py -> build\lib.win-amd64-3.9\Crypto\Cipher
    copying lib\Crypto\Cipher\PKCS1_OAEP.py -> build\lib.win-amd64-3.9\Crypto\Cipher
    copying lib\Crypto\Cipher\PKCS1_v1_5.py -> build\lib.win-amd64-3.9\Crypto\Cipher
    copying lib\Crypto\Cipher\XOR.py -> build\lib.win-amd64-3.9\Crypto\Cipher
    copying lib\Crypto\Cipher\__init__.py -> build\lib.win-amd64-3.9\Crypto\Cipher
    creating build\lib.win-amd64-3.9\Crypto\Util
    copying lib\Crypto\Util\asn1.py -> build\lib.win-amd64-3.9\Crypto\Util
    copying lib\Crypto\Util\Counter.py -> build\lib.win-amd64-3.9\Crypto\Util
    copying lib\Crypto\Util\number.py -> build\lib.win-amd64-3.9\Crypto\Util
    copying lib\Crypto\Util\py3compat.py -> build\lib.win-amd64-3.9\Crypto\Util
    copying lib\Crypto\Util\randpool.py -> build\lib.win-amd64-3.9\Crypto\Util
    copying lib\Crypto\Util\RFC1751.py -> build\lib.win-amd64-3.9\Crypto\Util
    copying lib\Crypto\Util\winrandom.py -> build\lib.win-amd64-3.9\Crypto\Util
    copying lib\Crypto\Util\_number_new.py -> build\lib.win-amd64-3.9\Crypto\Util
    copying lib\Crypto\Util\__init__.py -> build\lib.win-amd64-3.9\Crypto\Util
    creating build\lib.win-amd64-3.9\Crypto\Random
    copying lib\Crypto\Random\random.py -> build\lib.win-amd64-3.9\Crypto\Random
    copying lib\Crypto\Random\_UserFriendlyRNG.py -> build\lib.win-amd64-3.9\Crypto\Random
    copying lib\Crypto\Random\__init__.py -> build\lib.win-amd64-3.9\Crypto\Random
    creating build\lib.win-amd64-3.9\Crypto\Random\Fortuna
    copying lib\Crypto\Random\Fortuna\FortunaAccumulator.py -> build\lib.win-amd64-3.9\Crypto\Random\Fortuna
    copying lib\Crypto\Random\Fortuna\FortunaGenerator.py -> build\lib.win-amd64-3.9\Crypto\Random\Fortuna
    copying lib\Crypto\Random\Fortuna\SHAd256.py -> build\lib.win-amd64-3.9\Crypto\Random\Fortuna
    copying lib\Crypto\Random\Fortuna\__init__.py -> build\lib.win-amd64-3.9\Crypto\Random\Fortuna
    creating build\lib.win-amd64-3.9\Crypto\Random\OSRNG
    copying lib\Crypto\Random\OSRNG\fallback.py -> build\lib.win-amd64-3.9\Crypto\Random\OSRNG
    copying lib\Crypto\Random\OSRNG\nt.py -> build\lib.win-amd64-3.9\Crypto\Random\OSRNG
    copying lib\Crypto\Random\OSRNG\posix.py -> build\lib.win-amd64-3.9\Crypto\Random\OSRNG
    copying lib\Crypto\Random\OSRNG\rng_base.py -> build\lib.win-amd64-3.9\Crypto\Random\OSRNG
    copying lib\Crypto\Random\OSRNG\__init__.py -> build\lib.win-amd64-3.9\Crypto\Random\OSRNG
    creating build\lib.win-amd64-3.9\Crypto\SelfTest
    copying lib\Crypto\SelfTest\st_common.py -> build\lib.win-amd64-3.9\Crypto\SelfTest
    copying lib\Crypto\SelfTest\__init__.py -> build\lib.win-amd64-3.9\Crypto\SelfTest
    creating build\lib.win-amd64-3.9\Crypto\SelfTest\Cipher
    copying lib\Crypto\SelfTest\Cipher\common.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\Cipher
    copying lib\Crypto\SelfTest\Cipher\test_AES.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\Cipher
    copying lib\Crypto\SelfTest\Cipher\test_ARC2.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\Cipher
    copying lib\Crypto\SelfTest\Cipher\test_ARC4.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\Cipher
    copying lib\Crypto\SelfTest\Cipher\test_Blowfish.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\Cipher
    copying lib\Crypto\SelfTest\Cipher\test_CAST.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\Cipher
    copying lib\Crypto\SelfTest\Cipher\test_DES.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\Cipher
    copying lib\Crypto\SelfTest\Cipher\test_DES3.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\Cipher
    copying lib\Crypto\SelfTest\Cipher\test_pkcs1_15.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\Cipher
    copying lib\Crypto\SelfTest\Cipher\test_pkcs1_oaep.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\Cipher
    copying lib\Crypto\SelfTest\Cipher\test_XOR.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\Cipher
    copying lib\Crypto\SelfTest\Cipher\__init__.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\Cipher
    creating build\lib.win-amd64-3.9\Crypto\SelfTest\Hash
    copying lib\Crypto\SelfTest\Hash\common.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\Hash
    copying lib\Crypto\SelfTest\Hash\test_HMAC.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\Hash
    copying lib\Crypto\SelfTest\Hash\test_MD2.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\Hash
    copying lib\Crypto\SelfTest\Hash\test_MD4.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\Hash
    copying lib\Crypto\SelfTest\Hash\test_MD5.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\Hash
    copying lib\Crypto\SelfTest\Hash\test_RIPEMD.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\Hash
    copying lib\Crypto\SelfTest\Hash\test_SHA.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\Hash
    copying lib\Crypto\SelfTest\Hash\test_SHA224.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\Hash
    copying lib\Crypto\SelfTest\Hash\test_SHA256.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\Hash
    copying lib\Crypto\SelfTest\Hash\test_SHA384.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\Hash
    copying lib\Crypto\SelfTest\Hash\test_SHA512.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\Hash
    copying lib\Crypto\SelfTest\Hash\__init__.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\Hash
    creating build\lib.win-amd64-3.9\Crypto\SelfTest\Protocol
    copying lib\Crypto\SelfTest\Protocol\test_AllOrNothing.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\Protocol
    copying lib\Crypto\SelfTest\Protocol\test_chaffing.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\Protocol
    copying lib\Crypto\SelfTest\Protocol\test_KDF.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\Protocol
    copying lib\Crypto\SelfTest\Protocol\test_rfc1751.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\Protocol
    copying lib\Crypto\SelfTest\Protocol\__init__.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\Protocol
    creating build\lib.win-amd64-3.9\Crypto\SelfTest\PublicKey
    copying lib\Crypto\SelfTest\PublicKey\test_DSA.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\PublicKey
    copying lib\Crypto\SelfTest\PublicKey\test_ElGamal.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\PublicKey
    copying lib\Crypto\SelfTest\PublicKey\test_importKey.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\PublicKey
    copying lib\Crypto\SelfTest\PublicKey\test_RSA.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\PublicKey
    copying lib\Crypto\SelfTest\PublicKey\__init__.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\PublicKey
    creating build\lib.win-amd64-3.9\Crypto\SelfTest\Random
    copying lib\Crypto\SelfTest\Random\test_random.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\Random
    copying lib\Crypto\SelfTest\Random\test_rpoolcompat.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\Random
    copying lib\Crypto\SelfTest\Random\test__UserFriendlyRNG.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\Random
    copying lib\Crypto\SelfTest\Random\__init__.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\Random
    creating build\lib.win-amd64-3.9\Crypto\SelfTest\Random\Fortuna
    copying lib\Crypto\SelfTest\Random\Fortuna\test_FortunaAccumulator.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\Random\Fortuna
    copying lib\Crypto\SelfTest\Random\Fortuna\test_FortunaGenerator.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\Random\Fortuna
    copying lib\Crypto\SelfTest\Random\Fortuna\test_SHAd256.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\Random\Fortuna
    copying lib\Crypto\SelfTest\Random\Fortuna\__init__.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\Random\Fortuna
    creating build\lib.win-amd64-3.9\Crypto\SelfTest\Random\OSRNG
    copying lib\Crypto\SelfTest\Random\OSRNG\test_fallback.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\Random\OSRNG
    copying lib\Crypto\SelfTest\Random\OSRNG\test_generic.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\Random\OSRNG
    copying lib\Crypto\SelfTest\Random\OSRNG\test_nt.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\Random\OSRNG
    copying lib\Crypto\SelfTest\Random\OSRNG\test_posix.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\Random\OSRNG
    copying lib\Crypto\SelfTest\Random\OSRNG\test_winrandom.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\Random\OSRNG
    copying lib\Crypto\SelfTest\Random\OSRNG\__init__.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\Random\OSRNG
    creating build\lib.win-amd64-3.9\Crypto\SelfTest\Util
    copying lib\Crypto\SelfTest\Util\test_asn1.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\Util
    copying lib\Crypto\SelfTest\Util\test_Counter.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\Util
    copying lib\Crypto\SelfTest\Util\test_number.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\Util
    copying lib\Crypto\SelfTest\Util\test_winrandom.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\Util
    copying lib\Crypto\SelfTest\Util\__init__.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\Util
    creating build\lib.win-amd64-3.9\Crypto\SelfTest\Signature
    copying lib\Crypto\SelfTest\Signature\test_pkcs1_15.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\Signature
    copying lib\Crypto\SelfTest\Signature\test_pkcs1_pss.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\Signature
    copying lib\Crypto\SelfTest\Signature\__init__.py -> build\lib.win-amd64-3.9\Crypto\SelfTest\Signature
    creating build\lib.win-amd64-3.9\Crypto\Protocol
    copying lib\Crypto\Protocol\AllOrNothing.py -> build\lib.win-amd64-3.9\Crypto\Protocol
    copying lib\Crypto\Protocol\Chaffing.py -> build\lib.win-amd64-3.9\Crypto\Protocol
    copying lib\Crypto\Protocol\KDF.py -> build\lib.win-amd64-3.9\Crypto\Protocol
    copying lib\Crypto\Protocol\__init__.py -> build\lib.win-amd64-3.9\Crypto\Protocol
    creating build\lib.win-amd64-3.9\Crypto\PublicKey
    copying lib\Crypto\PublicKey\DSA.py -> build\lib.win-amd64-3.9\Crypto\PublicKey
    copying lib\Crypto\PublicKey\ElGamal.py -> build\lib.win-amd64-3.9\Crypto\PublicKey
    copying lib\Crypto\PublicKey\pubkey.py -> build\lib.win-amd64-3.9\Crypto\PublicKey
    copying lib\Crypto\PublicKey\RSA.py -> build\lib.win-amd64-3.9\Crypto\PublicKey
    copying lib\Crypto\PublicKey\_DSA.py -> build\lib.win-amd64-3.9\Crypto\PublicKey
    copying lib\Crypto\PublicKey\_RSA.py -> build\lib.win-amd64-3.9\Crypto\PublicKey
    copying lib\Crypto\PublicKey\_slowmath.py -> build\lib.win-amd64-3.9\Crypto\PublicKey
    copying lib\Crypto\PublicKey\__init__.py -> build\lib.win-amd64-3.9\Crypto\PublicKey
    creating build\lib.win-amd64-3.9\Crypto\Signature
    copying lib\Crypto\Signature\PKCS1_PSS.py -> build\lib.win-amd64-3.9\Crypto\Signature
    copying lib\Crypto\Signature\PKCS1_v1_5.py -> build\lib.win-amd64-3.9\Crypto\Signature
    copying lib\Crypto\Signature\__init__.py -> build\lib.win-amd64-3.9\Crypto\Signature
    Skipping optional fixer: buffer
    Skipping optional fixer: idioms
    Skipping optional fixer: set_literal
    Skipping optional fixer: ws_comma
    running build_ext
    warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.
    building 'Crypto.Random.OSRNG.winrandom' extension
    error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\program files\python39\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\HP\\AppData\\Local\\Temp\\pip-install-1vrqy3v9\\pycrypto_59b0ecffdd5a4946a71289a4ebf87110\\setup.py'"'"'; __file__='"'"'C:\\Users\\HP\\AppData\\Local\\Temp\\pip-install-1vrqy3v9\\pycrypto_59b0ecffdd5a4946a71289a4ebf87110\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\HP\AppData\Local\Temp\pip-record-ax5xvq3a\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\HP\AppData\Roaming\Python\Python39\Include\pycrypto' Check the logs for full command output.```

Nksama avatar Jun 13 '21 12:06 Nksama

try to install wheel: pip install wheel

adaamz avatar Jun 14 '21 06:06 adaamz

@adaamz same error


Traceback (most recent call last):
  File "D:\python codes\scripts\megdl.py", line 1, in <module>
    from mega import Mega
  File "C:\Users\HP\AppData\Roaming\Python\Python39\site-packages\mega\__init__.py", line 1, in <module>
    from .mega import Mega  # noqa
  File "C:\Users\HP\AppData\Roaming\Python\Python39\site-packages\mega\mega.py", line 8, in <module>
    from Crypto.Cipher import AES
ModuleNotFoundError: No module named 'Crypto'

Nksama avatar Jun 14 '21 07:06 Nksama

This worked for me:

from mega.mega import Mega

rcolman05 avatar Oct 04 '22 13:10 rcolman05

This worked for me:

from mega.mega import Mega

This didnt work for me

thomasmuus avatar Oct 21 '22 13:10 thomasmuus

What output do you get for pip install mega.py?

adaamz avatar Oct 21 '22 17:10 adaamz

What output do you get for pip install mega.py?

Collecting mega.py Using cached mega.py-1.0.8-py2.py3-none-any.whl (19 kB) Requirement already satisfied: requests>=0.10 in c:\python311\lib\site-packages (from mega.py) (2.31.0) Requirement already satisfied: pycryptodome<4.0.0,>=3.9.6 in c:\python311\lib\site-packages (from mega.py) (3.19.0) Requirement already satisfied: pathlib==1.0.1 in c:\python311\lib\site-packages (from mega.py) (1.0.1) Requirement already satisfied: tenacity<6.0.0,>=5.1.5 in c:\python311\lib\site-packages (from mega.py) (5.1.5) Requirement already satisfied: charset-normalizer<4,>=2 in c:\python311\lib\site-packages (from requests>=0.10->mega.py) (3.3.0) Requirement already satisfied: idna<4,>=2.5 in c:\python311\lib\site-packages (from requests>=0.10->mega.py) (3.4) Requirement already satisfied: urllib3<3,>=1.21.1 in c:\python311\lib\site-packages (from requests>=0.10->mega.py) (2.0.6) Requirement already satisfied: certifi>=2017.4.17 in c:\python311\lib\site-packages (from requests>=0.10->mega.py) (2023.7.22) Requirement already satisfied: six>=1.9.0 in c:\python311\lib\site-packages (from tenacity<6.0.0,>=5.1.5->mega.py) (1.16.0) Installing collected packages: mega.py Successfully installed mega.py-1.0.8

Murkless avatar Oct 04 '23 20:10 Murkless

@Murkless OK, and where is Python finding user packages?

python3 -m site --user-site

note: you must run this command in the same interpreter you are running that import mega

adaamz avatar Oct 05 '23 07:10 adaamz

@Murkless OK, and where is Python finding user packages?

python3 -m site --user-site

note: you must run this command in the same interpreter you are running that import mega

C:\Users\xtobo\AppData\Roaming\Python\Python311\site-packages

So there is a problem. I no longer have this issue, because of which this thread was started, but now I asyncio can't understand lines from Mega.package. BTW, I don't know, what fixed previous bug. Also I tried to google the new issue, but no results

Traceback (most recent call last): File "C:\Users\xtobo\PycharmProjects\pythonProject3\main.py", line 2, in <module> from mega.mega import Mega File "C:\Python311\Lib\site-packages\mega\__init__.py", line 1, in <module> from .mega import Mega # noqa ^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python311\Lib\site-packages\mega\mega.py", line 18, in <module> from tenacity import retry, wait_exponential, retry_if_exception_type File "C:\Python311\Lib\site-packages\tenacity\__init__.py", line 451, in <module> from tenacity._asyncio import AsyncRetrying File "C:\Python311\Lib\site-packages\tenacity\_asyncio.py", line 33, in <module> class AsyncRetrying(BaseRetrying): File "C:\Python311\Lib\site-packages\tenacity\_asyncio.py", line 41, in AsyncRetrying @asyncio.coroutine ^^^^^^^^^^^^^^^^^ AttributeError: module 'asyncio' has no attribute 'coroutine'. Did you mean: 'coroutines'? I have tenacity installed and up to date, same with asyncio.

Murkless avatar Oct 05 '23 15:10 Murkless

@Murkless I think that is breaking change in Python 3.11 and this library is only compatible with older Python versions. tbh I'm not sure which ones :) but I have been using it on Python 3.9, also 3.10 might be ok.

adaamz avatar Oct 05 '23 16:10 adaamz