yum and dnf is broken after run "conda install conda" - anaconda

I'm working in python3 on Fedora 27 and I was trying to install the anaconda. After I run conda install conda yum and dnf are broken. Now I got the following error.
Traceback (most recent call last):
File "/usr/bin/dnf", line 57, in <module>
from dnf.cli import main
File "/usr/lib/python3.6/site-packages/dnf/cli/__init__.py", line 30, in <module>
from dnf.cli.cli import Cli # :api
File "/usr/lib/python3.6/site-packages/dnf/cli/cli.py", line 27, in <module>
from . import output
File "/usr/lib/python3.6/site-packages/dnf/cli/output.py", line 29, in <module>
import dnf.cli.progress
File "/usr/lib/python3.6/site-packages/dnf/cli/progress.py", line 19, in <module>
from dnf.cli.term import _term_width
File "/usr/lib/python3.6/site-packages/dnf/cli/term.py", line 21, in <module>
import curses
File "/usr/lib/python3.6/curses/__init__.py", line 13, in <module>
from _curses import *
ImportError: libncursesw.so.5: cannot open shared object file: No such file or directory
Can anyone help me?

Related

ROS - ImportError: No module named yaml

I am new to ROS and am trying to run a python script from the tutorials mentioned in ROS website(link below)
http://wiki.ros.org/ROS/Tutorials/ExaminingPublisherSubscriber
When I run the command: $ rosrun beginner_tutorials talker.py
This error pops up.
Traceback (most recent call last):
File "/home/tarapreeth/catkin_ws/src/beginner_tutorials/scripts/talker.py", line 39, in <module>
import rospy
File "/opt/ros/noetic/lib/python3/dist-packages/rospy/__init__.py", line 47, in <module>
from std_msgs.msg import Header
File "/opt/ros/noetic/lib/python3/dist-packages/std_msgs/msg/__init__.py", line 1, in <module>
from ._Bool import *
File "/opt/ros/noetic/lib/python3/dist-packages/std_msgs/msg/_Bool.py", line 6, in <module>
import genpy
File "/opt/ros/noetic/lib/python3/dist-packages/genpy/__init__.py", line 34, in <module>
from . message import Message, SerializationError, DeserializationError, MessageException, struct_I
File "/opt/ros/noetic/lib/python3/dist-packages/genpy/message.py", line 48, in <module>
import yaml
ImportError: No module named yaml
I tried installing yaml using:
pip install pyyaml
I get this: Requirement already satisfied: pyyaml in /usr/lib/python3/dist-packages (5.3.1).

Pip not working; from 'ImportError: No module named urllib3' to non-admin windows user

I am facing some problems with pip. The original error message in my command prompt (windows, Python 2.7.14 and this is the version I must keep) when typing for instance pip was
Traceback (most recent call last):
File "c:\python27\lib\runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "c:\python27\lib\runpy.py", line 72, in _run_code
exec code in run_globals
File "C:\Python27\Scripts\pip.exe\__main__.py", line 5, in <module>
File "c:\python27\lib\site-packages\pip\__init__.py", line 21, in <module>
from pip._vendor.requests.packages.urllib3.exceptions import DependencyWarning
File "c:\python27\lib\site-packages\pip\_vendor\requests\__init__.py", line 62, in <module>
from .packages.urllib3.exceptions import DependencyWarning
File "c:\python27\lib\site-packages\pip\_vendor\requests\packages\__init__.py", line 29, in <module>
import urllib3
ImportError: No module named urllib3
My journey to solve/explore the problem:
This happend no matter which of the following prompt commands I was trying
pip
pip --version
pip list
pip freeze
pip install --upgrade requests
pip install urllib3
Other commands might have change the error message a little bit in terms of the files listed like
python -m pip install --upgrade pip
Traceback (most recent call last):
File "C:\Python27\lib\runpy.py", line 163, in _run_module_as_main
mod_name, _Error)
File "C:\Python27\lib\runpy.py", line 111, in _get_module_details
__import__(mod_name) # Do not catch exceptions initializing package
File "C:\Python27\lib\site-packages\pip\__init__.py", line 21, in <module>
from pip._vendor.requests.packages.urllib3.exceptions import DependencyWarning
File "C:\Python27\lib\site-packages\pip\_vendor\requests\__init__.py", line 62, in <module>
from .packages.urllib3.exceptions import DependencyWarning
File "C:\Python27\lib\site-packages\pip\_vendor\requests\packages\__init__.py", line 29, in <module>
import urllib3
ImportError: No module named urllib3
I have checked the following (according to several suggestions I found in related questions on stackoverflow)
a pip application can be found in C:\Python27\Scripts
dont have something called PYTHONPATH in system variables only Path
C:\Python27\Scripts is listed in system variables>Path
anaconda was installed by the user before me. I uninstalled as apparently this could cause troubles and deleted all remaining .condarc files,./conda & conda folders as well as the system variable>Path listing.
I have tried the solution which was voted for here by downloading and running python get-pip.py. This is the error message:
>python get-pip.py
Traceback (most recent call last):
File "get-pip.py", line 23974, in <module>
main()
File "get-pip.py", line 188, in main
tmpdir = tempfile.mkdtemp()
File "C:\Python27\lib\tempfile.py", line 331, in mkdtemp
dir = gettempdir()
File "C:\Python27\lib\tempfile.py", line 275, in gettempdir
tempdir = _get_default_tempdir()
File "C:\Python27\lib\tempfile.py", line 200, in _get_default_tempdir
with _io.open(fd, 'wb', closefd=False) as fp:
AttributeError: 'module' object has no attribute 'open'
I was told there were some problems noticed before: The computer has 2 users, an administrator and an additional user with '(user)' in its name. I was told that it was not possible to install anaconda for that user - it was installed by the administrator for all users but in the end spyder for instance and the anaconda prompt could only be ran as administrator, too. So I am not sure if there is a problem in general with the user setup?!
I ran the command prompt as administrator and pip --version worked
pip 9.0.1 from c:\python27\lib\site-packages (python 2.7)
So I ran python -m pip install --upgrade pip as administrator, opened the command prompt again (not as administrator and now the new error is
Traceback (most recent call last):
File "c:\python27\lib\runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "c:\python27\lib\runpy.py", line 72, in _run_code
exec code in run_globals
File "C:\Python27\Scripts\pip.exe\__main__.py", line 5, in <module>
File "c:\python27\lib\site-packages\pip\_internal\cli\main.py", line 10, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "c:\python27\lib\site-packages\pip\_internal\cli\autocompletion.py", line 9, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "c:\python27\lib\site-packages\pip\_internal\cli\main_parser.py", line 7, in <module>
from pip._internal.cli import cmdoptions
File "c:\python27\lib\site-packages\pip\_internal\cli\cmdoptions.py", line 25, in <module>
from pip._internal.cli.progress_bars import BAR_TYPES
File "c:\python27\lib\site-packages\pip\_internal\cli\progress_bars.py", line 12, in <module>
from pip._internal.utils.logging import get_indentation
File "c:\python27\lib\site-packages\pip\_internal\utils\logging.py", line 18, in <module>
from pip._internal.utils.misc import ensure_dir
File "c:\python27\lib\site-packages\pip\_internal\utils\misc.py", line 21, in <module>
from pip._vendor import pkg_resources
File "c:\python27\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 26, in <module>
import zipfile
File "c:\python27\lib\zipfile.py", line 501, in <module>
class ZipExtFile(io.BufferedIOBase):
AttributeError: 'module' object has no attribute 'BufferedIOBase'
Tried step 3 again, same outcome
Now I am frustrated and I am hoping for help because I am not super experienced and I don't want to mess up things even more (probably already did by uninstalling anaconda).
Thank you for helping!
PS: I can not exclude that I did not miss the correct solution for this problem, as several topics are addressing pip and urllib3 already, however I have tried my best to cover all suggestions. I apologize if there is already a similar topic solving this problem out there.

ImportError: No module named 'thinc.about'

I am trying to install spacy for windows, python 3.x.
I ran the following commands:-
conda install -c conda-forge spacy
python -m spacy download en
"python -m spacy download en" gives the error:-
Traceback (most recent call last):
File "D:\Anaconda3\lib\runpy.py", line 174, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "D:\Anaconda3\lib\runpy.py", line 133, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "D:\Anaconda3\lib\runpy.py", line 109, in _get_module_details
__import__(pkg_name)
File "D:\Anaconda3\lib\site-packages\spacy\__init__.py", line 4, in <module>
from .cli.info import info as cli_info
File "D:\Anaconda3\lib\site-packages\spacy\cli\__init__.py", line 1, in <module>
from .download import download
File "D:\Anaconda3\lib\site-packages\spacy\cli\download.py", line 10, in <module>
from .link import link
File "D:\Anaconda3\lib\site-packages\spacy\cli\link.py", line 7, in <module>
from ..compat import symlink_to, path2str
File "D:\Anaconda3\lib\site-packages\spacy\compat.py", line 11, in <module>
from thinc.neural.util import copy_array
File "D:\Anaconda3\lib\site-packages\thinc\__init__.py", line 1, in <module>
from .about import *
ImportError: No module named 'thinc.about'
and the same error when I try to import spacy thereafter. What should I do to successfully install spacy?
I found this link from where I downloaded all of the required whls one by one to install spacy.
Compiling wheel rather than downloading ready one might be helpful as well:
python -m pip install thinc --no-binary=:all:
or
pip install thinc --no-binary=:all:
Don't forget to add --force option if you already have the package.
More information about --no-binary option:
https://pip.pypa.io/en/latest/cli/pip_install/#cmdoption-no-binary

Can't run pip3 after upgrade

I can't run pip3 and easy_install3 after upgrade.
For example command pip3 -V crash with error:
Traceback (most recent call last):
File "/usr/bin/pip3", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 36, in <module>
import plistlib
File "/usr/lib64/python3.4/plistlib.py", line 65, in <module>
from xml.parsers.expat import ParserCreate
File "/usr/lib64/python3.4/xml/parsers/expat.py", line 4, in <module>
from pyexpat import *
ImportError: /usr/lib64/python3.4/lib-dynload/pyexpat.cpython-34m.so: undefined symbol: _PyTraceback_Add
I'm using openSUSE 42.1 Leap.
Help, please!

install pyshark on python 3.5

I've installed python 3.5 on mac os x (el capitan). I want to import pyshark module in python, but I get error.
I installed the pyshark requirement such as (logbook, lxml, trollies, py) but I couldn't import pyshark module.
pip3 list >>
syncio (3.4.3)
futures (3.0.3)
Logbook (0.12.3)
lxml (3.5.0)
pip (7.1.2)
py (1.4.30)
pyshark (0.3.6)
setuptools (18.2)
trollius (2.0)
Importing pyshark module error:
>>> import pyshark
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pyshark/__init__.py", line 1, in <module>
from pyshark.capture.live_capture import LiveCapture
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pyshark/capture/live_capture.py", line 1, in <module>
from pyshark.capture.capture import Capture
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pyshark/capture/capture.py", line 6, in <module>
import trollius as asyncio
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/trollius/__init__.py", line 21, in <module>
from .base_events import *
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/trollius/base_events.py", line 39, in <module>
from . import coroutines
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/trollius/coroutines.py", line 15, in <module>
from . import futures
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/trollius/futures.py", line 116, in <module>
class Future(object):
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/trollius/futures.py", line 426, in Future
__await__ = __iter__ # make compatible with 'await' expression
NameError: name '__iter__' is not defined
Also importing trollies module has a error:
>>> import trollius
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/trollius/__init__.py", line 21, in <module>
from .base_events import *
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/trollius/base_events.py", line 39, in <module>
from . import coroutines
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/trollius/coroutines.py", line 15, in <module>
from . import futures
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/trollius/futures.py", line 116, in <module>
class Future(object):
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/trollius/futures.py", line 426, in Future
__await__ = __iter__ # make compatible with 'await' expression
NameError: name '__iter__' is not defined
Could any one help me out? I can't figure out what is the problem.
This is reported as a bug in https://github.com/haypo/trollius/issues/4
Until it is resolved you can temporalily resolve it by installing an unofficial development version from ludios by doing:
pip install -U git+https://github.com/ludios/trollius#f757a29815c2c9f5c3a691135ff758649fe84098#egg=trollius
Remember that this is a temporary and unofficial solution only. So hit the "subscribe" button on the issue page: https://github.com/haypo/trollius/issues/4 to subscribe to notifications. When the issue is officially resolved, use the official solution.

Resources