0

I am new in PyInstaller. I have got a program on Python and would like to convert it into stand-alone executable under Ubuntu. I try:

pyinstaller -y --clean --hidden-import=Crypto.Util._counter pycrypter.py

But when I execute the result file:

cd dist/pycrypter
./pycrypter

I have a following error:

Traceback (most recent call last):
  File "", line 3, in 
  File "/usr/local/lib/python2.7/dist-packages/PyInstaller/loader/pyi_importers.py", line 270, in load_module
    exec(bytecode, module.__dict__)
  File "/home/fomalhaut/Development/python/pycrypter/build/pycrypter/out00-PYZ.pyz/models", line 1, in 
  File "/usr/local/lib/python2.7/dist-packages/PyInstaller/loader/pyi_importers.py", line 270, in load_module
    exec(bytecode, module.__dict__)
  File "/home/fomalhaut/Development/python/pycrypter/build/pycrypter/out00-PYZ.pyz/models.PyCrypter", line 3, in 
  File "/usr/local/lib/python2.7/dist-packages/PyInstaller/loader/pyi_importers.py", line 270, in load_module
    exec(bytecode, module.__dict__)
  File "/home/fomalhaut/Development/python/pycrypter/build/pycrypter/out00-PYZ.pyz/Crypto.PublicKey.RSA", line 78, in 
  File "/usr/local/lib/python2.7/dist-packages/PyInstaller/loader/pyi_importers.py", line 270, in load_module
    exec(bytecode, module.__dict__)
  File "/home/fomalhaut/Development/python/pycrypter/build/pycrypter/out00-PYZ.pyz/Crypto.Random", line 29, in 
  File "/usr/local/lib/python2.7/dist-packages/PyInstaller/loader/pyi_importers.py", line 270, in load_module
    exec(bytecode, module.__dict__)
  File "/home/fomalhaut/Development/python/pycrypter/build/pycrypter/out00-PYZ.pyz/Crypto.Random._UserFriendlyRNG", line 38, in 
  File "/usr/local/lib/python2.7/dist-packages/PyInstaller/loader/pyi_importers.py", line 270, in load_module
    exec(bytecode, module.__dict__)
  File "/home/fomalhaut/Development/python/pycrypter/build/pycrypter/out00-PYZ.pyz/Crypto.Random.Fortuna.FortunaAccumulator", line 39, in 
  File "/usr/local/lib/python2.7/dist-packages/PyInstaller/loader/pyi_importers.py", line 270, in load_module
    exec(bytecode, module.__dict__)
  File "/home/fomalhaut/Development/python/pycrypter/build/pycrypter/out00-PYZ.pyz/Crypto.Random.Fortuna.FortunaGenerator", line 35, in 
  File "/usr/local/lib/python2.7/dist-packages/PyInstaller/loader/pyi_importers.py", line 270, in load_module
    exec(bytecode, module.__dict__)
  File "/home/fomalhaut/Development/python/pycrypter/build/pycrypter/out00-PYZ.pyz/Crypto.Util.Counter", line 59, in 
ImportError: cannot import name _counter

How to convert my program correctly via PyInstaller?

Bhargav Rao
  • 50,140
  • 28
  • 121
  • 140
Fomalhaut
  • 8,590
  • 8
  • 51
  • 95
  • I think 'import name _counter' is the reason for error. – Maham Dec 27 '14 at 14:04
  • Is this program running fine when you execute it from terminal? – Maham Dec 27 '14 at 14:05
  • Yes, the program before converting works fine! – Fomalhaut Dec 27 '14 at 14:09
  • Put the file 'name_counter' in '/usr/local/lib/python2.7/dist-packages/PyInstaller/loader' directory. Hope it helps ! – Maham Dec 27 '14 at 14:15
  • Actually I've got '/usr/lib/python2.7/dist-packages/Crypto/Util/_counter.x86_64-linux-gnu.so' instead of '_counter.py'. I tried to copy it into '/usr/local/lib/python2.7/dist-packages/PyInstaller/loader', but it didn't help. – Fomalhaut Dec 27 '14 at 14:22
  • @Fomalhaut : did you ever figure this out? I'm having the same issue right now and it's driving me nuts. – Michael Mar 25 '15 at 13:37

0 Answers0