Fixing ImportError: cannot import name - python-3.x

I'm trying to upgrade EVS and I keep on getting this error.
The command I'm using is
python3 -m pip install --upgrade castlabs-evs
and I keep getting Import error: cannot import name.
This is the full output that I get
Traceback (most recent call last):
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/runpy.py", line 193, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pip/__main__.py", line 16, in <module>
from pip._internal import main as _main # isort:skip # noqa
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pip/_internal/__init__.py", line 40, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pip/_internal/cli/autocompletion.py", line 8, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pip/_internal/cli/main_parser.py", line 11, in <module>
from pip._internal.commands import (
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pip/_internal/commands/__init__.py", line 6, in <module>
from pip._internal.commands.completion import CompletionCommand
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pip/_internal/commands/completion.py", line 6, in <module>
from pip._internal.cli.base_command import Command
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line 26, in <module>
from pip._internal.index import PackageFinder
ImportError: cannot import name 'PackageFinder' from 'pip._internal.index' (/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pip/_internal/index/__init__.py)
I am unsure what I can do to resolve this? Any help would be appreciated.
I am using terminal on a Mac which uses zsh.

castlabs-evs can not support Python 3.8
You are using Python 3.8 use Python3.7
Install in Python3.7

Related

cannot use the pip command on termux ubunty , says OSError , cant fint path to android path folder

When i tried to use the pip command on ubuntu , on termux it says , no module named jnia
which pip returns /usr/bin/pip
how can I make the pip command usable ,
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/_vendor/platformdirs/android.py", line 85, in _android_folder from jnius import autoclass
ModuleNotFoundError: No module named 'jnius'
During handling of the above exception, another exception occurred:
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 "/usr/lib/python3/dist-packages/pip/__main__.py", line 29, in <module>
from pip._internal.cli.main import main as _main File "/usr/lib/python3/dist-packages/pip/_internal/cli/main.py", line 9, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "/usr/lib/python3/dist-packages/pip/_internal/cli/autocompletion.py", line 10, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "/usr/lib/python3/dist-packages/pip/_internal/cli/main_parser.py", line 8, in <module> from pip._internal.cli import cmdoptions
File "/usr/lib/python3/dist-packages/pip/_internal/cli/cmdoptions.py", line 23, in <module>
from pip._internal.cli.parser import ConfigOptionParser
File "/usr/lib/python3/dist-packages/pip/_internal/cli/parser.py", line 12, in <module>
from pip._internal.configuration import Configuration, ConfigurationError
File "/usr/lib/python3/dist-packages/pip/_internal/configuration.py", line 26, in <module> from pip._internal.utils.logging import getLogger
File "/usr/lib/python3/dist-packages/pip/_internal/utils/logging.py", line 27, in <module>
from pip._internal.utils.misc import ensure_dir
File "/usr/lib/python3/dist-packages/pip/_internal/utils/misc.py", line 39, in <module> from pip._internal.locations import get_major_minor_version
File "/usr/lib/python3/dist-packages/pip/_internal/locations/__init__.py", line 14, in <module>
from . import _distutils, _sysconfig
File "/usr/lib/python3/dist-packages/pip/_internal/locations/_distutils.py", line 19, in <module>
from .base import get_major_minor_version
File "/usr/lib/python3/dist-packages/pip/_internal/locations/base.py", line 12, in <module>
USER_CACHE_DIR = appdirs.user_cache_dir("pip")
File "/usr/lib/python3/dist-packages/pip/_internal/utils/appdirs.py", line 17, in user_cache_dir
return _appdirs.user_cache_dir(appname, appauthor=False)
File "/usr/lib/python3/dist-packages/pip/_vendor/platformdirs/__init__.py", line 114, in user_cache_dir
return PlatformDirs(appname=appname, appauthor=appauthor, version=version, opinion=opinion).user_cache_dir
File "/usr/lib/python3/dist-packages/pip/_vendor/platformdirs/android.py", line 43, in user_cache_dir return self._append_app_name_and_version(_android_folder(), "cache")
File "/usr/lib/python3/dist-packages/pip/_vendor/platformdirs/android.py", line 97, in _android_folder raise OSError("Cannot find path to android app folder") OSError: Cannot find path to android app folder
Do ANDROID_DATA=anything, so pip will think it is running in a normal linux not android.
Try sudo pip install <package>.

python -m spyder_kernels.console errors out with "cannot import name 'write_connection_file' from 'jupyter_client'"

While trying to launch a Launch a Spyder kernel on ssh server, it errors out with the following error:
bash-4.2$ python3 -m spyder_kernels.console
/home/sachingodishela/python-build/3.10.6/lib/python3.10/site-packages/jupyter_client/__init__.py:23: UserWarning: Could not import submodules
warnings.warn("Could not import submodules")
Traceback (most recent call last):
File "/home/sachingodishela/python-build/3.10.6/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/home/sachingodishela/python-build/3.10.6/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/sachingodishela/python-build/3.10.6/lib/python3.10/site-packages/spyder_kernels/console/__main__.py", line 22, in <module>
from spyder_kernels.console import start
File "/home/sachingodishela/python-build/3.10.6/lib/python3.10/site-packages/spyder_kernels/console/start.py", line 21, in <module>
import ipykernel
File "/home/sachingodishela/python-build/3.10.6/lib/python3.10/site-packages/ipykernel/__init__.py", line 5, in <module>
from .connect import * # noqa
File "/home/sachingodishela/python-build/3.10.6/lib/python3.10/site-packages/ipykernel/connect.py", line 12, in <module>
from jupyter_client import write_connection_file
ImportError: cannot import name 'write_connection_file' from 'jupyter_client' (/home/sachingodishela/python-build/3.10.6/lib/python3.10/site-packages/jupyter_client/__init__.py)

IPython Not opening (invalid syntax)

I have installed IPython using the command:
python3.7 -m pip install ipython
And it gave the prompt of successful installation as well but when i try to open IPython using the command:
python3.7 -m IPython
(NOTE: using IPython instead of ipython because that's how it is stored in my system)
I am getting the following error:
Traceback (most recent call last):
File "/usr/lib/python3.7/runpy.py", line 183, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/usr/lib/python3.7/runpy.py", line 142, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "/usr/lib/python3.7/runpy.py", line 109, in _get_module_details
__import__(pkg_name)
File "/usr/local/lib/python3.7/dist-packages/IPython/__init__.py", line 54, in <module>
from .core.application import Application
File "/usr/local/lib/python3.7/dist-packages/IPython/core/application.py", line 25, in <module>
from IPython.core import release, crashhandler
File "/usr/local/lib/python3.7/dist-packages/IPython/core/crashhandler.py", line 27, in <module>
from IPython.core import ultratb
File "/usr/local/lib/python3.7/dist-packages/IPython/core/ultratb.py", line 119, in <module>
from IPython.utils import path as util_path
File "/usr/local/lib/python3.7/dist-packages/IPython/utils/path.py", line 17, in <module>
from IPython.utils.process import system
File "/usr/local/lib/python3.7/dist-packages/IPython/utils/process.py", line 19, in <module>
from ._process_posix import system, getoutput, arg_split, check_pid
File "/usr/local/lib/python3.7/dist-packages/IPython/utils/_process_posix.py", line 23, in <module>
import pexpect
File "/usr/lib/python3/dist-packages/pexpect/__init__.py", line 75, in <module>
from .pty_spawn import spawn, spawnu
File "/usr/lib/python3/dist-packages/pexpect/pty_spawn.py", line 15, in <module>
from .spawnbase import SpawnBase
File "/usr/lib/python3/dist-packages/pexpect/spawnbase.py", line 218
def expect(self, pattern, timeout=-1, searchwindowsize=-1, async=False):
^
SyntaxError: invalid syntax
Download pexpect4.6 source code from https://github.com/pexpect/pexpect/releases/tag/4.6
Extract the source code, get into the folder and install the pexpect by:
sudo python3.7 setup.py install
This should solve your problem. :)

After conda update --all, Qt breaks in iPython

I ran "conda update --all" and it updated a lot of things, including Python itself (from 3.5.2-0 to 3.5.3-1, I think) and PyQt. I have used Pip in the past; I imagine they might conflict. Now when I try to run an iPython session, as soon as I evaluate a plot, the kernel dies, and I get a lot of "ImportError: No module named 'PyQt4.QtGui'" errors.
I opened a Python shell and found that QtGui exists in PyQt5 but not PyQt4:
>>> import PyQt4
>>> import PyQt4.QtGui
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'PyQt4.QtGui'
>>> import PyQt5
>>> import PyQt5.QtGui
I run Linux, specifically Ubuntu 16.04.
What should I do?
Here's the full traceback:
Traceback (most recent call last):
File "/home/jeff/apps/pythoon-libs/lib/python3.5/runpy.py", line 183, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/home/jeff/apps/pythoon-libs/lib/python3.5/runpy.py", line 142, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "/home/jeff/apps/pythoon-libs/lib/python3.5/runpy.py", line 109, in _get_module_details
__import__(pkg_name)
File "/home/jeff/apps/pythoon-libs/lib/python3.5/site-packages/ipykernel/__init__.py", line 2, in <module>
from .connect import *
File "/home/jeff/apps/pythoon-libs/lib/python3.5/site-packages/ipykernel/connect.py", line 13, in <module>
from IPython.core.profiledir import ProfileDir
File "/home/jeff/apps/pythoon-libs/lib/python3.5/site-packages/IPython/__init__.py", line 54, in <module>
from .core.application import Application
File "/home/jeff/apps/pythoon-libs/lib/python3.5/site-packages/IPython/core/application.py", line 25, in <module>
from IPython.core import release, crashhandler
File "/home/jeff/apps/pythoon-libs/lib/python3.5/site-packages/IPython/core/crashhandler.py", line 27, in <module>
from IPython.core import ultratb
File "/home/jeff/apps/pythoon-libs/lib/python3.5/site-packages/IPython/core/ultratb.py", line 116, in <module>
from IPython.core import debugger
File "/home/jeff/apps/pythoon-libs/lib/python3.5/site-packages/IPython/core/debugger.py", line 46, in <module>
from pdb import Pdb as OldPdb
File "/home/jeff/apps/pythoon-libs/lib/python3.5/pdb.py", line 75, in <module>
import code
File "/home/jeff/stats_with_luis/code.py", line 1, in <module>
import pandas
File "/home/jeff/apps/pythoon-libs/lib/python3.5/site-packages/pandas/__init__.py", line 58, in <module>
from pandas.io.api import *
File "/home/jeff/apps/pythoon-libs/lib/python3.5/site-packages/pandas/io/api.py", line 8, in <module>
from pandas.io.clipboard.clipboard import read_clipboard
File "/home/jeff/apps/pythoon-libs/lib/python3.5/site-packages/pandas/io/clipboard/__init__.py", line 103, in <module>
copy, paste = determine_clipboard()
File "/home/jeff/apps/pythoon-libs/lib/python3.5/site-packages/pandas/io/clipboard/__init__.py", line 76, in determine_clipboard
return init_qt_clipboard()
File "/home/jeff/apps/pythoon-libs/lib/python3.5/site-packages/pandas/io/clipboard/clipboards.py", line 49, in init_qt_clipboard
from PyQt4.QtGui import QApplication
ImportError: No module named 'PyQt4.QtGui'

ipython3 iptest3 error

I am running Mac OSX 10.7.5. I removed Python 2.7 and installed Python 3.3. I installed ipython and when I run iptest3 I get the following error:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.3/bin/iptest3", line 9, in <module>
load_entry_point('ipython==0.13.1', 'console_scripts', 'iptest3')()
File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/distribute-0.6.34-py3.3.egg/pkg_resources.py", line 343, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/distribute-0.6.34-py3.3.egg/pkg_resources.py", line 2308, in load_entry_point
return ep.load()
File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/distribute-0.6.34-py3.3.egg/pkg_resources.py", line 2014, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/ipython-0.13.1-py3.3.egg/IPython/__init__.py", line 43, in <module>
from .config.loader import Config
File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/ipython-0.13.1-py3.3.egg/IPython/config/__init__.py", line 16, in <module>
from .application import *
File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/ipython-0.13.1-py3.3.egg/IPython/config/application.py", line 31, in <module>
from IPython.config.configurable import SingletonConfigurable
File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/ipython-0.13.1-py3.3.egg/IPython/config/configurable.py", line 26, in <module>
from .loader import Config
File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/ipython-0.13.1-py3.3.egg/IPython/config/loader.py", line 27, in <module>
from IPython.utils.path import filefind, get_ipython_dir
File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/ipython-0.13.1-py3.3.egg/IPython/utils/path.py", line 25, in <module>
from IPython.utils.process import system
File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/ipython-0.13.1-py3.3.egg/IPython/utils/process.py", line 27, in <module>
from ._process_posix import _find_cmd, system, getoutput, arg_split
File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/ipython-0.13.1-py3.3.egg/IPython/utils/_process_posix.py", line 22, in <module>
from IPython.external import pexpect
File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/ipython-0.13.1-py3.3.egg/IPython/external/pexpect/__init__.py", line 2, in <module>
import pexpect
File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/pexpect-2.4-py3.3.egg/pexpect.py", line 82
except ImportError, e:
^
SyntaxError: invalid syntax
pexpect is not compatible with Python 3. You need to install pexpect-u.
Seem like a pexpect issue to me.
Can you import pexpect in normal python3.3 shell ?
Also
I'm not sure the ipython .egg works on python3.
I don't think you need to remove 2.7 to use 3.3

Resources