No packages can be installed using PIP/PIp3 in Anaconda prompt - python

The error message is:
(base) PS C:\Users\15257> pip --version
Traceback (most recent call last):
File "D:\Anaconda\Scripts\pip-script.py", line 6, in <module>
from pip._internal.cli.main import main
ModuleNotFoundError: No module named 'pip._internal.cli.main'
(base) PS C:\Users\15257> pip3 --version
Traceback (most recent call last):
File "D:\Anaconda\Scripts\pip3-script.py", line 6, in <module>
from pip._internal.cli.main import main
ModuleNotFoundError: No module named 'pip._internal.cli.main'
I tried to reinstall PIP, but it didn't work.
After I reinstall anaconda, pip works fine in the base environment, but after creating a new environment, pip does not work.
(base) PS C:\Users\15257> pip --version
pip 21.0.1 from D:\Anaconda3\lib\site-packages\pip (python 3.8)
(paddle_env) PS C:\Users\15257> pip --version
Traceback (most recent call last):
File "D:\Anaconda3\envs\paddle_env\Scripts\pip-script.py", line
6, in <module>
from pip._internal.cli.main import main
ModuleNotFoundError: No module named 'pip._internal.cli.main'

Related

conda command fails after anaconda installation

After installing Anaconda in Windows I get the following error when trying to use it:
conda command
:
Traceback (most recent call last):
File "C:\Users\mohamed\Anaconda3\Scripts\conda-script.py", line 11, in <module>
from conda.cli import main
ModuleNotFoundError: No module named 'conda'
anaconda command
:
Traceback (most recent call last):
File "C:\Users\mohamed\anaconda3\Scripts\anaconda-script.py", line 6, in <module>
from binstar_client.scripts.cli import main
ModuleNotFoundError: No module named 'binstar_client'
I tried to delete and reinstall anaconda several times but useless

how can I import module if an installed one is incorrect?

I'm getting below error:
Traceback (most recent call last):
File "TicketGeneration_test.py", line 6, in <module>
from MysqlConnection import SQLConnection
File "/Users/ashish.kumar/MerchantRisk/June5th/reports/MysqlConnection.py", line 1, in <module>
import MySQLdb
ImportError: No module named MySQLdb
I've already tried :
pip install MySQL-python
pip install mysqlclient
My python version is Python 2.7.16

ImportError: No module named Include

Attempting to run a program and keep receiving this error message:
Traceback (most recent call last):
File "/home/pi/Desktop/IMU Python/Euler.py", line 5, in <module>
from Include.IMU3 import IMU3
ImportError: No module named 'Include'
I have run $python -m pip install --user include so the package should be in place.

Can't install packages due to "ImportError: No module named six"

I seem to have messed up my python install. I can't install new python packages:
$ pip install arq
Traceback (most recent call last):
File "/usr/local/bin/pip", line 6, in <module>
from pkg_resources import load_entry_point
File "/Users/me/Library/Python/2.7/lib/python/site-packages/pkg_resources/__init__.py", line 48, in <module>
import six
ImportError: No module named six
And trying to address this error directly gives the same error:
$ pip install six
Traceback (most recent call last):
File "/usr/local/bin/pip", line 6, in <module>
from pkg_resources import load_entry_point
File "/Users/me/Library/Python/2.7/lib/python/site-packages/pkg_resources/__init__.py", line 48, in <module>
import six
ImportError: No module named six
I'm not really sure what to do. All pip operations seem to fail for the same reason. pip freeze and just pip give the same result.
I'm on osx.
This is inspired by #Christian Dean's comment. But I am on OSX so what I did was to just reinstall pip from here:
http://pip.readthedocs.io/en/stable/installing/

python setuptools: "No module named version"

I'm trying to install a package using python setup.py build, but it fails when it cannot find setuptools.version. In fact:
import setuptools
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/gpajer/anaconda/lib/python2.7/site- packages/setuptools/__init__.py", line 11, in <module>
import setuptools.version
ImportError: No module named version
Shouldn't there be a file .../anaconda/lib/python2.7/site-packages/setuptools/version.py? There is no such file. Any ideas?
From https://anaconda.org/anaconda/setuptools:
To install this package with conda run:
conda install -c anaconda setuptools=21.2.1

Categories