I ran the command conda update anaconda to update anaconda v4.4 to v5.0
After anaconda was successfully upgraded to v5.0, I had problems running pip.
This is the error output I see after running pip;
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\Scripts\pip-script.py", line 6, in <module>
from pip import main
File "C:\ProgramData\Anaconda3\lib\site-packages\pip\__init__.py", line 28, in <module>
from pip.vcs import git, mercurial, subversion, bazaar # noqa
File "C:\ProgramData\Anaconda3\lib\site-packages\pip\vcs\mercurial.py", line 9, in <module>
from pip.download import path_to_url
File "C:\ProgramData\Anaconda3\lib\site-packages\pip\download.py", line 41, in <module>
from pip._vendor.requests.adapters import BaseAdapter, HTTPAdapter
ModuleNotFoundError: No module named 'pip._vendor.requests.adapters'
How can I get pip to work again? I am using Windows10, 64-bit python v3.6 anaconda v5.0
Had the same problem fixed by renaming the directory:
%USERPROFILE%\Anaconda3\Lib\site-packages\pip
then running conda install --force-reinstall pip
(Then I guess it's safe to remove the renamed directory)
This occurs when broken pip. The broken pip caused by the failed upgrade can be fixed by running:
!easy_install pip
I will answer my own question.
The problem was fixed by uninstalling anaconda and doing a fresh re-install from the windows installation executable.
Based on this link https://github.com/pypa/pip/issues/2345, it seems something went wrong with the installation but the problem cannot be reproduced. I do not know what exactly what wrong with conda update anaconda.
Related
While launching Spyder from Anaconda Navigator or directly from the menu, it is showing the given error message:
Traceback (most recent call last):
File "C:\Users\charchil\anaconda3\Scripts\spyder-script.py", line 6, in
from spyder.app.start import main
File "C:\Users\charchil\anaconda3\lib\site-packages\spyder\app\start.py", line 22, in
import zmq
File "C:\Users\charchil\AppData\Roaming\Python\Python37\site-packages\zmq_init_.py", line 47, in
from zmq import backend
File "C:\Users\charchil\AppData\Roaming\Python\Python37\site-packages\zmq\backend_init_.py", line 40, in
reraise(*exc_info)
File "C:\Users\charchil\AppData\Roaming\Python\Python37\site-packages\zmq\utils\sixcerpt.py", line 34, in
reraise raise value
File "C:\Users\charchil\AppData\Roaming\Python\Python37\site-packages\zmq\backend_init_.py", line 27, in
ns = select_backend(first)
File "C:\Users\charchil\AppData\Roaming\Python\Python37\site-packages\zmq\backend\select.py", line 28, in
select_backend mod = import(name, fromlist=public_api)
File "C:\Users\charchil\AppData\Roaming\Python\Python37\site-packages\zmq\backend\cython_init.py", line 6, in
from . import (constants, error, message, context,
ImportError: cannot import name 'constants' from 'zmq.backend.cython' (C:\Users\charchil\AppData\Roaming\Python\Python37\site-packages\zmq\backend\cython_init_.py)
A similar issue was raised on Jupyter Notebooks GitHub so it seems likely that a similar solution will help you, i.e.:
Attempt:
conda uninstall pyzmq
conda install pyzmq
Using the conda packages should make sure that version compatibility is maintained. If, however, that still doesn't work (and some comments in the attached issue suggested that it didn't work for some people), attempt:
pip uninstall pyzmq
pip install pyzmq
You can check your version of pip with pip --version and might want to consider upgrading it first if it is a long way behind. Current version is 20.1.1. Command to upgrade pip is:
python -m pip install --upgrade pip
Open the Anaconda prompt
conda deactivate
conda update anaconda-navigator
https://docs.anaconda.com/anaconda/navigator/update-navigator/
For those who are still looking for a quicker answer then below solution might help you as well and this worked for me like a charm.
Open Anaconda Prompt
Run the command conda update --all
Re launch the Anaconda Navigator now
Now Launch, spyder or jupyter notebook. Probably it should work for you as well.
NOTE: If you are running any firewall application then, make sure you launch navigator in administrator mode and unblock any prompt requests accordingly for smooth launching. This is on windows systems again and may be a different way for other platforms.
Hope this helps someone in need again. All the best.
I installed pyaudio with anaconda python. Using conda install pyaudio on windows.
It said it installed and it also installed PortAudio with it.
However, when I create my file and run it now I get the following issue.
I have no idea what is going on.
Could not import the PyAudio C module '_portaudio'.
Traceback (most recent call last):
File "C:\Users\This PC\Desktop\Py\demo.py", line 2, in <module>
import pyaudio
File "C:\Users\This PC\Anaconda3\lib\site-packages\pyaudio.py", line 116, in <module>
import _portaudio as pa
ImportError: DLL load failed: The specified module could not be found.
I ran into this error with win32 py3 using Anaconda3. Re-installing portaudio fixed this:
conda install portaudio
It just updated the package for me, and pyaudio was able to find the DLL then.
I faced a similar issue.
The only way I was able to resolve this was by uninstalling anaconda, installing the latest version of python, and reinstalling the latest version of conda.
I then downloaded the latest .whl file for pyaudio which can be found here: https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio
I moved this file from my downloads and into the site-packages folder of anaconda3:
C:\Users\Projects\Anaconda3\Lib\site-packages
Upon running the command 'pip install pyaudio' OR 'python -m pip install pyaudio' in the anaconda prompt I was good to go
I hope this helps!
I wanted to try using Spyder IDE. I was reading this page on how to open and run Spyder: https://github.com/spyder-ide/spyder/releases
I typed the following commands as specified in the page:
conda update qt pyqt
conda update spyder
Both commands gave "# All requested packages already installed.".
I then typed spyder into my terminal (Mac):
Macs-MacBook:~ macuser$ spyder
Traceback (most recent call last):
File "/anaconda3/lib/python3.6/site-packages/qtpy/__init__.py", line 166, in <module>
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 <module>
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 <module>
So, I tried to install PySide:
Macs-MacBook:~ macuser$ conda install PySide
Solving environment: failed
UnsatisfiableError: The following specifications were found to be in conflict:
- anaconda==5.2.0=py36_3
- pyside
Use "conda info <package>" to see the dependencies for each package.
What should I do to get up and running with Spyder?
try below commands let me know if it works.
pip install msgpack
conda install qt=5.6 pyqt=5.6 sip=4.18
While other solutions found on the web didn't work for me (such as the one above and using $ pip install pyqt5), I solved this by uninstalling and reinstalling Spyder via terminal, using pip.
$ pip uninstall spyder
...
$ pip install spyder
...
Not sure why, but it worked on the first try.
Mr J.
I had the same problem as Doug Fir. I used these commands. I launched spyder from the DOS prompt. I got "RuntimeError: module compiled against API version 0xb but this version of numpy is 0xa" as was the case before. Just as I was rolling my eyes, Spyder went ahead and started. So I think it worked.
Try to delete the .condarc file. I do not know the specific reason but I faced the same issue and when I deleted the .condarc file it worked for me.
I had same error on Linux and solved deleting:
rm -rf .local/lib/python3.9/
rm -rf .local/share/Spyder/
I had to install pytorch with conda, and next I had this error when trying to upgrade system :
sudo dnf upgrade
Traceback (most recent call last):
File "/bin/dnf", line 57, in <module>
from dnf.cli import main
File "/usr/lib/python3.6/site-packages/dnf/__init__.py", line 31, in <module>
import dnf.base
File "/usr/lib/python3.6/site-packages/dnf/base.py", line 26, in <module>
from dnf.comps import CompsQuery
File "/usr/lib/python3.6/site-packages/dnf/comps.py", line 29, in <module>
import dnf.util
File "/usr/lib/python3.6/site-packages/dnf/util.py", line 32, in <module>
import librepo
ModuleNotFoundError: No module named 'librepo'
I saw some answer that uses yum-deprecated for re install python, but it seems I don't have it on my machine. I don't want to reinstall linux another time, and I'm searching for kind an answer for that problem.
When installing pytorch via conda, it also installed cuda. Maybe it can be a problem ?
Before this, I remember (not sure, but kind of) I was running with python2.7 by default, and now it is python 3.6..
First the magic one-liner to fix things:
echo 'import sys;sys.path += ["/usr/lib64/python3.6/site-packages/", "/usr/lib64/python3.6/"]' | sudo tee /usr/lib/python3.6/site-packages/lib64.pth
I got the same error after using conda to install jupyterlab. For some reason conda installed its own version of python which shadows fedora's one. Conda's python searches libraries from /usr/lib/ while fedora's also searches /usr/lib64/. On most linux distros /usr/lib/ is a link for /usr/lib64/ or the other way so either one can be used. librepo is installed in /usr/lib64/.
My conclusions:
Fedora is not completely compatible with conda.
Fedora bug reports get closed as duplicate with links to obviously unrelated reports.
I have stumbled upon the same issue in Fedora 28. I used anaconda as root to update packages system wide, and this broke dnf with the message
ModuleNotFoundError: No module named 'librepo'
yum-deprecated did not work, although Fedora installed it for me after automatically querying for it (a bit strange that this worked since dnf and yum did not work).
In order to fix the issue, I deleted the existing libpython, downloaded the python3 and python3-lib rpms from rpmfind, and installed the new rpms
rm -rf /usr/lib/libpython3*.*
rpm -iv --replacepkgs python3-3.6.6-1.fc28.x86_64.rpm
rpm -iv --replacepkgs python3-libs-3.6.6-1.fc28.x86_64.rpm
Now I know it is better to use pip than anaconda system wide.
Whenever I am running any command using pip, I am getting the following error. I have tried uninstalling python,pip and reinstalling them back again. I also used
sudo apt-get autoremove
and then updated and upgraded
sudo apt-get update
sudo apt-get upgrade
And once again installed python and pip. I am still getting the same error whenever I run any command using pip.
Traceback (most recent call last):
File "/usr/bin/pip", line 9, in <module>
from pip import main
File "/home/shashank/.local/lib/python2.7/site-packages/pip/__init__.py", line 28, in <module>
from pip.vcs import git, mercurial, subversion, bazaar # noqa
File "/home/shashank/.local/lib/python2.7/site-packages/pip/vcs/mercurial.py", line 9, in <module>
from pip.download import path_to_url
File "/home/shashank/.local/lib/python2.7/site-packages/pip/download.py", line 34, in <module>
from pip.utils.logging import indent_log
ImportError: No module named logging
Can anybody suggest a solution?
Edit
I have read the question which is used to flag my question as a duplicate.
I am not using a virtual environment and I have already tried the answer given over there. Moreover I am encountering a problem when I run pip in my terminal
The output of the command
locate logging
/etc/java-9-openjdk/logging.properties
/home/shashank/.local/share/Trash/files/logging.py
/home/shashank/.local/share/Trash/files/logging.pyc
/home/shashank/.local/share/Trash/info/logging.py.trashinfo
/home/shashank/.local/share/Trash/info/logging.pyc.trashinfo
/lib/lsb/init-functions.d/50-ubuntu-logging
/usr/lib/jvm/java-9-openjdk-amd64/jmods/java.logging.jmod
/usr/lib/jvm/java-9-openjdk-amd64/lib/logging.properties
/usr/lib/pm-utils/sleep.d/00logging
/usr/lib/python2.7/logging
/usr/lib/python2.7/dist-packages/pip/utils/logging.py
/usr/lib/python2.7/dist-packages/pip/utils/logging.pyc
/usr/lib/python2.7/logging/__init__.py
/usr/lib/python2.7/logging/__init__.pyc
/usr/lib/python2.7/logging/config.py
/usr/lib/python2.7/logging/config.pyc
/usr/lib/python2.7/logging/handlers.py
/usr/lib/python2.7/logging/handlers.pyc
/usr/lib/python3/dist-packages/UnityTweakTool/config/logging.py
/usr/lib/python3/dist packages/UnityTweakTool/config/__pycache__/logging.cpython-35.pyc
/usr/lib/python3/dist-packages/plainbox/impl/logging.py
/usr/lib/python3/dist-packages/plainbox/impl/__pycache__/logging.cpython-35.pyc
/usr/lib/python3.5/logging
/usr/lib/python3.5/logging/__init__.py
/usr/lib/python3.5/logging/__pycache__
/usr/lib/python3.5/logging/config.py
/usr/lib/python3.5/logging/handlers.py
/usr/lib/python3.5/logging/__pycache__/__init__.cpython-35.pyc
/usr/lib/python3.5/logging/__pycache__/config.cpython-35.pyc
/usr/lib/python3.5/logging/__pycache__/handlers.cpython-35.pyc
/usr/share/icons/hicolor/16x16/categories/applications-microblogging-panel.png
/usr/share/icons/ubuntu-mono-dark/categories/22/applications-microblogging-panel.svg
/usr/share/icons/ubuntu-mono-dark/categories/24/applications-microblogging-panel.svg
/usr/share/icons/ubuntu-mono-light/categories/22/applications-microblogging-panel.svg
/usr/share/icons/ubuntu-mono-light/categories/24/applications-microblogging-panel.svg
/usr/src/linux-headers-4.4.0-59-generic/include/config/fusion/logging.h
/usr/src/linux-headers-4.4.0-59-generic/include/config/scsi/logging.h
/usr/src/linux-headers-4.4.0-59-generic/include/config/sfc/mcdi/logging.h
/usr/src/linux-headers-4.4.0-62-generic/include/config/fusion/logging.h
/usr/src/linux-headers-4.4.0-62-generic/include/config/scsi/logging.h
/usr/src/linux-headers-4.4.0-62-generic/include/config/sfc/mcdi/logging.h
It's obvious from your traceback that you have a version of pip installed in your home directory, at /home/shashank/.local/lib/python2.7/site-packages/pip/. Delete that. If you aren't certain what else is contained there, better delete all /home/shashank/.local/lib/python2.7. After you delete it, it will use the system's default pip that you installed with apt.