I've tried compiling a Python program on my Mac, and all went well. I then moved to ubuntu, and can't even compile a hello world correctly:
I wrote the simplest hello world:
print("hello world")
then tried compiling it using:
pyinstaller --onefile hello.py
everything seemed to be fine, until I tried running it:
dist/hello
and got the following traceback:
[2886] mod is NULL - structTraceback (most recent call last):
File "/usr/lib/python3.6/struct.py", line 13, in <module>
from _struct import *
ModuleNotFoundError: No module named '_struct'
[2886] mod is NULL - pyimod02_archiveTraceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/PyInstaller-3.4.dev0+g5f91905-py3.6.egg/PyInstaller/loader/pyimod02_archive.py", line 28, in <module>
import struct
ModuleNotFoundError: No module named 'struct'
[2886] mod is NULL - pyimod03_importersTraceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/PyInstaller-3.4.dev0+g5f91905-py3.6.egg/PyInstaller/loader/pyimod03_importers.py", line 24, in <module>
from pyimod02_archive import ArchiveReadError, ZlibArchiveReader
ModuleNotFoundError: No module named 'pyimod02_archive'
Traceback (most recent call last):
File "PyInstaller-3.4.dev0+g5f91905-py3.6.egg/PyInstaller/loader/pyiboot01_bootstrap.py", line 15, in <module>
ModuleNotFoundError: No module named 'pyimod03_importers'
[2886] Failed to execute script pyiboot01_bootstrap
It seems weird as I don't import any modules explicitly, but I followed a suggestion to add the missing modules in hello.spec under hiddenimports. so I added
hiddenimports=['_struct', 'struct', 'pyimod02_archive','pyimod03_importers']
and tried compiling with
pyinstaller --onefile hello.spec
but got the exact same error as before when I tried to run the exe file.
What am I doing wrong?
I'm using pyinstaller 3.4.dev0+g5f91905 with Python 3.6.2 on Ubuntu 16.04.3
Related
After installing Anaconda in Windows I get the following error when trying to use it:
conda command
:
Traceback (most recent call last):
File "C:\Users\mohamed\Anaconda3\Scripts\conda-script.py", line 11, in <module>
from conda.cli import main
ModuleNotFoundError: No module named 'conda'
anaconda command
:
Traceback (most recent call last):
File "C:\Users\mohamed\anaconda3\Scripts\anaconda-script.py", line 6, in <module>
from binstar_client.scripts.cli import main
ModuleNotFoundError: No module named 'binstar_client'
I tried to delete and reinstall anaconda several times but useless
When running the command pythontex in the terminal, I get this error:
Traceback (most recent call last):
File "/Library/TeX/texbin/pythontex", line 50, in <module>
import pythontex2 as pythontex
File "/usr/local/texlive/2021/texmf-dist/scripts/pythontex/pythontex2.py", line 61, in <module>
from pygments.styles import get_all_styles
ImportError: No module named pygments.styles
The are two reasons why this confuses me:
Why is it running the pythontex2 if I have the Python 3.7 version as the main one;
why can't he find the module pygments?
I'm using a MacBook with M1, if this is useful.
Thank you ind advance.
Running the following test script
import win32api
print(win32api.EnumDisplaySettings().DisplayFrequency) # just for testing
works absoultely fine out of my IDE PyCharm, but running this script via Terminal using "python test.py" produces the following error:
Traceback (most recent call last):
File "test.py", line 1, in <module>
import win32api
ModuleNotFoundError: No module named 'win32api'
How can I fix this?
Am using python 2.7 and got error like "ImportError: No module named _pjsua" while using "import pjsua". I refered and tried some solution but no luck on those solutions.
pjsua: unable to import pjsua python module
Traceback (most recent call last):
File "", line 1, in
File "pjsua.py", line 59, in
import _pjsua
ImportError: No module named _pjsua
I am new to mysql fabric. I am getting the following error:
root#ajith-System-Product-Name:/home/ajith# mysqlfabric
Traceback (most recent call last):
File "/usr/bin/mysqlfabric", line 33, in <module>
from mysql.fabric import (
ImportError: No module named fabric
I installed mysql-connector-python_2.1.3, mysql-utilities_1.5.6, and python2.7.
Your from statement should use mysqlfabric, not mysql.fabric, as far as I can tell.