Import error with ruamel.yaml in PyInstaller - python

I am using a function from the ruamel package.
from ruamel.yaml.scalarstring import PreservedScalarString
But when I built final EXE by PyInstaller, I get this error during the starting application.
Traceback (most recent call last): File "", line 8, in
File
"c:\users\user\appdata\local\temp\pip-build-eo75my\pyInstaller\PyInstaller\loader\pyi_importers.py",
line 270, in load_module File
"./build/win32\app\out00-PYZ.pyz\src.utils.utils", line 14, in
ImportError: No module named ruamel.yaml.scalarstring
I have tried both PyInstaller 2.1
What is the problem?

It was fixed by upgrading to PyInstaller 3.0 version

Related

can't run customtkinter with .exe

when I try to convert my python file into .exe using auto-py-to-exe an error occure:
Traceback (most recent call last):
File "Jumper.py", line 5,
in File "C:\Users\Clowny\output\Jumper\customtkinter_init_.py", line 10, in
from .appearance_mode_tracker import AppearanceModeTrackerù
File "C:\Users\Clowny\output\Jumper\customtkinter\appearance_mode_tracker.py", line 3, in
from distutils.version import StrictVersion as Version
ModuleNotFoundError: No module named 'distutils'
I already used the documentation steps but it still doesn't working.
can anyone help me?

ImportError: Python version mismatch

I wrote a simple script using face_recognition python library. But when I tried to execute the script I am getting below error.
Traceback (most recent call last):
File "face.py", line 1, in <module>
import face_recognition
File "/home/user/.local/lib/python3.7/site-packages/face_recognition/__init__.py", line 7, in <module>
from .api import load_image_file, face_locations, batch_face_locations, face_landmarks, face_encodings, compare_faces, face_distance
File "/home/user/.local/lib/python3.7/site-packages/face_recognition/api.py", line 4, in <module>
import dlib
ImportError: Python version mismatch: module was compiled for version 3.8, while the interpreter is running version 3.7.
How to resolve it?
Install Python 3.8, this would solve the problem

nrfutil changes python version mid-script

I'm using nrfutil in a shell script. It's failing with this error:
Traceback (most recent call last):
File "/usr/local/bin/nrfutil", line 6, in <module>
from nordicsemi.__main__ import cli
File "/Library/Python/2.7/site-packages/nordicsemi/__main__.py", line 57, in <module>
from nordicsemi.zigbee.prod_config import ProductionConfig, ProductionConfigWrongException, ProductionConfigTooLargeException
File "/Library/Python/2.7/site-packages/nordicsemi/zigbee/prod_config.py", line 41, in <module>
import yaml
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/yaml/__init__.py", line 374
class YAMLObject(metaclass=YAMLObjectMetaclass):
It's starting in python 2.7, then it looks like its running "import yaml" from a 3.6 library.
Why would it do this? How do I prevent it?
Thanks
I had an old version of nrfutil. I upgraded, all is good

Bug in Anaconda 5.2 for macOS Installer for Python 3.6? PySide and qt bindings not found after installing

When trying to install Python 3.6 using the Anaconda 5.2 for macOS Installer I get the following errors:
Traceback (most recent call last):
File "/anaconda3/lib/python3.6/site-packages/qtpy/init.py", line 166, in
from PySide import version as PYSIDE_VERSION # analysis:ignore
ModuleNotFoundError: No module named 'PySide'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/anaconda3/bin/spyder", line 11, in
sys.exit(main())
File "/anaconda3/lib/python3.6/site-packages/spyder/app/start.py", line 159, in main
from spyder.app import mainwindow
File "/anaconda3/lib/python3.6/site-packages/spyder/app/mainwindow.py", line 49, in
requirements.check_qt()
File "/anaconda3/lib/python3.6/site-packages/spyder/requirements.py", line 39, in check_qt
import qtpy
File "/anaconda3/lib/python3.6/site-packages/qtpy/init.py", line 172, in
raise PythonQtError('No Qt bindings could be found')
qtpy.PythonQtError: No Qt bindings could be found
I've seen these errors for different situations, the most relevant being explained in this SO question.
However, I wanted to post my question because the error occurs for the install using the latest version of anaconda for Mac, and I couldn't find a question related to that.

ImportError: No module named Scientific_numerics_package_id

I am trying to compile a python script for visualization of protein molecules using py2exe module. I've python2.7 running in win7 x64. When I try to execute the compiled file, it gives this error:-
C:\Python27\dist>visualn.exe
Traceback (most recent call last):
File "visualn.py", line 19, in <module>
File "MMTK\__init__.pyc", line 39, in <module>
File "Scientific\Geometry\__init__.pyc", line 30, in <module>
File "Scientific\Geometry\VectorModule.pyc", line 9, in <module>
File "Scientific\N.pyc", line 1, in <module>
ImportError: No module named Scientific_numerics_package_id
Without compiling I can run the script successfully. I've already installed scientific,MMTK modules. I got somewhere in the internet that Scientific_numerics_package_id module is available in netCDF4, so I installed that also but no good.
Any idea about the error?
You need the python-netcdf package.

Categories

Resources