M2crypto python install error

Hello, I am trying to install pip install adb on windows 10 and python 2.7. Downloaded openssl from https://slproweb.com/products/Win32OpenSSL.html (both 32 and 64bits version) and when installing,...

Hello,

I am trying to install pip install adb on windows 10 and python 2.7. Downloaded openssl from https://slproweb.com/products/Win32OpenSSL.html (both 32 and 64bits version) and when installing, m2crypto fails to compile:

c:Python27Scripts> pip.exe install adb
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Collecting adb
  Using cached https://files.pythonhosted.org/packages/39/c0/715acc4e0c37a6a93f73daf8536baea94ac9fb6539ef1fd9c42205e1c3fa/adb-1.3.0-py2-none-any.whl
Collecting M2Crypto<=0.26.4,>=0.21.1 (from adb)
  Using cached https://files.pythonhosted.org/packages/dc/5b/1ff81e2dda5d2dee62d1c26f5df91b1ea3a560b6611cea67e6c55d1f2e15/M2Crypto-0.26.4.tar.gz
Requirement already satisfied: libusb1>=1.0.16 in c:python27libsite-packages (from adb) (1.7)
Requirement already satisfied: typing in c:python27libsite-packages (from M2Crypto<=0.26.4,>=0.21.1->adb) (3.6.6)
Installing collected packages: M2Crypto, adb
  Running setup.py install for M2Crypto ... error
    Complete output from command c:python27python.exe -u -c "import setuptools, tokenize;__file__='c:\users\xxx\appdata\local\temp\pip-install-vc6z5t\M2Crypto\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record c:usersxxxappdatalocaltemppip-record-aywxhwinstall-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    copying M2CryptoASN1.py -> buildlib.win-amd64-2.7M2Crypto
    copying M2CryptoAuthCookie.py -> buildlib.win-amd64-2.7M2Crypto
    copying M2CryptoBIO.py -> buildlib.win-amd64-2.7M2Crypto
    copying M2CryptoBN.py -> buildlib.win-amd64-2.7M2Crypto
    copying M2Cryptocallback.py -> buildlib.win-amd64-2.7M2Crypto
    copying M2CryptoDH.py -> buildlib.win-amd64-2.7M2Crypto
    copying M2CryptoDSA.py -> buildlib.win-amd64-2.7M2Crypto
    copying M2CryptoEC.py -> buildlib.win-amd64-2.7M2Crypto
    copying M2CryptoEngine.py -> buildlib.win-amd64-2.7M2Crypto
    copying M2CryptoErr.py -> buildlib.win-amd64-2.7M2Crypto
    copying M2CryptoEVP.py -> buildlib.win-amd64-2.7M2Crypto
    copying M2Cryptoftpslib.py -> buildlib.win-amd64-2.7M2Crypto
    copying M2Cryptohttpslib.py -> buildlib.win-amd64-2.7M2Crypto
    copying M2Cryptom2.py -> buildlib.win-amd64-2.7M2Crypto
    copying M2Cryptom2crypto.py -> buildlib.win-amd64-2.7M2Crypto
    copying M2Cryptom2urllib.py -> buildlib.win-amd64-2.7M2Crypto
    copying M2Cryptom2urllib2.py -> buildlib.win-amd64-2.7M2Crypto
    copying M2Cryptom2xmlrpclib.py -> buildlib.win-amd64-2.7M2Crypto
    copying M2CryptoRand.py -> buildlib.win-amd64-2.7M2Crypto
    copying M2CryptoRC4.py -> buildlib.win-amd64-2.7M2Crypto
    copying M2CryptoRSA.py -> buildlib.win-amd64-2.7M2Crypto
    copying M2Cryptosix.py -> buildlib.win-amd64-2.7M2Crypto
    copying M2CryptoSMIME.py -> buildlib.win-amd64-2.7M2Crypto
    copying M2Cryptothreading.py -> buildlib.win-amd64-2.7M2Crypto
    copying M2Cryptoutil.py -> buildlib.win-amd64-2.7M2Crypto
    copying M2CryptoX509.py -> buildlib.win-amd64-2.7M2Crypto
    copying M2Crypto__init__.py -> buildlib.win-amd64-2.7M2Crypto
    creating buildlib.win-amd64-2.7M2CryptoPGP
    copying M2CryptoPGPconstants.py -> buildlib.win-amd64-2.7M2CryptoPGP
    copying M2CryptoPGPpacket.py -> buildlib.win-amd64-2.7M2CryptoPGP
    copying M2CryptoPGPPublicKey.py -> buildlib.win-amd64-2.7M2CryptoPGP
    copying M2CryptoPGPPublicKeyRing.py -> buildlib.win-amd64-2.7M2CryptoPGP
    copying M2CryptoPGPRSA.py -> buildlib.win-amd64-2.7M2CryptoPGP
    copying M2CryptoPGP__init__.py -> buildlib.win-amd64-2.7M2CryptoPGP
    creating buildlib.win-amd64-2.7M2CryptoSSL
    copying M2CryptoSSLcb.py -> buildlib.win-amd64-2.7M2CryptoSSL
    copying M2CryptoSSLChecker.py -> buildlib.win-amd64-2.7M2CryptoSSL
    copying M2CryptoSSLCipher.py -> buildlib.win-amd64-2.7M2CryptoSSL
    copying M2CryptoSSLConnection.py -> buildlib.win-amd64-2.7M2CryptoSSL
    copying M2CryptoSSLContext.py -> buildlib.win-amd64-2.7M2CryptoSSL
    copying M2CryptoSSLSession.py -> buildlib.win-amd64-2.7M2CryptoSSL
    copying M2CryptoSSLSSLServer.py -> buildlib.win-amd64-2.7M2CryptoSSL
    copying M2CryptoSSLssl_dispatcher.py -> buildlib.win-amd64-2.7M2CryptoSSL
    copying M2CryptoSSLtimeout.py -> buildlib.win-amd64-2.7M2CryptoSSL
    copying M2CryptoSSLTwistedProtocolWrapper.py -> buildlib.win-amd64-2.7M2CryptoSSL
    copying M2CryptoSSL__init__.py -> buildlib.win-amd64-2.7M2CryptoSSL
    running build_ext
    building 'M2Crypto._m2crypto' extension
    creating buildtemp.win-amd64-2.7
    creating buildtemp.win-amd64-2.7Release
    creating buildtemp.win-amd64-2.7ReleaseSWIG
    C:UsersxxxAppDataLocalProgramsCommonMicrosoftVisual C++ for Python9.0VCBinamd64cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic:python27include -Ic:python27PC "-IC:Program FilesOpenSSLinclude" -Ic:usersxxxappdatalocaltemppip-install-vc6z5tM2CryptoSWIG /TcSWIG/_m2crypto_wrap.c /Fobuildtemp.win-amd64-2.7ReleaseSWIG/_m2crypto_wrap.obj -DTHREADING -D_CRT_SECURE_NO_WARNINGS
    _m2crypto_wrap.c
    SWIG/_m2crypto_wrap.c(3550) : warning C4068: unknown pragma
    SWIG/_m2crypto_wrap.c(3551) : warning C4068: unknown pragma
    SWIG/_m2crypto_wrap.c(4395) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data
    SWIG/_m2crypto_wrap.c(4466) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data
    SWIG/_m2crypto_wrap.c(4586) : error C2275: 'PyObject' : illegal use of this type as an expression
            c:python27includeobject.h(108) : see declaration of 'PyObject'
    SWIG/_m2crypto_wrap.c(4586) : error C2065: 'x509mod' : undeclared identifier
    SWIG/_m2crypto_wrap.c(4587) : error C2065: 'x509mod' : undeclared identifier
    SWIG/_m2crypto_wrap.c(4587) : warning C4047: 'function' : 'PyObject *' differs in levels of indirection from 'int'
    SWIG/_m2crypto_wrap.c(4587) : warning C4024: 'PyObject_GetAttrString' : different types for formal and actual parameter 1
    SWIG/_m2crypto_wrap.c(4742) : warning C4244: 'return' : conversion from 'Py_ssize_t' to 'int', possible loss of data
    SWIG/_m2crypto_wrap.c(5077) : error C2275: 'BIO' : illegal use of this type as an expression
            C:Program FilesOpenSSLincludeopenssl/ossl_typ.h(79) : see declaration of 'BIO'
    SWIG/_m2crypto_wrap.c(5077) : error C2065: 'bio' : undeclared identifier
    SWIG/_m2crypto_wrap.c(5079) : error C2065: 'bio' : undeclared identifier
    SWIG/_m2crypto_wrap.c(5079) : warning C4047: '==' : 'int' differs in levels of indirection from 'void *'
    SWIG/_m2crypto_wrap.c(5098) : error C2065: 'bio' : undeclared identifier
    SWIG/_m2crypto_wrap.c(5098) : warning C4047: 'return' : 'BIO *' differs in levels of indirection from 'int'
    SWIG/_m2crypto_wrap.c(5191) : warning C4267: 'return' : conversion from 'size_t' to 'int', possible loss of data
    SWIG/_m2crypto_wrap.c(5256) : warning C4267: 'function' : conversion from 'size_t' to 'long', possible loss of data
    SWIG/_m2crypto_wrap.c(5328) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data
    SWIG/_m2crypto_wrap.c(5350) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data
    SWIG/_m2crypto_wrap.c(7963) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data
    SWIG/_m2crypto_wrap.c(8006) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data
    SWIG/_m2crypto_wrap.c(8435) : error C2143: syntax error : missing ';' before 'const'
    SWIG/_m2crypto_wrap.c(8436) : error C2065: 'tmp_str' : undeclared identifier
    SWIG/_m2crypto_wrap.c(8436) : warning C4047: 'function' : 'const unsigned char **' differs in levels of indirection from 'int *'
    SWIG/_m2crypto_wrap.c(8436) : warning C4024: 'd2i_SEQ_CERT' : different types for formal and actual parameter 2
    SWIG/_m2crypto_wrap.c(8436) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'long', possible loss of data
    SWIG/_m2crypto_wrap.c(8445) : error C2143: syntax error : missing '{' before '*'
    SWIG/_m2crypto_wrap.c(8467) : warning C4133: 'return' : incompatible types - from 'PyObject *' to 'int *'
    SWIG/_m2crypto_wrap.c(8621) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data
    SWIG/_m2crypto_wrap.c(8683) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data
    SWIG/_m2crypto_wrap.c(8812) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'long', possible loss of data
    SWIG/_m2crypto_wrap.c(8838) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'long', possible loss of data
    SWIG/_m2crypto_wrap.c(9267) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'long', possible loss of data
    SWIG/_m2crypto_wrap.c(9293) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'long', possible loss of data
    SWIG/_m2crypto_wrap.c(9489) : error C2037: left of 'num' specifies undefined struct/union 'stack_st'
    SWIG/_m2crypto_wrap.c(9509) : error C2037: left of 'num' specifies undefined struct/union 'stack_st'
    SWIG/_m2crypto_wrap.c(9538) : error C2037: left of 'data' specifies undefined struct/union 'stack_st'
    SWIG/_m2crypto_wrap.c(9558) : error C2037: left of 'data' specifies undefined struct/union 'stack_st'
    SWIG/_m2crypto_wrap.c(9587) : error C2037: left of 'sorted' specifies undefined struct/union 'stack_st'
    SWIG/_m2crypto_wrap.c(9607) : error C2037: left of 'sorted' specifies undefined struct/union 'stack_st'
    SWIG/_m2crypto_wrap.c(9636) : error C2037: left of 'num_alloc' specifies undefined struct/union 'stack_st'
    SWIG/_m2crypto_wrap.c(9656) : error C2037: left of 'num_alloc' specifies undefined struct/union 'stack_st'
    SWIG/_m2crypto_wrap.c(9684) : error C2037: left of 'comp' specifies undefined struct/union 'stack_st'
    SWIG/_m2crypto_wrap.c(9704) : error C2037: left of 'comp' specifies undefined struct/union 'stack_st'
    SWIG/_m2crypto_wrap.c(9716) : error C2027: use of undefined type 'stack_st'
            C:Program FilesOpenSSLincludeopenssl/stack.h(17) : see declaration of 'stack_st'
    SWIG/_m2crypto_wrap.c(9947) : warning C4090: 'function' : different 'const' qualifiers
    SWIG/_m2crypto_wrap.c(9947) : warning C4028: formal parameter 1 different from declaration
    SWIG/_m2crypto_wrap.c(10350) : error C2037: left of 'stack' specifies undefined struct/union 'stack_st_OPENSSL_STRING'
    SWIG/_m2crypto_wrap.c(10370) : error C2037: left of 'stack' specifies undefined struct/union 'stack_st_OPENSSL_STRING'
    SWIG/_m2crypto_wrap.c(10382) : error C2027: use of undefined type 'stack_st_OPENSSL_STRING'
            C:Program FilesOpenSSLincludeopenssl/safestack.h(159) : see declaration of 'stack_st_OPENSSL_STRING'
    SWIG/_m2crypto_wrap.c(10430) : error C2037: left of 'stack' specifies undefined struct/union 'stack_st_OPENSSL_BLOCK'
    SWIG/_m2crypto_wrap.c(10450) : error C2037: left of 'stack' specifies undefined struct/union 'stack_st_OPENSSL_BLOCK'
    SWIG/_m2crypto_wrap.c(10462) : error C2027: use of undefined type 'stack_st_OPENSSL_BLOCK'
            C:Program FilesOpenSSLincludeopenssl/safestack.h(167) : see declaration of 'stack_st_OPENSSL_BLOCK'
    SWIG/_m2crypto_wrap.c(19168) : warning C4013: 'sslv3_method' undefined; assuming extern returning int
    SWIG/_m2crypto_wrap.c(22567) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data
    SWIG/_m2crypto_wrap.c(25155) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data
    error: command 'C:\Users\xxx\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe' failed with exit status 2

    ----------------------------------------
Command "c:python27python.exe -u -c "import setuptools, tokenize;__file__='c:\users\xxx\appdata\local\temp\pip-install-vc6z5t\M2Crypto\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record c:usersxxxappdatalocaltemppip-record-aywxhwinstall-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:usersxxxappdatalocaltemppip-install-vc6z5tM2Crypto

What am i missing?
Thanks!

Содержание

  1. pip install -U cuckoo fails at m2crypto (SWIG installed) #1705
  2. Comments
  3. Footer
  4. Installing M2Crypto Python Library on Windows Machine for Certificate Authentication
  5. Best Answer
  6. Comments
  7. M2cryoto error Linux #1223
  8. Comments
  9. benjaminrigaud / Swig generated code

pip install -U cuckoo fails at m2crypto (SWIG installed) #1705

When installing Cuckoo within venv, I receive an error message consistently which from hunting through previous bug queries and Google seems to suggest the lack of SWIG, which I have installed as per the installation guide (sudo apt-get install swig).

First error I see is Failed building wheel for m2crypto (which is then followed by Running setup.py clean for m2crypto)

Installer then quits with

error: command ‘x86_64-linux-gnu-gcc’ failed with exit status 1

Command «/root/venv/bin/python2 -u -c «import setuptools, tokenize;file=’/tmp/pip-build-x_l1zN/m2crypto/setup.py’;f=getattr(tokenize, ‘open’, open)(file);code=f.read().replace(‘rn’, ‘n’);f.close();exec(compile(code, file, ‘exec’))» install —record /tmp/pip-xhU8pM-record/install-record.txt —single-version-externally-managed —compile —install-headers /root/venv/include/site/python2.7/m2crypto» failed with error code 1 in /tmp/pip-build-x_l1zN/m2crypto/

Anticipate it not being a bug, but I have installed the dependencies and followed the guidance (double checked), and would expect the pip installation to therefore work OK.

The text was updated successfully, but these errors were encountered:

Note I have tried to cater for non installed dependencies and have apt-get’d build-essential libssl-dev libffi-dev python-dev scholarly cryptopgraphy libjpeg-dev zliblg-dev swig

I have updated PIP and Python is version 2.7.13

I simply installed it as follows. Python is the same version as you.

Thanks for the comment hakawati. I have tried both commands to be sure, and swig is already installed and the most current version. m2crypto generates a very similar error and exits (although I had to leave the machine I was in, so do not have the full error to hand).

Interestingly, I exited venv to see whether installing in base system made any difference and instead of trying to install m2crypto it confirmed it was already present, when though I tried to reload
virtualenv venv I get a load of Python errors, so I am now of a view that that is the source of the issue.

Will do some more work and revert.

I am having the same output as @25zerotwo here.
System configuration is the following:

  • Debian 9 x64 up-to-date
  • python 2.7.13
  • virtualenv 15.0.1
  • pip 9.0.1
  • swig 3.0.10

I checked and double checked the installation guide without changes.

So if trying virtualenv venv I get

# virtualenv venv
Running virtualenv with interpreter /usr/bin/python2
New python executable in /root/venv/bin/python2
Not overwriting existing python script /root/venv/bin/python (you must use /root/venv/bin/python2)
Installing setuptools, pkg_resources, pip, wheel. done.

Fairly sure it is virtuaenv that is the root cause of the issues we are seeing, I can pip install -U Cuckoo with no trouble at all.

Although it should work, please try to install a later version (atm that’d be pip install cuckoo==2.0.4a3 ). Since the 2.0.3 release we’ve got rid of requiring m2crypto by default. It’s barely used anyway.
Once we release a 2.0.4 version m2crypto will be completely optional.

In the end I got lazy and just installed outside of virtualenv which worked. But I’ll give that a go.

Hi,
use pip install m2crypto. it will install the newest version of m2crypto

THis works well, Thanks a lot

pip install m2crypto

What’s the problem? I installed swig on FreeBSD.

© 2023 GitHub, Inc.

You can’t perform that action at this time.

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.

Источник

Installing M2Crypto Python Library on Windows Machine for Certificate Authentication

I’m running into a few errors trying to install M2Crypto on a windows machine. I’ve done a fair bit of research and it seems to be a common problem with the library.

Wondering if anyone here has experienced similar issues and resolved them? I’m using Win10(64 bit), Python 3.8 through Pycharm. Pip 20.1.1. I’ve tried to install both M2Crypto and M2CryptoWin64 but I’ve had no luck.

Best Answer

Some builds for m2crypto for specific versions of Python are available from their CI: https://ci.appveyor.com/project/m2crypto/m2crypto/history. Try selecting a version, selecting a job that matches your Python version, then going to the «Artifacts» tab and downloading an installer. To install a .whl file, see step 11 of my build tutorial below.

I have also attached the m2crypto module that I have built on Windows 10 x64, Python 3.8.1. It should work on any x64-based version of Windows with any version of Python 3.8.X. M2Crypto-0.35.2.win-amd64-py3.8.zip

However, if you are unable to find a build that matches your Python version and system type and architecture, you may need to manually build m2crypto. I adapted the build steps from their CI build scripts: https://gitlab.com/m2crypto/m2crypto/blob/master/appveyor.yml. I built the module by doing the following:

  1. Install the latest Build Tools for Visual Studio 2019. See https://visualstudio.microsoft.com/downloads/ under «All Downloads» -> «Tools for Visual Studio 2019». This direct link was active as of this writing: https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools&rel=16
  2. In the installer, select «C++ Build Tools», install, and reboot if necessary.
  3. Install the latest full (not Light) OpenSSL for your architecture (Win64/Win32). Current version as of this writing is 1.1.1d. Make note of the directory to which you install OpenSSL. https://slproweb.com/products/Win32OpenSSL.html
  4. In PowerShell, install the Chocolatey package manager. I used this command from their website: Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString(‘https://chocolatey.org/install.ps1’))
  5. Install swig with Chocolatey (in PowerShell). choco install -r -y swig
  6. Install the pywin32 dependency. Run pip install pywin32. If you have problems, try first running pip install wheel. To get pip to target a specific Python installation, try launching it using py -[version] -m pip install [module]. Note: you may need to use an elevated (administrator) PowerShell to install Python modules.
  7. Get the latest m2crypto code. If you have git installed, run git clone https://gitlab.com/m2crypto/m2crypto. Otherwise, download and extract the code from GitLab: https://gitlab.com/m2crypto/m2crypto/-/archive/master/m2crypto-master.zip
  8. Use cd to change into the directory m2crypto was cloned/extracted to.
  9. Assuming python launches your desired Python interpreter version, run python setup.py build —openssl=»C:Program FilesOpenSSL-Win64″ —bundledlls, replacing C:Program FilesOpenSSL-Win64 with the directory to which you installed OpenSSL. (On some systems you can use the py launcher to specify a Python version to use, run py -h for more information.)
  10. Generate the installable files. python.exe setup.py bdist_wheel bdist_wininst bdist_msi.
  11. Install the module. cd into the dist directory and run pip install M2Crypto-0.35.2-cp38-cp38-win_amd64.whl, replacing the filename with the generated .whl file. If you have problems, try first running pip install wheel. To get pip to target a specific Python installation, try launching it using py -[version] -m pip install [module]. Alternatively, you can run the generated .exe or .msi installer. Note: you may need to use an elevated (administrator) PowerShell to install Python modules.

Try installing the attached library

Do you know how to change the path location when installing it? I want to put it in a venv.

Don’t worry, figured it out! Thanks again for your help mate

I’ve installed M2Crypto successfully but am now getting an error:

File «C:UsersUSERNAMEDesktopPATHanaplan_auth.py», line 13, in
from M2Crypto import EVP, RSA
File «C:UsersUSERNAMEDesktopPATHvenvlibsite-packagesM2Crypto__init__.py», line 22, in
import __m2crypto
ModuleNotFoundError: No module named ‘__m2crypto’

Have you ran into this error before? I’ve seen a few Google results with the same error for different things? Once I have this all setup I think I’ll create a wiki article for setting up Certificate Authentication on Windows systems.

I had the same issue with my virtual env

Unfortunately, I had to uninstall the whole python instance, get rid of the old M2Crypto library and then reinstall everything with the attached library.

I tried to uninstall and re-install but that hasn’t worked. I’m still getting the error:

File «C:UsersPATHTOFILESanaplan_auth.py», line 13, in
from M2Crypto import EVP, RSA
File «C:UsersPATHTOFILES\venvlibsite-packagesM2Crypto__init__.py», line 22, in
import __m2crypto
ModuleNotFoundError: No module named ‘__m2crypto’

But __m2crypto.py is in the same directory

You have to edit the script to say —
‘Import M2Crypto’

Strange, now I’m getting:

File «C:UsersSamDesktopData_Integration_Anaplananaplan_auth.py», line 13, in
from M2Crypto import EVP, RSA
File «C:UsersSamDesktopData_Integration_Anaplanvenvlibsite-packagesM2Crypto__init__.py», line 23, in
import m2
ModuleNotFoundError: No module named ‘m2’

There is an m2.py file in the directory though.

Hello Sam — I am running the same issue. Can you please specify steps help you to resolve this issue?

I haven’t resolved the issue yet. I was hoping that someone from Anaplan or the community might know.

I was going to try and revert to an older version of Python, maybe 3.5 or 3.7 and try a stable version of M2Crypto for that.

If you do happen to resolve the issue please let me know! 🙂

@anirudh @mendaye — I think I found the solution on Github: https://github.com/iOSForensics/pymobiledevice/issues/25 (the comment by user tech234a). Anaplan community should consider putting this information somewhere with better visibility.

Some builds for m2crypto for specific versions of Python are available from their CI: https://ci.appveyor.com/project/m2crypto/m2crypto/history. Try selecting a version, selecting a job that matches your Python version, then going to the «Artifacts» tab and downloading an installer. To install a .whl file, see step 11 of my build tutorial below.

I have also attached the m2crypto module that I have built on Windows 10 x64, Python 3.8.1. It should work on any x64-based version of Windows with any version of Python 3.8.X. M2Crypto-0.35.2.win-amd64-py3.8.zip

Источник

M2cryoto error Linux #1223

Hey guys, I’m trying to figure out why Empire isn’t working for my kali Linux machine. I have both python2, and python3 installed, I did the “pip install -r requirements” no problems and did the install.sh.

After install and running ./empire it’s giving me the error M2crypto module «No module name __m2crypto,

After that when when trying to do “pip2 install m2crypto”, and «pip3 install m2crypto» it says its satisifed for both.
I’ve also tried deleting the entire empire folder and downloading from git again, and nothing.

Error:
Traceback (most recent call last):
File «./empire», line 13, in
from lib.common import empire, helpers
File «/root/Tricks/Empire/lib/common/empire.py», line 34, in
import agents
File «/root/Tricks/Empire/lib/common/agents.py», line 68, in
import encryption
File «/root/Tricks/Empire/lib/common/encryption.py», line 27, in
import M2Crypto
File «/usr/local/lib/python2.7/dist-packages/M2Crypto/init.py», line 22, in
import _m2crypto
File «/usr/local/lib/python2.7/dist-packages/M2Crypto/_m2crypto.py», line 17, in
__m2crypto = swig_import_helper()
File «/usr/local/lib/python2.7/dist-packages/M2Crypto/_m2crypto.py», line 16, in swig_import_helper
return importlib.import_module(‘__m2crypto’)
File «/usr/lib/python2.7/importlib/init.py», line 37, in import_module
import(name)
ImportError: No module named __m2crypto

Anyone have any ideas.

The text was updated successfully, but these errors were encountered:

Источник

benjaminrigaud / Swig generated code

This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters

mkvirtualenv -p

/pypy-2.5.1-linux64/bin/pypy pypy-m2crypto

pip install M2Crypto==0.22.3
touch empty
python -c » from M2Crypto import m2; f = open(’empty’, ‘rb’); m2.bio_new_fp(f, 0) «

This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters

Fatal error in cpyext, CPython compatibility layer, calling PyFile_AsFile
Either report a bug or consider not using this particular extension
RPython traceback:
File «pypy_module_cpyext_pyobject.c», line 490, in make_ref
File «rpython_rtyper_lltypesystem_rordereddict.c», line 423, in ll_dict_getitem__dicttablePtr_objectPtr
Segmentation fault (core dumped)

This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters

Источник


package python-m2crypto 0.24.0-1 failed to install/upgrade: subprocess installed post-installation script returned error exit status 1

Bug #1766917 reported by
Change Zhong
on 2018-04-25

This bug affects 1 person

Affects Status Importance Assigned to Milestone


m2crypto (Ubuntu)

Expired

Undecided


Unassigned

Bug Description

After I input «sudo apt-get install python-m2crypto» something appear like this:

Reading package lists… Done
Building dependency tree
Reading state information… Done
python-m2crypto is already the newest version (0.24.0-1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up python-m2crypto (0.24.0-1) …
Traceback (most recent call last):
  File «/usr/bin/pycompile», line 35, in <module>
    from debpython.version import SUPPORTED, debsorted, vrepr,
  File «/usr/share/python/debpython/version.py», line 24, in <module>
    from ConfigParser import SafeConfigParser
ImportError: No module named ‘ConfigParser’
dpkg: error processing package python-m2crypto (—configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 python-m2crypto
E: Sub-process /usr/bin/dpkg returned an error code (1)

ProblemType: Package
DistroRelease: Ubuntu 16.10
Package: python-m2crypto 0.24.0-1
ProcVersionSignature: Ubuntu 4.8.0-59.64-generic 4.8.17
Uname: Linux 4.8.0-59-generic x86_64
ApportVersion: 2.20.3-0ubuntu8.7
AptOrdering:
 python-m2crypto:amd64: Install
 NULL: ConfigurePending
Architecture: amd64
Date: Wed Apr 25 19:00:20 2018
ErrorMessage: subprocess installed post-installation script returned error exit status 1
InstallationDate: Installed on 2016-07-02 (661 days ago)
InstallationMedia: Ubuntu 16.04 LTS «Xenial Xerus» — Release amd64 (20160420.1)
RelatedPackageVersions:
 dpkg 1.18.10ubuntu1.1
 apt 1.3.5
SourcePackage: m2crypto
Title: package python-m2crypto 0.24.0-1 failed to install/upgrade: subprocess installed post-installation script returned error exit status 1
UpgradeStatus: Upgraded to yakkety on 2016-11-07 (534 days ago)

Понравилась статья? Поделить с друзьями:
  • M2030dn kyocera ошибка c4000
  • M2 wear ошибка подключения
  • M2 genie error что означает
  • M2 genie error press f1 to run setup как исправить
  • M2 genie error msi что значит