On Ubuntu 22.04, a fresh installation of Spyder crashes immediately after launch.
Spyder installed through
sudo apt-get install spyder
Python version 3.10.6
QMake version 3.1
QT version 5.15.3
Here it is the log message after crash, if I launch Spyder from command line:
spyder
Traceback (most recent call last):
File "/usr/bin/spyder", line 33, in <module>
sys.exit(load_entry_point('spyder==4.2.1', 'gui_scripts', 'spyder')())
File "/usr/lib/python3/dist-packages/spyder/app/start.py", line 213, in main
mainwindow.main(options, args)
File "/usr/lib/python3/dist-packages/spyder/app/mainwindow.py", line 3624, in main
mainwindow = create_window(app, splash, options, args)
File "/usr/lib/python3/dist-packages/spyder/app/mainwindow.py", line 3482, in create_window
main.setup()
File "/usr/lib/python3/dist-packages/spyder/app/mainwindow.py", line 803, in setup
self.completions = CompletionManager(self)
File "/usr/lib/python3/dist-packages/spyder/plugins/completion/plugin.py", line 97, in __init__
plugin_client = Plugin(self.main)
File "/usr/lib/python3/dist-packages/spyder/plugins/completion/kite/plugin.py", line 50, in __init__
self.installer = KiteInstallerDialog(
File "/usr/lib/python3/dist-packages/spyder/plugins/completion/kite/widgets/install.py", line 287, in __init__
self._integration_widget = KiteIntegrationInfo(self)
File "/usr/lib/python3/dist-packages/spyder/plugins/completion/kite/widgets/install.py", line 58, in __init__
image = image.scaled(image_width, image_height, Qt.KeepAspectRatio,
TypeError: arguments did not match any overloaded call:
scaled(self, int, int, aspectRatioMode: Qt.AspectRatioMode = Qt.IgnoreAspectRatio, transformMode: Qt.TransformationMode = Qt.FastTransformation): argument 1 has unexpected type 'float'
scaled(self, QSize, aspectRatioMode: Qt.AspectRatioMode = Qt.IgnoreAspectRatio, transformMode: Qt.TransformationMode = Qt.FastTransformation): argument 1 has unexpected type 'float'
Related
I'm getting below error while trying to launch Spyder in Anaconda.
Traceback (most recent call last): File
"/Users/folder/opt/anaconda3/bin/spyder", line 11, in
sys.exit(main()) File
"/Users/folder/opt/anaconda3/lib/python3.9/site-packages/spyder/app/start.py",
line 233, in main from spyder.app import mainwindow File
"/Users/folder/opt/anaconda3/lib/python3.9/site-packages/spyder/app/mainwindow.py",
line 42, in requirements.check_qt() File
"/Users/folder/opt/anaconda3/lib/python3.9/site-packages/spyder/requirements.py",
line 47, in check_qt if parse_version(actual_ver) File
"/Users/folder/opt/anaconda3/lib/python3.9/site-packages/pkg_resources/init.py",
line 121, in parse_version return packaging.version.Version(v) File
"/Users/folder/opt/anaconda3/lib/python3.9/site-packages/pkg_resources/_vendor/packaging/version.py",
line 264, in init match = self._regex.search(version) TypeError:
expected string or bytes-like object
Is there a way to solve this problem?
I tried uninstalling and reinstalling the package.
I'm trying to create an apk with buildozer and I get this error:
[WARNING]: prerequisites.py is experimental and does not support all prerequisites yet. [WARNING]: Please report any issues to the python-for-android issue tracker. [WARNING]: prerequisites.py is experimental and does not support all prerequisites yet. [WARNING]: Please report any issues to the python-for-android issue tracker. [INFO]: Will compile for the following archs: arm64-v8a, armeabi-v7a [INFO]: Found Android API target in $ANDROIDAPI: 31 Traceback (most recent call last): File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/lib/python3.10/runpy.py", line 86, in _run_code exec(code, run_globals) File "/mnt/c/pakagin2/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 1312, in <module> main() File "/mnt/c/pakagin2/.buildozer/android/platform/python-for-android/pythonforandroid/entrypoints.py", line 18, in main ToolchainCL() File "/mnt/c/pakagin2/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 734, in __init__ getattr(self, command)(args) File "/mnt/c/pakagin2/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 143, in wrapper_func ctx.prepare_build_environment(user_sdk_dir=self.sdk_dir, File "/mnt/c/pakagin2/.buildozer/android/platform/python-for-android/pythonforandroid/build.py", line 273, in prepare_build_environment apis = get_available_apis(self.sdk_dir) File "/mnt/c/pakagin2/.buildozer/android/platform/python-for-android/pythonforandroid/build.py", line 47, in get_available_apis targets = get_targets(sdk_dir) File "/mnt/c/pakagin2/.buildozer/android/platform/python-for-android/pythonforandroid/build.py", line 35, in get_targets targets = avdmanager('list', 'target').stdout.decode('utf-8').split('\n') AttributeError: 'str' object has no attribute 'stdout'
I tried reinstalling everything and searching on google but I can't find a solution.
I suppose there is an error when it looks for api=31 because it stops there.
I also tried with google collab and it gives me the same error
I am packaging kivyMD app in Google colab. The app is source code of kitchen sink app from official github page of kivyMD.
Edit: Error occured after : !buildozer -v android debug
# Package the application
Traceback (most recent call last):
File "/usr/local/bin/buildozer", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.7/dist-packages/buildozer/scripts/client.py", line 13, in main
Buildozer().run_command(sys.argv[1:])
File "/usr/local/lib/python3.7/dist-packages/buildozer/__init__.py", line 1047, in run_command
self.target.run_commands(args)
File "/usr/local/lib/python3.7/dist-packages/buildozer/target.py", line 92, in run_commands
func(args)
File "/usr/local/lib/python3.7/dist-packages/buildozer/target.py", line 104, in cmd_debug
self.buildozer.build()
File "/usr/local/lib/python3.7/dist-packages/buildozer/__init__.py", line 205, in build
self.target.build_package()
File "/usr/local/lib/python3.7/dist-packages/buildozer/targets/android.py", line 990, in build_package
version = self.buildozer.get_version()
File "/usr/local/lib/python3.7/dist-packages/buildozer/__init__.py", line 701, in get_version
with open(fn) as fd:
FileNotFoundError: [Errno 2] No such file or directory: './../../kivymd/__init__.py'
Full Output + Error File
Info: File Structure is same as source code
What should I do to handle this error.
Thanks in Advance
Try the following command:
buildozer android debug deploy run logcat
For this command you have to use usb debugging with your phone .
Spyder console is showing an error msg:
An error ocurred while starting the kernel
Traceback (most recent call last): File "C:\Users\ABCD\Anaconda3\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "C:\Users\ABCD\Anaconda3\lib\runpy.py",
line 85, in _run_code exec(code, run_globals) File "C:\Users\ABCD\Anaconda3\lib\site‑packages\spyder_kernels\console\__main__.py",
line 11, in start.main() File "C:\Users\ABCD\Anaconda3\lib\site‑packages\spyder_kernels\console\start.py",
line 287, in main import_spydercustomize() File "C:\Users\ABCD\Anaconda3\lib\site‑packages\spyder_kernels\console\start.py",
line 39, in import_spydercustomize import spydercustomize File "C:\Users\ABCD\Anaconda3\lib\site‑packages\spyder_kernels\customize\spydercustomize.py",
line 27, in from IPython.core.getipython import get_ipython File "C:\Users\ABCD\Anaconda3\lib\site‑packages\IPython\__init__.py",
line 55, in from .terminal.embed import embed File "C:\Users\ABCD\Anaconda3\lib\site‑packages\IPython\terminal\embed.py",
line 17, in from IPython.terminal.ipapp import load_default_config File "C:\Users\ABCD\Anaconda3\lib\site‑packages\IPython\terminal\ipapp.py",
line 28, in from IPython.core.magics import ( File "C:\Users\ABCD\Anaconda3\lib\site‑packages\IPython\core\magics\__init__.py",
line 18, in from .code import CodeMagics, MacroToEdit File "C:\Users\ABCD\Anaconda3\lib\site‑packages\IPython\core\magics\code.py",
line 23, in from urllib.request import urlopen File "C:\Users\ABCD\Anaconda3\lib\urllib\request.py",
line 86, in import email File "C:\Users\ABCD\email.py",
line 8, in n=input() EOFError: EOF when reading a line
What I understood on reading other threads about similar kind of problems , that this is due to having two python versions installed
So, I tried manually removing all python files (as I was unable to uninstall python) and then uninstalled and reinstalled anaconda (spyder) but the problem persists
Any kind of help wd be appreciated
Short answer: To fix this problem, you need to remove or rename this file:
C:\Users\ABCD\email.py
Long answer: That file has the same name of a core Python module. Since it's placed in your home directory, it has higher priority than that module, which makes Python to use it first and ends up causing the error.
I get this error when I launch Spyder through cmd
Also, I can't run it by clicking the shortcut
Traceback (most recent call last):
File "C:\Akash Shanmugaraj\anaconda3\Scripts\spyder-script.py", line 6, in <module>
from spyder.app.start import main
File "C:\Akash Shanmugaraj\anaconda3\lib\site-packages\spyder\app\start.py", line 22, in <module>
import zmq
File "C:\Users\Akash Shanmugaraj\AppData\Roaming\Python\Python38\site-packages\zmq\__init__.py", line 47, in <module>
from zmq import backend
File "C:\Users\Akash Shanmugaraj\AppData\Roaming\Python\Python38\site-packages\zmq\backend\__init__.py", line 40, in <module>
reraise(*exc_info)
File "C:\Users\Akash Shanmugaraj\AppData\Roaming\Python\Python38\site-packages\zmq\utils\sixcerpt.py", line 34, in reraise
raise value
File "C:\Users\Akash Shanmugaraj\AppData\Roaming\Python\Python38\site-packages\zmq\backend\__init__.py", line 27, in <module>
_ns = select_backend(first)
File "C:\Users\Akash Shanmugaraj\AppData\Roaming\Python\Python38\site-packages\zmq\backend\select.py", line 28, in select_backend
mod = __import__(name, fromlist=public_api)
File "C:\Users\Akash Shanmugaraj\AppData\Roaming\Python\Python38\site-packages\zmq\backend\cython\__init__.py", line 6, in <module>
from . import (constants, error, message, context,
ImportError: cannot import name 'constants' from partially initialized module 'zmq.backend.cython' (most likely due to a circular import) (C:\Users\Akash Shanmugaraj\AppData\Roaming\Python\Python38\site-packages\zmq\backend\cython\__init__.py)
I had the same problem. "activate base" didn't help, but just found a solution. Certainly not quite correct, but it works.
Go to folder:
C:\Users\<your_login>\AppData\Roaming\Python
and rename it ("Python") on "Python_x" or something else.
Spyder and Navigator starts up and so far everything works, but don't delete that folder.
In cmd try activating the base environment(or any other relevant environment) by running
activate base
and then try running spyder.